You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Todor Boev (JIRA)" <ji...@apache.org> on 2008/12/10 15:20:46 UTC

[jira] Created: (FELIX-846) Enhance the iPojo maven plugin to take metadata from pom.

Enhance the iPojo maven plugin to take metadata from pom.
---------------------------------------------------------

                 Key: FELIX-846
                 URL: https://issues.apache.org/jira/browse/FELIX-846
             Project: Felix
          Issue Type: Improvement
          Components: iPOJO
    Affects Versions: iPOJO-1.0.0
         Environment: Runtime: OSGi 4.1 + iPojo
Build: Maven
            Reporter: Todor Boev
            Priority: Minor
             Fix For: iPOJO-1.2.0


It would be nice if the iPojo Maven plugin could consume xml metadata directly from my pom.xml rather than look for a separate metadata file. This makes sense because the metadata.xml is used only at build time and does not progress to become a resource bundle. So it's not realy a resource - it is more part of the build scripts. And as such it's best if it can be integrated into the ultimate build script - the pom.
Also this will match the way metadata is specified to the BND maven plugin. So we would have all data related to the construction of an iPojo bundle laid out in the pom.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Assigned: (FELIX-846) Enhance the iPojo maven plugin to take metadata from pom.

Posted by "Clement Escoffier (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-846?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Clement Escoffier reassigned FELIX-846:
---------------------------------------

    Assignee: Clement Escoffier

> Enhance the iPojo maven plugin to take metadata from pom.
> ---------------------------------------------------------
>
>                 Key: FELIX-846
>                 URL: https://issues.apache.org/jira/browse/FELIX-846
>             Project: Felix
>          Issue Type: Improvement
>          Components: iPOJO
>    Affects Versions: iPOJO-1.0.0
>         Environment: Runtime: OSGi 4.1 + iPojo
> Build: Maven
>            Reporter: Todor Boev
>            Assignee: Clement Escoffier
>            Priority: Minor
>             Fix For: iPOJO-1.2.0
>
>         Attachments: pom.xml
>
>
> It would be nice if the iPojo Maven plugin could consume xml metadata directly from my pom.xml rather than look for a separate metadata file. This makes sense because the metadata.xml is used only at build time and does not progress to become a resource bundle. So it's not realy a resource - it is more part of the build scripts. And as such it's best if it can be integrated into the ultimate build script - the pom.
> Also this will match the way metadata is specified to the BND maven plugin. So we would have all data related to the construction of an iPojo bundle laid out in the pom.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (FELIX-846) Enhance the iPojo maven plugin to take metadata from pom.

Posted by "Clement Escoffier (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-846?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Clement Escoffier resolved FELIX-846.
-------------------------------------

    Resolution: Fixed

I provided a first way to support it in the revision 728951.
The issue comes from Maven/Plexus that provides a DOM mapping for XML configuration. However in this case, we don't want a DOM mapping as the elements are not known in advance (when using external handlers...).
Brett Porter (http://www.nabble.com/maven-plugin-with-an-XML-configuration-td20952804.html) describes how to turn around this issue with a CDATA block. That's the way I implemented it.

So iPOJO configuration can be in the pom file in the metadata element. The configuration is the same as the XML one (copy and paste) but must be in a CDATA block such as: 
<![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>
]]>

This solution is not the cleanest but at least works.

Here are some examples of pom file containing metadata:
Simple configuration : http://svn.apache.org/viewvc/felix/trunk/ipojo/arch/pom.xml?revision=728951&content-type=text%2Fplain&pathrev=728951
Configuration with XSD: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/core/lifecycle-controller/pom.xml?revision=728951&content-type=text%2Fplain&pathrev=728951
Configuration with XSD and external handlers: http://svn.apache.org/viewvc/felix/trunk/ipojo/tests/handler/whiteboard/pom.xml?revision=728951&content-type=text%2Fplain&pathrev=728951

> Enhance the iPojo maven plugin to take metadata from pom.
> ---------------------------------------------------------
>
>                 Key: FELIX-846
>                 URL: https://issues.apache.org/jira/browse/FELIX-846
>             Project: Felix
>          Issue Type: Improvement
>          Components: iPOJO
>    Affects Versions: iPOJO-1.0.0
>         Environment: Runtime: OSGi 4.1 + iPojo
> Build: Maven
>            Reporter: Todor Boev
>            Assignee: Clement Escoffier
>            Priority: Minor
>             Fix For: iPOJO-1.2.0
>
>         Attachments: pom.xml
>
>
> It would be nice if the iPojo Maven plugin could consume xml metadata directly from my pom.xml rather than look for a separate metadata file. This makes sense because the metadata.xml is used only at build time and does not progress to become a resource bundle. So it's not realy a resource - it is more part of the build scripts. And as such it's best if it can be integrated into the ultimate build script - the pom.
> Also this will match the way metadata is specified to the BND maven plugin. So we would have all data related to the construction of an iPojo bundle laid out in the pom.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (FELIX-846) Enhance the iPojo maven plugin to take metadata from pom.

Posted by "Todor Boev (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-846?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Todor Boev updated FELIX-846:
-----------------------------

    Attachment: pom.xml

This is how I imagine it working.  I hope the maven pom schema allows me to pass arbitrary XML to the plugins. in the <configuration> tag. Than I can use namsepaces to instruct the XML parser to validate the part of the pom that the plugin consumes by the iPojo schema. Also I'm not sure if I have to pass more than one xml when I use composites and if this can also be accommodated by the maven pom schema.

> Enhance the iPojo maven plugin to take metadata from pom.
> ---------------------------------------------------------
>
>                 Key: FELIX-846
>                 URL: https://issues.apache.org/jira/browse/FELIX-846
>             Project: Felix
>          Issue Type: Improvement
>          Components: iPOJO
>    Affects Versions: iPOJO-1.0.0
>         Environment: Runtime: OSGi 4.1 + iPojo
> Build: Maven
>            Reporter: Todor Boev
>            Priority: Minor
>             Fix For: iPOJO-1.2.0
>
>         Attachments: pom.xml
>
>
> It would be nice if the iPojo Maven plugin could consume xml metadata directly from my pom.xml rather than look for a separate metadata file. This makes sense because the metadata.xml is used only at build time and does not progress to become a resource bundle. So it's not realy a resource - it is more part of the build scripts. And as such it's best if it can be integrated into the ultimate build script - the pom.
> Also this will match the way metadata is specified to the BND maven plugin. So we would have all data related to the construction of an iPojo bundle laid out in the pom.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Work started: (FELIX-846) Enhance the iPojo maven plugin to take metadata from pom.

Posted by "Clement Escoffier (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/FELIX-846?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Work on FELIX-846 started by Clement Escoffier.

> Enhance the iPojo maven plugin to take metadata from pom.
> ---------------------------------------------------------
>
>                 Key: FELIX-846
>                 URL: https://issues.apache.org/jira/browse/FELIX-846
>             Project: Felix
>          Issue Type: Improvement
>          Components: iPOJO
>    Affects Versions: iPOJO-1.0.0
>         Environment: Runtime: OSGi 4.1 + iPojo
> Build: Maven
>            Reporter: Todor Boev
>            Assignee: Clement Escoffier
>            Priority: Minor
>             Fix For: iPOJO-1.2.0
>
>         Attachments: pom.xml
>
>
> It would be nice if the iPojo Maven plugin could consume xml metadata directly from my pom.xml rather than look for a separate metadata file. This makes sense because the metadata.xml is used only at build time and does not progress to become a resource bundle. So it's not realy a resource - it is more part of the build scripts. And as such it's best if it can be integrated into the ultimate build script - the pom.
> Also this will match the way metadata is specified to the BND maven plugin. So we would have all data related to the construction of an iPojo bundle laid out in the pom.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.