Fix issue Felix-846.
Despite the provided approach is not the cleanest (due to a maven issue), this patch allows setting iPOJO metadata in the pom file inside a CDATA block such as in:
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-ipojo-plugin</artifactId>
<version>1.1.0-SNAPSHOT</version>
<executions>
<execution>
<goals>
<goal>ipojo-bundle</goal>
</goals>
<configuration>
<ignoreAnnotations>true</ignoreAnnotations>
<metadata>
<![CDATA[
<ipojo
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/1.1.0-SNAPSHOT/core.xsd
org.apache.felix.ipojo.whiteboard http://felix.apache.org/ipojo/schemas/1.1.0-SNAPSHOT/whiteboard-pattern.xsd"
xmlns="org.apache.felix.ipojo"
xmlns:wbp="org.apache.felix.ipojo.whiteboard">
<component classname="org.apache.felix.ipojo.test.FooProvider" name="fooprovider">
<provides>
<property field="foo" value="foo"/>
</provides>
</component>
<component classname="org.apache.felix.ipojo.test.FooWhiteBoardPattern" name="under-providers">
<wbp:wbp
filter="(objectclass=org.apache.felix.ipojo.test.FooService)"
onArrival="onArrival" onDeparture="onDeparture" onModification="onModification"
/>
<provides/>
</component>
<component classname="org.apache.felix.ipojo.test.FooWhiteBoardPattern" name="under-properties">
<wbp:wbp filter="(foo=foo)" onArrival="onArrival" onDeparture="onDeparture"
onModification="onModification"
/>
<provides/>
</component>
</ipojo>
]]>
</metadata>
</configuration>
</execution>
</executions>
</plugin>
So, the metadata attribute can be either absent (only annotations), or can contain the name of the metadata file or can contain iPOJO metadata in a CDATA block.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@728951 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/tests/core/lifecycle-controller/pom.xml b/ipojo/tests/core/lifecycle-controller/pom.xml
index 547b259..261edd5 100644
--- a/ipojo/tests/core/lifecycle-controller/pom.xml
+++ b/ipojo/tests/core/lifecycle-controller/pom.xml
@@ -85,6 +85,34 @@
</goals>
<configuration>
<ignoreAnnotations>true</ignoreAnnotations>
+ <metadata>
+ <![CDATA[
+ <ipojo
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/1.1.0-SNAPSHOT/core.xsd"
+ xmlns="org.apache.felix.ipojo">
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.LifecycleControllerTest"
+ name="LFC-Test">
+ <provides />
+ <controller field="m_state" />
+ <properties>
+ <property name="conf" field="m_conf" method="setConf" />
+ </properties>
+ </component>
+
+ <component
+ classname="org.apache.felix.ipojo.test.scenarios.component.LifecycleControllerTest"
+ name="LFC-Test-Immediate" immediate="true" architecture="true">
+ <provides />
+ <controller field="m_state" />
+ <properties>
+ <property name="conf" field="m_conf" method="setConf" />
+ </properties>
+ </component>
+ </ipojo>
+ ]]>
+ </metadata>
</configuration>
</execution>
</executions>
diff --git a/ipojo/tests/core/lifecycle-controller/src/main/resources/metadata.xml b/ipojo/tests/core/lifecycle-controller/src/main/resources/metadata.xml
deleted file mode 100644
index 91d881c..0000000
--- a/ipojo/tests/core/lifecycle-controller/src/main/resources/metadata.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<ipojo
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/1.1.0-SNAPSHOT/core.xsd"
- xmlns="org.apache.felix.ipojo">
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.LifecycleControllerTest"
- name="LFC-Test">
- <provides />
- <controller field="m_state" />
- <properties>
- <property name="conf" field="m_conf" method="setConf" />
- </properties>
- </component>
-
- <component
- classname="org.apache.felix.ipojo.test.scenarios.component.LifecycleControllerTest"
- name="LFC-Test-Immediate" immediate="true" architecture="true">
- <provides />
- <controller field="m_state" />
- <properties>
- <property name="conf" field="m_conf" method="setConf" />
- </properties>
- </component>
-</ipojo>
diff --git a/ipojo/tests/handler/whiteboard/pom.xml b/ipojo/tests/handler/whiteboard/pom.xml
index f366305..423f42c 100644
--- a/ipojo/tests/handler/whiteboard/pom.xml
+++ b/ipojo/tests/handler/whiteboard/pom.xml
@@ -41,21 +41,52 @@
</instructions>
</configuration>
</plugin>
- <plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-ipojo-plugin</artifactId>
- <version>1.1.0-SNAPSHOT</version>
- <executions>
- <execution>
- <goals>
- <goal>ipojo-bundle</goal>
- </goals>
- <configuration>
- <ignoreAnnotations>true</ignoreAnnotations>
- </configuration>
- </execution>
- </executions>
- </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-ipojo-plugin</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>ipojo-bundle</goal>
+ </goals>
+ <configuration>
+ <ignoreAnnotations>true</ignoreAnnotations>
+ <metadata>
+ <![CDATA[
+ <ipojo
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/1.1.0-SNAPSHOT/core.xsd
+ org.apache.felix.ipojo.whiteboard http://felix.apache.org/ipojo/schemas/1.1.0-SNAPSHOT/whiteboard-pattern.xsd"
+ xmlns="org.apache.felix.ipojo"
+ xmlns:wbp="org.apache.felix.ipojo.whiteboard">
+ <component classname="org.apache.felix.ipojo.test.FooProvider" name="fooprovider">
+ <provides>
+ <property field="foo" value="foo"/>
+ </provides>
+ </component>
+
+ <component classname="org.apache.felix.ipojo.test.FooWhiteBoardPattern" name="under-providers">
+ <wbp:wbp
+ filter="(objectclass=org.apache.felix.ipojo.test.FooService)"
+ onArrival="onArrival" onDeparture="onDeparture" onModification="onModification"
+ />
+ <provides/>
+ </component>
+
+ <component classname="org.apache.felix.ipojo.test.FooWhiteBoardPattern" name="under-properties">
+ <wbp:wbp filter="(foo=foo)" onArrival="onArrival" onDeparture="onDeparture"
+ onModification="onModification"
+ />
+ <provides/>
+ </component>
+ </ipojo>
+ ]]>
+ </metadata>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
</project>
diff --git a/ipojo/tests/handler/whiteboard/src/main/resources/metadata.xml b/ipojo/tests/handler/whiteboard/src/main/resources/metadata.xml
deleted file mode 100644
index eb08399..0000000
--- a/ipojo/tests/handler/whiteboard/src/main/resources/metadata.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<ipojo
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/1.1.0-SNAPSHOT/core.xsd
- org.apache.felix.ipojo.whiteboard http://felix.apache.org/ipojo/schemas/1.1.0-SNAPSHOT/whiteboard-pattern.xsd"
- xmlns="org.apache.felix.ipojo"
- xmlns:wbp="org.apache.felix.ipojo.whiteboard">
- <component classname="org.apache.felix.ipojo.test.FooProvider" name="fooprovider">
- <provides>
- <property field="foo" value="foo"/>
- </provides>
- </component>
-
- <component classname="org.apache.felix.ipojo.test.FooWhiteBoardPattern" name="under-providers">
- <wbp:wbp filter="(objectclass=org.apache.felix.ipojo.test.FooService)" onArrival="onArrival" onDeparture="onDeparture" onModification="onModification"/>
- <provides/>
- </component>
-
- <component classname="org.apache.felix.ipojo.test.FooWhiteBoardPattern" name="under-properties">
- <wbp:wbp filter="(foo=foo)" onArrival="onArrival" onDeparture="onDeparture" onModification="onModification"/>
- <provides/>
- </component>
-</ipojo>