You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Stuart McCulloch (JIRA)" <ji...@apache.org> on 2008/01/09 02:20:33 UTC

[jira] Created: (FELIX-449) Add option to limit the classpath passed to BND to just the local project (ie. target/classes)

Add option to limit the classpath passed to BND to just the local project (ie. target/classes)
----------------------------------------------------------------------------------------------

                 Key: FELIX-449
                 URL: https://issues.apache.org/jira/browse/FELIX-449
             Project: Felix
          Issue Type: Improvement
          Components: Maven Bundle Plugin
    Affects Versions: 1.0.0
            Reporter: Stuart McCulloch


Email thread from Apache Commons:

On Dec 28, 2007 12:35 PM, Carsten Ziegeler <cz...@apache.org> wrote:
> Hi,
>
> in the meantime Stuart fixed the problem with the maven bundleplugin, so
> I think we can give it a test drive :)
>
> Attached is a patch for the parent pom of commons and one to demonstrate
> how to add support for OSGi to commons-lang.
>
> The changes to the parent pom are minimal: it just adds the maven
> bundleplugin from the Apache Felix project. We currently need to use a
> snapshot version, but a release is comming soon.
> Besides adding the plugin, the patch also configures the bundle symbolic
> name for all modules. The symbolic name is the unique identifier which
> should follow java package naming. The best value is to use something
> like "org.apache.commons.{artifactId}" where artifact id is commons-lang
> or commons-collections etc.
>
> The patch to commons lang is also very simple. It changes the parent pom
> to the current snapshot (which includes the changes from above) and sets
> the packaging to bundle - this ensures that the bundleplugin runs and
> creates the resulting jar file. So the bundleplugin replaces the maven
> jar plugin. If you leave the packaging as "jar" the bundleplugin will
> not run.
> The last part of the patch adds the configuration to the bundleplugin.
> The export "*" exports all packages definied in this module for other
> bundles, so all classes are public. All packages are marked with the
> current version which allows to run different versions in parallel.
> The imports are not specified as they are calculated automatically by
> the bundleplugin.
>
> And that's it :)
>
> The changes to the other projects should be similar.

I tried using the bundle plugin (I checked out and built the latest
from svn) with Commons Validator and it produced the following
MANIFEST.MF:
   http://people.apache.org/~niallp/commons-osgi/commons-validator-MANIFEST.MF

It seems to have picked up some Manifest entries from BeanUtils  - for example:

Extension-Name: org.apache.commons.beanutils
Implementation-Version: 1.6
Specification-Title: Jakarta Commons Beanutils
Implementation-Title: org.apache.commons.beanutils

Niall

(N.B. The BeanUtils 1.7.0 jar has version incorectly specifying 1.6 in
its manifest.

> Carsten
>
>
> --
> Carsten Ziegeler
> cziegeler@apache.org
>
> Index: /Users/cziegeler/Developer/workspaces/default/commons-proper/commons-parent/pom.xml
> ===================================================================
> --- /Users/cziegeler/Developer/workspaces/default/commons-proper/commons-parent/pom.xml (revision 605909)
> +++ /Users/cziegeler/Developer/workspaces/default/commons-proper/commons-parent/pom.xml (working copy)
> @@ -159,6 +159,12 @@
>            <artifactId>maven-release-plugin</artifactId>
>            <version>2.0-beta-7</version>
>          </plugin>
> +        <plugin>
> +          <groupId>org.apache.felix</groupId>
> +          <artifactId>maven-bundle-plugin</artifactId>
> +          <version>1.1.0-SNAPSHOT</version>
> +          <inherited>true</inherited>
> +        </plugin>
>        </plugins>
>      </pluginManagement>
>      <plugins>
> @@ -194,6 +200,15 @@
>            <jdkLevel>${maven.compile.source}</jdkLevel>
>          </configuration>
>        </plugin>
> +      <plugin>
> +        <groupId>org.apache.felix</groupId>
> +        <artifactId>maven-bundle-plugin</artifactId>
> +        <configuration>
> +          <instructions>
> +            <Bundle-SymbolicName>org.apache.commons.${pom.artifactId}</Bundle-SymbolicName>
> +          </instructions>
> +        </configuration>
> +      </plugin>
>      </plugins>
>    </build>
>
>
> Index: /Users/cziegeler/Developer/workspaces/default/commons-proper/lang/pom.xml
> ===================================================================
> --- /Users/cziegeler/Developer/workspaces/default/commons-proper/lang/pom.xml   (revision 605909)
> +++ /Users/cziegeler/Developer/workspaces/default/commons-proper/lang/pom.xml   (working copy)
> @@ -22,13 +22,14 @@
>    <parent>
>      <groupId>org.apache.commons</groupId>
>      <artifactId>commons-parent</artifactId>
> -    <version>5</version>
> +    <version>6-SNAPSHOT</version>
>    </parent>
>    <modelVersion>4.0.0</modelVersion>
>    <groupId>commons-lang</groupId>
>    <artifactId>commons-lang</artifactId>
>    <version>2.4-SNAPSHOT</version>
>    <name>Commons Lang</name>
> +  <packaging>bundle</packaging>
>
>    <inceptionYear>2001</inceptionYear>
>      <description>
> @@ -401,6 +402,16 @@
>            <tarLongFileMode>gnu</tarLongFileMode>
>          </configuration>
>        </plugin>
> +      <plugin>
> +        <groupId>org.apache.felix</groupId>
> +        <artifactId>maven-bundle-plugin</artifactId>
> +        <extensions>true</extensions>
> +        <configuration>
> +          <instructions>
> +            <Export-Package>*;version=${pom.version}</Export-Package>
> +          </instructions>
> +        </configuration>
> +      </plugin>
>      </plugins>
>    </build>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org

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


[jira] Assigned: (FELIX-449) Add option to limit the classpath passed to BND to just the local project (ie. target/classes)

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

Stuart McCulloch reassigned FELIX-449:
--------------------------------------

    Assignee: Stuart McCulloch

> Add option to limit the classpath passed to BND to just the local project (ie. target/classes)
> ----------------------------------------------------------------------------------------------
>
>                 Key: FELIX-449
>                 URL: https://issues.apache.org/jira/browse/FELIX-449
>             Project: Felix
>          Issue Type: Improvement
>          Components: Maven Bundle Plugin
>    Affects Versions: 1.0.0
>            Reporter: Stuart McCulloch
>            Assignee: Stuart McCulloch
>
> Email thread from Apache Commons:
> On Dec 28, 2007 12:35 PM, Carsten Ziegeler <cz...@apache.org> wrote:
> > Hi,
> >
> > in the meantime Stuart fixed the problem with the maven bundleplugin, so
> > I think we can give it a test drive :)
> >
> > Attached is a patch for the parent pom of commons and one to demonstrate
> > how to add support for OSGi to commons-lang.
> >
> > The changes to the parent pom are minimal: it just adds the maven
> > bundleplugin from the Apache Felix project. We currently need to use a
> > snapshot version, but a release is comming soon.
> > Besides adding the plugin, the patch also configures the bundle symbolic
> > name for all modules. The symbolic name is the unique identifier which
> > should follow java package naming. The best value is to use something
> > like "org.apache.commons.{artifactId}" where artifact id is commons-lang
> > or commons-collections etc.
> >
> > The patch to commons lang is also very simple. It changes the parent pom
> > to the current snapshot (which includes the changes from above) and sets
> > the packaging to bundle - this ensures that the bundleplugin runs and
> > creates the resulting jar file. So the bundleplugin replaces the maven
> > jar plugin. If you leave the packaging as "jar" the bundleplugin will
> > not run.
> > The last part of the patch adds the configuration to the bundleplugin.
> > The export "*" exports all packages definied in this module for other
> > bundles, so all classes are public. All packages are marked with the
> > current version which allows to run different versions in parallel.
> > The imports are not specified as they are calculated automatically by
> > the bundleplugin.
> >
> > And that's it :)
> >
> > The changes to the other projects should be similar.
> I tried using the bundle plugin (I checked out and built the latest
> from svn) with Commons Validator and it produced the following
> MANIFEST.MF:
>    http://people.apache.org/~niallp/commons-osgi/commons-validator-MANIFEST.MF
> It seems to have picked up some Manifest entries from BeanUtils  - for example:
> Extension-Name: org.apache.commons.beanutils
> Implementation-Version: 1.6
> Specification-Title: Jakarta Commons Beanutils
> Implementation-Title: org.apache.commons.beanutils
> Niall
> (N.B. The BeanUtils 1.7.0 jar has version incorectly specifying 1.6 in
> its manifest.
> > Carsten
> >
> >
> > --
> > Carsten Ziegeler
> > cziegeler@apache.org
> >
> > Index: /Users/cziegeler/Developer/workspaces/default/commons-proper/commons-parent/pom.xml
> > ===================================================================
> > --- /Users/cziegeler/Developer/workspaces/default/commons-proper/commons-parent/pom.xml (revision 605909)
> > +++ /Users/cziegeler/Developer/workspaces/default/commons-proper/commons-parent/pom.xml (working copy)
> > @@ -159,6 +159,12 @@
> >            <artifactId>maven-release-plugin</artifactId>
> >            <version>2.0-beta-7</version>
> >          </plugin>
> > +        <plugin>
> > +          <groupId>org.apache.felix</groupId>
> > +          <artifactId>maven-bundle-plugin</artifactId>
> > +          <version>1.1.0-SNAPSHOT</version>
> > +          <inherited>true</inherited>
> > +        </plugin>
> >        </plugins>
> >      </pluginManagement>
> >      <plugins>
> > @@ -194,6 +200,15 @@
> >            <jdkLevel>${maven.compile.source}</jdkLevel>
> >          </configuration>
> >        </plugin>
> > +      <plugin>
> > +        <groupId>org.apache.felix</groupId>
> > +        <artifactId>maven-bundle-plugin</artifactId>
> > +        <configuration>
> > +          <instructions>
> > +            <Bundle-SymbolicName>org.apache.commons.${pom.artifactId}</Bundle-SymbolicName>
> > +          </instructions>
> > +        </configuration>
> > +      </plugin>
> >      </plugins>
> >    </build>
> >
> >
> > Index: /Users/cziegeler/Developer/workspaces/default/commons-proper/lang/pom.xml
> > ===================================================================
> > --- /Users/cziegeler/Developer/workspaces/default/commons-proper/lang/pom.xml   (revision 605909)
> > +++ /Users/cziegeler/Developer/workspaces/default/commons-proper/lang/pom.xml   (working copy)
> > @@ -22,13 +22,14 @@
> >    <parent>
> >      <groupId>org.apache.commons</groupId>
> >      <artifactId>commons-parent</artifactId>
> > -    <version>5</version>
> > +    <version>6-SNAPSHOT</version>
> >    </parent>
> >    <modelVersion>4.0.0</modelVersion>
> >    <groupId>commons-lang</groupId>
> >    <artifactId>commons-lang</artifactId>
> >    <version>2.4-SNAPSHOT</version>
> >    <name>Commons Lang</name>
> > +  <packaging>bundle</packaging>
> >
> >    <inceptionYear>2001</inceptionYear>
> >      <description>
> > @@ -401,6 +402,16 @@
> >            <tarLongFileMode>gnu</tarLongFileMode>
> >          </configuration>
> >        </plugin>
> > +      <plugin>
> > +        <groupId>org.apache.felix</groupId>
> > +        <artifactId>maven-bundle-plugin</artifactId>
> > +        <extensions>true</extensions>
> > +        <configuration>
> > +          <instructions>
> > +            <Export-Package>*;version=${pom.version}</Export-Package>
> > +          </instructions>
> > +        </configuration>
> > +      </plugin>
> >      </plugins>
> >    </build>
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > For additional commands, e-mail: dev-help@commons.apache.org
> >
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org

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


[jira] Commented: (FELIX-449) Add option to limit the classpath passed to BND to just the local project (ie. target/classes)

Posted by "Stuart McCulloch (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12557101#action_12557101 ] 

Stuart McCulloch commented on FELIX-449:
----------------------------------------

sent the following reply, with a link to this issue
==============================

yes, I believe it's because you used:

   <Export-Package>*;version=${pom.version}</Export-Package>

which instructs the Bnd tool to include _everything_ from the project's Maven classpath
- this will include all metadata and classes from any compile or runtime dependencies,
in this case BeanUtils metadata (you'll probably see BeanUtils classes in the jar)

<background>

The Bnd tool accepts a classpath and set of instructions, and uses these to pull classes
and resources into the final bundle. This makes Bnd very flexible, because you can use it
to separate the same project classpath into different bundles just by supplying different
instructions.

The three key instructions that pull in content are Export-Package, Private-Package and
Include-Resource. Because Bnd doesn't know about Maven dependencies or resources
(it can also be used with Ant and Eclipse) we do various translations in the bundleplugin
such as adding Include-Resource entries for resource directories, and changing our local
Embed-Dependency instructions into the real Bnd instructions needed to embed jarfiles.

</background>

Anyway, back to the issue - normally we'd expect users to set an explicit Export-Package,
not use the global export wildcard. For commons-validator I would expect something like:

   <Export-Package> org.apache.commons.validator.*;version=${pom.version}</Export-Package>

However, to smooth the transition for commons projects we could add a bundleplugin option
to exclude dependencies from the classpath passed to Bnd - that would mean you could use
<Export-Package>*</Export-Package> without dragging in your dependencies.

NOTE: this won't be the default setting, because several users rely on the current behaviour,
           which is useful when assembling a single bundle from a number of dependencies.


> Add option to limit the classpath passed to BND to just the local project (ie. target/classes)
> ----------------------------------------------------------------------------------------------
>
>                 Key: FELIX-449
>                 URL: https://issues.apache.org/jira/browse/FELIX-449
>             Project: Felix
>          Issue Type: Improvement
>          Components: Maven Bundle Plugin
>    Affects Versions: 1.0.0
>            Reporter: Stuart McCulloch
>            Assignee: Stuart McCulloch
>
> Email thread from Apache Commons:
> On Dec 28, 2007 12:35 PM, Carsten Ziegeler <cz...@apache.org> wrote:
> > Hi,
> >
> > in the meantime Stuart fixed the problem with the maven bundleplugin, so
> > I think we can give it a test drive :)
> >
> > Attached is a patch for the parent pom of commons and one to demonstrate
> > how to add support for OSGi to commons-lang.
> >
> > The changes to the parent pom are minimal: it just adds the maven
> > bundleplugin from the Apache Felix project. We currently need to use a
> > snapshot version, but a release is comming soon.
> > Besides adding the plugin, the patch also configures the bundle symbolic
> > name for all modules. The symbolic name is the unique identifier which
> > should follow java package naming. The best value is to use something
> > like "org.apache.commons.{artifactId}" where artifact id is commons-lang
> > or commons-collections etc.
> >
> > The patch to commons lang is also very simple. It changes the parent pom
> > to the current snapshot (which includes the changes from above) and sets
> > the packaging to bundle - this ensures that the bundleplugin runs and
> > creates the resulting jar file. So the bundleplugin replaces the maven
> > jar plugin. If you leave the packaging as "jar" the bundleplugin will
> > not run.
> > The last part of the patch adds the configuration to the bundleplugin.
> > The export "*" exports all packages definied in this module for other
> > bundles, so all classes are public. All packages are marked with the
> > current version which allows to run different versions in parallel.
> > The imports are not specified as they are calculated automatically by
> > the bundleplugin.
> >
> > And that's it :)
> >
> > The changes to the other projects should be similar.
> I tried using the bundle plugin (I checked out and built the latest
> from svn) with Commons Validator and it produced the following
> MANIFEST.MF:
>    http://people.apache.org/~niallp/commons-osgi/commons-validator-MANIFEST.MF
> It seems to have picked up some Manifest entries from BeanUtils  - for example:
> Extension-Name: org.apache.commons.beanutils
> Implementation-Version: 1.6
> Specification-Title: Jakarta Commons Beanutils
> Implementation-Title: org.apache.commons.beanutils
> Niall
> (N.B. The BeanUtils 1.7.0 jar has version incorectly specifying 1.6 in
> its manifest.
> > Carsten
> >
> >
> > --
> > Carsten Ziegeler
> > cziegeler@apache.org
> >
> > Index: /Users/cziegeler/Developer/workspaces/default/commons-proper/commons-parent/pom.xml
> > ===================================================================
> > --- /Users/cziegeler/Developer/workspaces/default/commons-proper/commons-parent/pom.xml (revision 605909)
> > +++ /Users/cziegeler/Developer/workspaces/default/commons-proper/commons-parent/pom.xml (working copy)
> > @@ -159,6 +159,12 @@
> >            <artifactId>maven-release-plugin</artifactId>
> >            <version>2.0-beta-7</version>
> >          </plugin>
> > +        <plugin>
> > +          <groupId>org.apache.felix</groupId>
> > +          <artifactId>maven-bundle-plugin</artifactId>
> > +          <version>1.1.0-SNAPSHOT</version>
> > +          <inherited>true</inherited>
> > +        </plugin>
> >        </plugins>
> >      </pluginManagement>
> >      <plugins>
> > @@ -194,6 +200,15 @@
> >            <jdkLevel>${maven.compile.source}</jdkLevel>
> >          </configuration>
> >        </plugin>
> > +      <plugin>
> > +        <groupId>org.apache.felix</groupId>
> > +        <artifactId>maven-bundle-plugin</artifactId>
> > +        <configuration>
> > +          <instructions>
> > +            <Bundle-SymbolicName>org.apache.commons.${pom.artifactId}</Bundle-SymbolicName>
> > +          </instructions>
> > +        </configuration>
> > +      </plugin>
> >      </plugins>
> >    </build>
> >
> >
> > Index: /Users/cziegeler/Developer/workspaces/default/commons-proper/lang/pom.xml
> > ===================================================================
> > --- /Users/cziegeler/Developer/workspaces/default/commons-proper/lang/pom.xml   (revision 605909)
> > +++ /Users/cziegeler/Developer/workspaces/default/commons-proper/lang/pom.xml   (working copy)
> > @@ -22,13 +22,14 @@
> >    <parent>
> >      <groupId>org.apache.commons</groupId>
> >      <artifactId>commons-parent</artifactId>
> > -    <version>5</version>
> > +    <version>6-SNAPSHOT</version>
> >    </parent>
> >    <modelVersion>4.0.0</modelVersion>
> >    <groupId>commons-lang</groupId>
> >    <artifactId>commons-lang</artifactId>
> >    <version>2.4-SNAPSHOT</version>
> >    <name>Commons Lang</name>
> > +  <packaging>bundle</packaging>
> >
> >    <inceptionYear>2001</inceptionYear>
> >      <description>
> > @@ -401,6 +402,16 @@
> >            <tarLongFileMode>gnu</tarLongFileMode>
> >          </configuration>
> >        </plugin>
> > +      <plugin>
> > +        <groupId>org.apache.felix</groupId>
> > +        <artifactId>maven-bundle-plugin</artifactId>
> > +        <extensions>true</extensions>
> > +        <configuration>
> > +          <instructions>
> > +            <Export-Package>*;version=${pom.version}</Export-Package>
> > +          </instructions>
> > +        </configuration>
> > +      </plugin>
> >      </plugins>
> >    </build>
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > For additional commands, e-mail: dev-help@commons.apache.org
> >
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org

-- 
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-449) Add option to limit the classpath passed to BND to just the local project (ie. target/classes)

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

Work on FELIX-449 started by Stuart McCulloch.

> Add option to limit the classpath passed to BND to just the local project (ie. target/classes)
> ----------------------------------------------------------------------------------------------
>
>                 Key: FELIX-449
>                 URL: https://issues.apache.org/jira/browse/FELIX-449
>             Project: Felix
>          Issue Type: Improvement
>          Components: Maven Bundle Plugin
>    Affects Versions: 1.0.0
>            Reporter: Stuart McCulloch
>            Assignee: Stuart McCulloch
>         Attachments: FELIX_449_20080109.txt, validator-MANIFEST-bundle-excludeDependencies.MF, validator-MANIFEST-bundle.MF, validator-MANIFEST-normal.MF
>
>
> Email thread from Apache Commons:
> On Dec 28, 2007 12:35 PM, Carsten Ziegeler <cz...@apache.org> wrote:
> > Hi,
> >
> > in the meantime Stuart fixed the problem with the maven bundleplugin, so
> > I think we can give it a test drive :)
> >
> > Attached is a patch for the parent pom of commons and one to demonstrate
> > how to add support for OSGi to commons-lang.
> >
> > The changes to the parent pom are minimal: it just adds the maven
> > bundleplugin from the Apache Felix project. We currently need to use a
> > snapshot version, but a release is comming soon.
> > Besides adding the plugin, the patch also configures the bundle symbolic
> > name for all modules. The symbolic name is the unique identifier which
> > should follow java package naming. The best value is to use something
> > like "org.apache.commons.{artifactId}" where artifact id is commons-lang
> > or commons-collections etc.
> >
> > The patch to commons lang is also very simple. It changes the parent pom
> > to the current snapshot (which includes the changes from above) and sets
> > the packaging to bundle - this ensures that the bundleplugin runs and
> > creates the resulting jar file. So the bundleplugin replaces the maven
> > jar plugin. If you leave the packaging as "jar" the bundleplugin will
> > not run.
> > The last part of the patch adds the configuration to the bundleplugin.
> > The export "*" exports all packages definied in this module for other
> > bundles, so all classes are public. All packages are marked with the
> > current version which allows to run different versions in parallel.
> > The imports are not specified as they are calculated automatically by
> > the bundleplugin.
> >
> > And that's it :)
> >
> > The changes to the other projects should be similar.
> I tried using the bundle plugin (I checked out and built the latest
> from svn) with Commons Validator and it produced the following
> MANIFEST.MF:
>    http://people.apache.org/~niallp/commons-osgi/commons-validator-MANIFEST.MF
> It seems to have picked up some Manifest entries from BeanUtils  - for example:
> Extension-Name: org.apache.commons.beanutils
> Implementation-Version: 1.6
> Specification-Title: Jakarta Commons Beanutils
> Implementation-Title: org.apache.commons.beanutils
> Niall
> (N.B. The BeanUtils 1.7.0 jar has version incorectly specifying 1.6 in
> its manifest.
> > Carsten
> >
> >
> > --
> > Carsten Ziegeler
> > cziegeler@apache.org
> >
> > Index: /Users/cziegeler/Developer/workspaces/default/commons-proper/commons-parent/pom.xml
> > ===================================================================
> > --- /Users/cziegeler/Developer/workspaces/default/commons-proper/commons-parent/pom.xml (revision 605909)
> > +++ /Users/cziegeler/Developer/workspaces/default/commons-proper/commons-parent/pom.xml (working copy)
> > @@ -159,6 +159,12 @@
> >            <artifactId>maven-release-plugin</artifactId>
> >            <version>2.0-beta-7</version>
> >          </plugin>
> > +        <plugin>
> > +          <groupId>org.apache.felix</groupId>
> > +          <artifactId>maven-bundle-plugin</artifactId>
> > +          <version>1.1.0-SNAPSHOT</version>
> > +          <inherited>true</inherited>
> > +        </plugin>
> >        </plugins>
> >      </pluginManagement>
> >      <plugins>
> > @@ -194,6 +200,15 @@
> >            <jdkLevel>${maven.compile.source}</jdkLevel>
> >          </configuration>
> >        </plugin>
> > +      <plugin>
> > +        <groupId>org.apache.felix</groupId>
> > +        <artifactId>maven-bundle-plugin</artifactId>
> > +        <configuration>
> > +          <instructions>
> > +            <Bundle-SymbolicName>org.apache.commons.${pom.artifactId}</Bundle-SymbolicName>
> > +          </instructions>
> > +        </configuration>
> > +      </plugin>
> >      </plugins>
> >    </build>
> >
> >
> > Index: /Users/cziegeler/Developer/workspaces/default/commons-proper/lang/pom.xml
> > ===================================================================
> > --- /Users/cziegeler/Developer/workspaces/default/commons-proper/lang/pom.xml   (revision 605909)
> > +++ /Users/cziegeler/Developer/workspaces/default/commons-proper/lang/pom.xml   (working copy)
> > @@ -22,13 +22,14 @@
> >    <parent>
> >      <groupId>org.apache.commons</groupId>
> >      <artifactId>commons-parent</artifactId>
> > -    <version>5</version>
> > +    <version>6-SNAPSHOT</version>
> >    </parent>
> >    <modelVersion>4.0.0</modelVersion>
> >    <groupId>commons-lang</groupId>
> >    <artifactId>commons-lang</artifactId>
> >    <version>2.4-SNAPSHOT</version>
> >    <name>Commons Lang</name>
> > +  <packaging>bundle</packaging>
> >
> >    <inceptionYear>2001</inceptionYear>
> >      <description>
> > @@ -401,6 +402,16 @@
> >            <tarLongFileMode>gnu</tarLongFileMode>
> >          </configuration>
> >        </plugin>
> > +      <plugin>
> > +        <groupId>org.apache.felix</groupId>
> > +        <artifactId>maven-bundle-plugin</artifactId>
> > +        <extensions>true</extensions>
> > +        <configuration>
> > +          <instructions>
> > +            <Export-Package>*;version=${pom.version}</Export-Package>
> > +          </instructions>
> > +        </configuration>
> > +      </plugin>
> >      </plugins>
> >    </build>
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > For additional commands, e-mail: dev-help@commons.apache.org
> >
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org

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


[jira] Updated: (FELIX-449) Add option to limit the classpath passed to BND to just the local project (ie. target/classes)

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

Niall Pemberton updated FELIX-449:
----------------------------------

    Attachment: validator-MANIFEST-bundle-excludeDependencies.MF
                validator-MANIFEST-bundle.MF
                validator-MANIFEST-normal.MF

Thanks Stuart 

yes, I did use:

   <Export-Package>*;version=${pom.version}</Export-Package> 

- I tried the patch and that seems to work - the only caveat is that I don't currently use OSGi :(

For info, I'm attaching the "normal" commons valdiator MANIFEST, one generated and versions both with and without the new excludeDependencies option set.

So this looks like it resolves out issue. The only comment I would make is that when the excludeDependencies is not set (false) it still doesn't seem right that the non-OSGi Manifest entries are from BeanUtils rather than Validator:

Specification-Title: Jakarta Commons Beanutils
Specification-Version: 1.6
Implementation-Version: 1.6
Extension-Name: org.apache.commons.beanutils
Implementation-Title: org.apache.commons.beanutils


> Add option to limit the classpath passed to BND to just the local project (ie. target/classes)
> ----------------------------------------------------------------------------------------------
>
>                 Key: FELIX-449
>                 URL: https://issues.apache.org/jira/browse/FELIX-449
>             Project: Felix
>          Issue Type: Improvement
>          Components: Maven Bundle Plugin
>    Affects Versions: 1.0.0
>            Reporter: Stuart McCulloch
>            Assignee: Stuart McCulloch
>         Attachments: FELIX_449_20080109.txt, validator-MANIFEST-bundle-excludeDependencies.MF, validator-MANIFEST-bundle.MF, validator-MANIFEST-normal.MF
>
>
> Email thread from Apache Commons:
> On Dec 28, 2007 12:35 PM, Carsten Ziegeler <cz...@apache.org> wrote:
> > Hi,
> >
> > in the meantime Stuart fixed the problem with the maven bundleplugin, so
> > I think we can give it a test drive :)
> >
> > Attached is a patch for the parent pom of commons and one to demonstrate
> > how to add support for OSGi to commons-lang.
> >
> > The changes to the parent pom are minimal: it just adds the maven
> > bundleplugin from the Apache Felix project. We currently need to use a
> > snapshot version, but a release is comming soon.
> > Besides adding the plugin, the patch also configures the bundle symbolic
> > name for all modules. The symbolic name is the unique identifier which
> > should follow java package naming. The best value is to use something
> > like "org.apache.commons.{artifactId}" where artifact id is commons-lang
> > or commons-collections etc.
> >
> > The patch to commons lang is also very simple. It changes the parent pom
> > to the current snapshot (which includes the changes from above) and sets
> > the packaging to bundle - this ensures that the bundleplugin runs and
> > creates the resulting jar file. So the bundleplugin replaces the maven
> > jar plugin. If you leave the packaging as "jar" the bundleplugin will
> > not run.
> > The last part of the patch adds the configuration to the bundleplugin.
> > The export "*" exports all packages definied in this module for other
> > bundles, so all classes are public. All packages are marked with the
> > current version which allows to run different versions in parallel.
> > The imports are not specified as they are calculated automatically by
> > the bundleplugin.
> >
> > And that's it :)
> >
> > The changes to the other projects should be similar.
> I tried using the bundle plugin (I checked out and built the latest
> from svn) with Commons Validator and it produced the following
> MANIFEST.MF:
>    http://people.apache.org/~niallp/commons-osgi/commons-validator-MANIFEST.MF
> It seems to have picked up some Manifest entries from BeanUtils  - for example:
> Extension-Name: org.apache.commons.beanutils
> Implementation-Version: 1.6
> Specification-Title: Jakarta Commons Beanutils
> Implementation-Title: org.apache.commons.beanutils
> Niall
> (N.B. The BeanUtils 1.7.0 jar has version incorectly specifying 1.6 in
> its manifest.
> > Carsten
> >
> >
> > --
> > Carsten Ziegeler
> > cziegeler@apache.org
> >
> > Index: /Users/cziegeler/Developer/workspaces/default/commons-proper/commons-parent/pom.xml
> > ===================================================================
> > --- /Users/cziegeler/Developer/workspaces/default/commons-proper/commons-parent/pom.xml (revision 605909)
> > +++ /Users/cziegeler/Developer/workspaces/default/commons-proper/commons-parent/pom.xml (working copy)
> > @@ -159,6 +159,12 @@
> >            <artifactId>maven-release-plugin</artifactId>
> >            <version>2.0-beta-7</version>
> >          </plugin>
> > +        <plugin>
> > +          <groupId>org.apache.felix</groupId>
> > +          <artifactId>maven-bundle-plugin</artifactId>
> > +          <version>1.1.0-SNAPSHOT</version>
> > +          <inherited>true</inherited>
> > +        </plugin>
> >        </plugins>
> >      </pluginManagement>
> >      <plugins>
> > @@ -194,6 +200,15 @@
> >            <jdkLevel>${maven.compile.source}</jdkLevel>
> >          </configuration>
> >        </plugin>
> > +      <plugin>
> > +        <groupId>org.apache.felix</groupId>
> > +        <artifactId>maven-bundle-plugin</artifactId>
> > +        <configuration>
> > +          <instructions>
> > +            <Bundle-SymbolicName>org.apache.commons.${pom.artifactId}</Bundle-SymbolicName>
> > +          </instructions>
> > +        </configuration>
> > +      </plugin>
> >      </plugins>
> >    </build>
> >
> >
> > Index: /Users/cziegeler/Developer/workspaces/default/commons-proper/lang/pom.xml
> > ===================================================================
> > --- /Users/cziegeler/Developer/workspaces/default/commons-proper/lang/pom.xml   (revision 605909)
> > +++ /Users/cziegeler/Developer/workspaces/default/commons-proper/lang/pom.xml   (working copy)
> > @@ -22,13 +22,14 @@
> >    <parent>
> >      <groupId>org.apache.commons</groupId>
> >      <artifactId>commons-parent</artifactId>
> > -    <version>5</version>
> > +    <version>6-SNAPSHOT</version>
> >    </parent>
> >    <modelVersion>4.0.0</modelVersion>
> >    <groupId>commons-lang</groupId>
> >    <artifactId>commons-lang</artifactId>
> >    <version>2.4-SNAPSHOT</version>
> >    <name>Commons Lang</name>
> > +  <packaging>bundle</packaging>
> >
> >    <inceptionYear>2001</inceptionYear>
> >      <description>
> > @@ -401,6 +402,16 @@
> >            <tarLongFileMode>gnu</tarLongFileMode>
> >          </configuration>
> >        </plugin>
> > +      <plugin>
> > +        <groupId>org.apache.felix</groupId>
> > +        <artifactId>maven-bundle-plugin</artifactId>
> > +        <extensions>true</extensions>
> > +        <configuration>
> > +          <instructions>
> > +            <Export-Package>*;version=${pom.version}</Export-Package>
> > +          </instructions>
> > +        </configuration>
> > +      </plugin>
> >      </plugins>
> >    </build>
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > For additional commands, e-mail: dev-help@commons.apache.org
> >
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org

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


[jira] Commented: (FELIX-449) Add option to limit the classpath passed to BND to just the local project (ie. target/classes)

Posted by "Stuart McCulloch (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12557212#action_12557212 ] 

Stuart McCulloch commented on FELIX-449:
----------------------------------------

FYI, the reason you get the BeanUtils manifest entries is because of how the generated bundle manifest is merged with the customized manifest from the maven-jar-plugin.

Currently the generated bundle entries "win" over the customized entries. Perhaps this should be the other way round - my only reservation was that if a project already had customized OSGi entries they could overwrite the generated entries, but I guess this is what people would expect (ie. customized entries have higher precendence?).

It's a straightforward change to flip this ordering.

> Add option to limit the classpath passed to BND to just the local project (ie. target/classes)
> ----------------------------------------------------------------------------------------------
>
>                 Key: FELIX-449
>                 URL: https://issues.apache.org/jira/browse/FELIX-449
>             Project: Felix
>          Issue Type: Improvement
>          Components: Maven Bundle Plugin
>    Affects Versions: 1.0.0
>            Reporter: Stuart McCulloch
>            Assignee: Stuart McCulloch
>         Attachments: FELIX_449_20080109.txt, validator-MANIFEST-bundle-excludeDependencies.MF, validator-MANIFEST-bundle.MF, validator-MANIFEST-normal.MF
>
>
> Email thread from Apache Commons:
> On Dec 28, 2007 12:35 PM, Carsten Ziegeler <cz...@apache.org> wrote:
> > Hi,
> >
> > in the meantime Stuart fixed the problem with the maven bundleplugin, so
> > I think we can give it a test drive :)
> >
> > Attached is a patch for the parent pom of commons and one to demonstrate
> > how to add support for OSGi to commons-lang.
> >
> > The changes to the parent pom are minimal: it just adds the maven
> > bundleplugin from the Apache Felix project. We currently need to use a
> > snapshot version, but a release is comming soon.
> > Besides adding the plugin, the patch also configures the bundle symbolic
> > name for all modules. The symbolic name is the unique identifier which
> > should follow java package naming. The best value is to use something
> > like "org.apache.commons.{artifactId}" where artifact id is commons-lang
> > or commons-collections etc.
> >
> > The patch to commons lang is also very simple. It changes the parent pom
> > to the current snapshot (which includes the changes from above) and sets
> > the packaging to bundle - this ensures that the bundleplugin runs and
> > creates the resulting jar file. So the bundleplugin replaces the maven
> > jar plugin. If you leave the packaging as "jar" the bundleplugin will
> > not run.
> > The last part of the patch adds the configuration to the bundleplugin.
> > The export "*" exports all packages definied in this module for other
> > bundles, so all classes are public. All packages are marked with the
> > current version which allows to run different versions in parallel.
> > The imports are not specified as they are calculated automatically by
> > the bundleplugin.
> >
> > And that's it :)
> >
> > The changes to the other projects should be similar.
> I tried using the bundle plugin (I checked out and built the latest
> from svn) with Commons Validator and it produced the following
> MANIFEST.MF:
>    http://people.apache.org/~niallp/commons-osgi/commons-validator-MANIFEST.MF
> It seems to have picked up some Manifest entries from BeanUtils  - for example:
> Extension-Name: org.apache.commons.beanutils
> Implementation-Version: 1.6
> Specification-Title: Jakarta Commons Beanutils
> Implementation-Title: org.apache.commons.beanutils
> Niall
> (N.B. The BeanUtils 1.7.0 jar has version incorectly specifying 1.6 in
> its manifest.
> > Carsten
> >
> >
> > --
> > Carsten Ziegeler
> > cziegeler@apache.org
> >
> > Index: /Users/cziegeler/Developer/workspaces/default/commons-proper/commons-parent/pom.xml
> > ===================================================================
> > --- /Users/cziegeler/Developer/workspaces/default/commons-proper/commons-parent/pom.xml (revision 605909)
> > +++ /Users/cziegeler/Developer/workspaces/default/commons-proper/commons-parent/pom.xml (working copy)
> > @@ -159,6 +159,12 @@
> >            <artifactId>maven-release-plugin</artifactId>
> >            <version>2.0-beta-7</version>
> >          </plugin>
> > +        <plugin>
> > +          <groupId>org.apache.felix</groupId>
> > +          <artifactId>maven-bundle-plugin</artifactId>
> > +          <version>1.1.0-SNAPSHOT</version>
> > +          <inherited>true</inherited>
> > +        </plugin>
> >        </plugins>
> >      </pluginManagement>
> >      <plugins>
> > @@ -194,6 +200,15 @@
> >            <jdkLevel>${maven.compile.source}</jdkLevel>
> >          </configuration>
> >        </plugin>
> > +      <plugin>
> > +        <groupId>org.apache.felix</groupId>
> > +        <artifactId>maven-bundle-plugin</artifactId>
> > +        <configuration>
> > +          <instructions>
> > +            <Bundle-SymbolicName>org.apache.commons.${pom.artifactId}</Bundle-SymbolicName>
> > +          </instructions>
> > +        </configuration>
> > +      </plugin>
> >      </plugins>
> >    </build>
> >
> >
> > Index: /Users/cziegeler/Developer/workspaces/default/commons-proper/lang/pom.xml
> > ===================================================================
> > --- /Users/cziegeler/Developer/workspaces/default/commons-proper/lang/pom.xml   (revision 605909)
> > +++ /Users/cziegeler/Developer/workspaces/default/commons-proper/lang/pom.xml   (working copy)
> > @@ -22,13 +22,14 @@
> >    <parent>
> >      <groupId>org.apache.commons</groupId>
> >      <artifactId>commons-parent</artifactId>
> > -    <version>5</version>
> > +    <version>6-SNAPSHOT</version>
> >    </parent>
> >    <modelVersion>4.0.0</modelVersion>
> >    <groupId>commons-lang</groupId>
> >    <artifactId>commons-lang</artifactId>
> >    <version>2.4-SNAPSHOT</version>
> >    <name>Commons Lang</name>
> > +  <packaging>bundle</packaging>
> >
> >    <inceptionYear>2001</inceptionYear>
> >      <description>
> > @@ -401,6 +402,16 @@
> >            <tarLongFileMode>gnu</tarLongFileMode>
> >          </configuration>
> >        </plugin>
> > +      <plugin>
> > +        <groupId>org.apache.felix</groupId>
> > +        <artifactId>maven-bundle-plugin</artifactId>
> > +        <extensions>true</extensions>
> > +        <configuration>
> > +          <instructions>
> > +            <Export-Package>*;version=${pom.version}</Export-Package>
> > +          </instructions>
> > +        </configuration>
> > +      </plugin>
> >      </plugins>
> >    </build>
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > For additional commands, e-mail: dev-help@commons.apache.org
> >
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org

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


[jira] Updated: (FELIX-449) Add option to limit the classpath passed to BND to just the local project (ie. target/classes)

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

Stuart McCulloch updated FELIX-449:
-----------------------------------

    Attachment: FELIX_449_20080109.txt

Suggested patch - when applied to trunk, you can use:

      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <extensions>true</extensions>
        <configuration>
          <excludeDependencies>true</excludeDependencies>
          <instructions>
            <Export-Package>*;version=${pom.version}</Export-Package>
          </instructions>
        </configuration>
      </plugin>

to bundle the project classpath, excluding dependencies.

PS: feel free to suggest alternative names for this option!

> Add option to limit the classpath passed to BND to just the local project (ie. target/classes)
> ----------------------------------------------------------------------------------------------
>
>                 Key: FELIX-449
>                 URL: https://issues.apache.org/jira/browse/FELIX-449
>             Project: Felix
>          Issue Type: Improvement
>          Components: Maven Bundle Plugin
>    Affects Versions: 1.0.0
>            Reporter: Stuart McCulloch
>            Assignee: Stuart McCulloch
>         Attachments: FELIX_449_20080109.txt
>
>
> Email thread from Apache Commons:
> On Dec 28, 2007 12:35 PM, Carsten Ziegeler <cz...@apache.org> wrote:
> > Hi,
> >
> > in the meantime Stuart fixed the problem with the maven bundleplugin, so
> > I think we can give it a test drive :)
> >
> > Attached is a patch for the parent pom of commons and one to demonstrate
> > how to add support for OSGi to commons-lang.
> >
> > The changes to the parent pom are minimal: it just adds the maven
> > bundleplugin from the Apache Felix project. We currently need to use a
> > snapshot version, but a release is comming soon.
> > Besides adding the plugin, the patch also configures the bundle symbolic
> > name for all modules. The symbolic name is the unique identifier which
> > should follow java package naming. The best value is to use something
> > like "org.apache.commons.{artifactId}" where artifact id is commons-lang
> > or commons-collections etc.
> >
> > The patch to commons lang is also very simple. It changes the parent pom
> > to the current snapshot (which includes the changes from above) and sets
> > the packaging to bundle - this ensures that the bundleplugin runs and
> > creates the resulting jar file. So the bundleplugin replaces the maven
> > jar plugin. If you leave the packaging as "jar" the bundleplugin will
> > not run.
> > The last part of the patch adds the configuration to the bundleplugin.
> > The export "*" exports all packages definied in this module for other
> > bundles, so all classes are public. All packages are marked with the
> > current version which allows to run different versions in parallel.
> > The imports are not specified as they are calculated automatically by
> > the bundleplugin.
> >
> > And that's it :)
> >
> > The changes to the other projects should be similar.
> I tried using the bundle plugin (I checked out and built the latest
> from svn) with Commons Validator and it produced the following
> MANIFEST.MF:
>    http://people.apache.org/~niallp/commons-osgi/commons-validator-MANIFEST.MF
> It seems to have picked up some Manifest entries from BeanUtils  - for example:
> Extension-Name: org.apache.commons.beanutils
> Implementation-Version: 1.6
> Specification-Title: Jakarta Commons Beanutils
> Implementation-Title: org.apache.commons.beanutils
> Niall
> (N.B. The BeanUtils 1.7.0 jar has version incorectly specifying 1.6 in
> its manifest.
> > Carsten
> >
> >
> > --
> > Carsten Ziegeler
> > cziegeler@apache.org
> >
> > Index: /Users/cziegeler/Developer/workspaces/default/commons-proper/commons-parent/pom.xml
> > ===================================================================
> > --- /Users/cziegeler/Developer/workspaces/default/commons-proper/commons-parent/pom.xml (revision 605909)
> > +++ /Users/cziegeler/Developer/workspaces/default/commons-proper/commons-parent/pom.xml (working copy)
> > @@ -159,6 +159,12 @@
> >            <artifactId>maven-release-plugin</artifactId>
> >            <version>2.0-beta-7</version>
> >          </plugin>
> > +        <plugin>
> > +          <groupId>org.apache.felix</groupId>
> > +          <artifactId>maven-bundle-plugin</artifactId>
> > +          <version>1.1.0-SNAPSHOT</version>
> > +          <inherited>true</inherited>
> > +        </plugin>
> >        </plugins>
> >      </pluginManagement>
> >      <plugins>
> > @@ -194,6 +200,15 @@
> >            <jdkLevel>${maven.compile.source}</jdkLevel>
> >          </configuration>
> >        </plugin>
> > +      <plugin>
> > +        <groupId>org.apache.felix</groupId>
> > +        <artifactId>maven-bundle-plugin</artifactId>
> > +        <configuration>
> > +          <instructions>
> > +            <Bundle-SymbolicName>org.apache.commons.${pom.artifactId}</Bundle-SymbolicName>
> > +          </instructions>
> > +        </configuration>
> > +      </plugin>
> >      </plugins>
> >    </build>
> >
> >
> > Index: /Users/cziegeler/Developer/workspaces/default/commons-proper/lang/pom.xml
> > ===================================================================
> > --- /Users/cziegeler/Developer/workspaces/default/commons-proper/lang/pom.xml   (revision 605909)
> > +++ /Users/cziegeler/Developer/workspaces/default/commons-proper/lang/pom.xml   (working copy)
> > @@ -22,13 +22,14 @@
> >    <parent>
> >      <groupId>org.apache.commons</groupId>
> >      <artifactId>commons-parent</artifactId>
> > -    <version>5</version>
> > +    <version>6-SNAPSHOT</version>
> >    </parent>
> >    <modelVersion>4.0.0</modelVersion>
> >    <groupId>commons-lang</groupId>
> >    <artifactId>commons-lang</artifactId>
> >    <version>2.4-SNAPSHOT</version>
> >    <name>Commons Lang</name>
> > +  <packaging>bundle</packaging>
> >
> >    <inceptionYear>2001</inceptionYear>
> >      <description>
> > @@ -401,6 +402,16 @@
> >            <tarLongFileMode>gnu</tarLongFileMode>
> >          </configuration>
> >        </plugin>
> > +      <plugin>
> > +        <groupId>org.apache.felix</groupId>
> > +        <artifactId>maven-bundle-plugin</artifactId>
> > +        <extensions>true</extensions>
> > +        <configuration>
> > +          <instructions>
> > +            <Export-Package>*;version=${pom.version}</Export-Package>
> > +          </instructions>
> > +        </configuration>
> > +      </plugin>
> >      </plugins>
> >    </build>
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > For additional commands, e-mail: dev-help@commons.apache.org
> >
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org

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


[jira] Closed: (FELIX-449) Add option to limit the classpath passed to BND to just the local project (ie. target/classes)

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

Stuart McCulloch closed FELIX-449.
----------------------------------


> Add option to limit the classpath passed to BND to just the local project (ie. target/classes)
> ----------------------------------------------------------------------------------------------
>
>                 Key: FELIX-449
>                 URL: https://issues.apache.org/jira/browse/FELIX-449
>             Project: Felix
>          Issue Type: Improvement
>          Components: Maven Bundle Plugin
>    Affects Versions: 1.0.0
>            Reporter: Stuart McCulloch
>            Assignee: Stuart McCulloch
>         Attachments: FELIX_449_20080109.txt, validator-MANIFEST-bundle-excludeDependencies.MF, validator-MANIFEST-bundle.MF, validator-MANIFEST-normal.MF
>
>
> Email thread from Apache Commons:
> On Dec 28, 2007 12:35 PM, Carsten Ziegeler <cz...@apache.org> wrote:
> > Hi,
> >
> > in the meantime Stuart fixed the problem with the maven bundleplugin, so
> > I think we can give it a test drive :)
> >
> > Attached is a patch for the parent pom of commons and one to demonstrate
> > how to add support for OSGi to commons-lang.
> >
> > The changes to the parent pom are minimal: it just adds the maven
> > bundleplugin from the Apache Felix project. We currently need to use a
> > snapshot version, but a release is comming soon.
> > Besides adding the plugin, the patch also configures the bundle symbolic
> > name for all modules. The symbolic name is the unique identifier which
> > should follow java package naming. The best value is to use something
> > like "org.apache.commons.{artifactId}" where artifact id is commons-lang
> > or commons-collections etc.
> >
> > The patch to commons lang is also very simple. It changes the parent pom
> > to the current snapshot (which includes the changes from above) and sets
> > the packaging to bundle - this ensures that the bundleplugin runs and
> > creates the resulting jar file. So the bundleplugin replaces the maven
> > jar plugin. If you leave the packaging as "jar" the bundleplugin will
> > not run.
> > The last part of the patch adds the configuration to the bundleplugin.
> > The export "*" exports all packages definied in this module for other
> > bundles, so all classes are public. All packages are marked with the
> > current version which allows to run different versions in parallel.
> > The imports are not specified as they are calculated automatically by
> > the bundleplugin.
> >
> > And that's it :)
> >
> > The changes to the other projects should be similar.
> I tried using the bundle plugin (I checked out and built the latest
> from svn) with Commons Validator and it produced the following
> MANIFEST.MF:
>    http://people.apache.org/~niallp/commons-osgi/commons-validator-MANIFEST.MF
> It seems to have picked up some Manifest entries from BeanUtils  - for example:
> Extension-Name: org.apache.commons.beanutils
> Implementation-Version: 1.6
> Specification-Title: Jakarta Commons Beanutils
> Implementation-Title: org.apache.commons.beanutils
> Niall
> (N.B. The BeanUtils 1.7.0 jar has version incorectly specifying 1.6 in
> its manifest.
> > Carsten
> >
> >
> > --
> > Carsten Ziegeler
> > cziegeler@apache.org
> >
> > Index: /Users/cziegeler/Developer/workspaces/default/commons-proper/commons-parent/pom.xml
> > ===================================================================
> > --- /Users/cziegeler/Developer/workspaces/default/commons-proper/commons-parent/pom.xml (revision 605909)
> > +++ /Users/cziegeler/Developer/workspaces/default/commons-proper/commons-parent/pom.xml (working copy)
> > @@ -159,6 +159,12 @@
> >            <artifactId>maven-release-plugin</artifactId>
> >            <version>2.0-beta-7</version>
> >          </plugin>
> > +        <plugin>
> > +          <groupId>org.apache.felix</groupId>
> > +          <artifactId>maven-bundle-plugin</artifactId>
> > +          <version>1.1.0-SNAPSHOT</version>
> > +          <inherited>true</inherited>
> > +        </plugin>
> >        </plugins>
> >      </pluginManagement>
> >      <plugins>
> > @@ -194,6 +200,15 @@
> >            <jdkLevel>${maven.compile.source}</jdkLevel>
> >          </configuration>
> >        </plugin>
> > +      <plugin>
> > +        <groupId>org.apache.felix</groupId>
> > +        <artifactId>maven-bundle-plugin</artifactId>
> > +        <configuration>
> > +          <instructions>
> > +            <Bundle-SymbolicName>org.apache.commons.${pom.artifactId}</Bundle-SymbolicName>
> > +          </instructions>
> > +        </configuration>
> > +      </plugin>
> >      </plugins>
> >    </build>
> >
> >
> > Index: /Users/cziegeler/Developer/workspaces/default/commons-proper/lang/pom.xml
> > ===================================================================
> > --- /Users/cziegeler/Developer/workspaces/default/commons-proper/lang/pom.xml   (revision 605909)
> > +++ /Users/cziegeler/Developer/workspaces/default/commons-proper/lang/pom.xml   (working copy)
> > @@ -22,13 +22,14 @@
> >    <parent>
> >      <groupId>org.apache.commons</groupId>
> >      <artifactId>commons-parent</artifactId>
> > -    <version>5</version>
> > +    <version>6-SNAPSHOT</version>
> >    </parent>
> >    <modelVersion>4.0.0</modelVersion>
> >    <groupId>commons-lang</groupId>
> >    <artifactId>commons-lang</artifactId>
> >    <version>2.4-SNAPSHOT</version>
> >    <name>Commons Lang</name>
> > +  <packaging>bundle</packaging>
> >
> >    <inceptionYear>2001</inceptionYear>
> >      <description>
> > @@ -401,6 +402,16 @@
> >            <tarLongFileMode>gnu</tarLongFileMode>
> >          </configuration>
> >        </plugin>
> > +      <plugin>
> > +        <groupId>org.apache.felix</groupId>
> > +        <artifactId>maven-bundle-plugin</artifactId>
> > +        <extensions>true</extensions>
> > +        <configuration>
> > +          <instructions>
> > +            <Export-Package>*;version=${pom.version}</Export-Package>
> > +          </instructions>
> > +        </configuration>
> > +      </plugin>
> >      </plugins>
> >    </build>
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > For additional commands, e-mail: dev-help@commons.apache.org
> >
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org

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


[jira] Commented: (FELIX-449) Add option to limit the classpath passed to BND to just the local project (ie. target/classes)

Posted by "Niall Pemberton (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-449?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12557217#action_12557217 ] 

Niall Pemberton commented on FELIX-449:
---------------------------------------

+1 that sounds good to me. Any chance these (i.e. the customized) entries can come first? Not a big issue if not, but I'm sure it will make life easier in Commons if the devs see all the usual entries followed by the generated OSGi ones.

> Add option to limit the classpath passed to BND to just the local project (ie. target/classes)
> ----------------------------------------------------------------------------------------------
>
>                 Key: FELIX-449
>                 URL: https://issues.apache.org/jira/browse/FELIX-449
>             Project: Felix
>          Issue Type: Improvement
>          Components: Maven Bundle Plugin
>    Affects Versions: 1.0.0
>            Reporter: Stuart McCulloch
>            Assignee: Stuart McCulloch
>         Attachments: FELIX_449_20080109.txt, validator-MANIFEST-bundle-excludeDependencies.MF, validator-MANIFEST-bundle.MF, validator-MANIFEST-normal.MF
>
>
> Email thread from Apache Commons:
> On Dec 28, 2007 12:35 PM, Carsten Ziegeler <cz...@apache.org> wrote:
> > Hi,
> >
> > in the meantime Stuart fixed the problem with the maven bundleplugin, so
> > I think we can give it a test drive :)
> >
> > Attached is a patch for the parent pom of commons and one to demonstrate
> > how to add support for OSGi to commons-lang.
> >
> > The changes to the parent pom are minimal: it just adds the maven
> > bundleplugin from the Apache Felix project. We currently need to use a
> > snapshot version, but a release is comming soon.
> > Besides adding the plugin, the patch also configures the bundle symbolic
> > name for all modules. The symbolic name is the unique identifier which
> > should follow java package naming. The best value is to use something
> > like "org.apache.commons.{artifactId}" where artifact id is commons-lang
> > or commons-collections etc.
> >
> > The patch to commons lang is also very simple. It changes the parent pom
> > to the current snapshot (which includes the changes from above) and sets
> > the packaging to bundle - this ensures that the bundleplugin runs and
> > creates the resulting jar file. So the bundleplugin replaces the maven
> > jar plugin. If you leave the packaging as "jar" the bundleplugin will
> > not run.
> > The last part of the patch adds the configuration to the bundleplugin.
> > The export "*" exports all packages definied in this module for other
> > bundles, so all classes are public. All packages are marked with the
> > current version which allows to run different versions in parallel.
> > The imports are not specified as they are calculated automatically by
> > the bundleplugin.
> >
> > And that's it :)
> >
> > The changes to the other projects should be similar.
> I tried using the bundle plugin (I checked out and built the latest
> from svn) with Commons Validator and it produced the following
> MANIFEST.MF:
>    http://people.apache.org/~niallp/commons-osgi/commons-validator-MANIFEST.MF
> It seems to have picked up some Manifest entries from BeanUtils  - for example:
> Extension-Name: org.apache.commons.beanutils
> Implementation-Version: 1.6
> Specification-Title: Jakarta Commons Beanutils
> Implementation-Title: org.apache.commons.beanutils
> Niall
> (N.B. The BeanUtils 1.7.0 jar has version incorectly specifying 1.6 in
> its manifest.
> > Carsten
> >
> >
> > --
> > Carsten Ziegeler
> > cziegeler@apache.org
> >
> > Index: /Users/cziegeler/Developer/workspaces/default/commons-proper/commons-parent/pom.xml
> > ===================================================================
> > --- /Users/cziegeler/Developer/workspaces/default/commons-proper/commons-parent/pom.xml (revision 605909)
> > +++ /Users/cziegeler/Developer/workspaces/default/commons-proper/commons-parent/pom.xml (working copy)
> > @@ -159,6 +159,12 @@
> >            <artifactId>maven-release-plugin</artifactId>
> >            <version>2.0-beta-7</version>
> >          </plugin>
> > +        <plugin>
> > +          <groupId>org.apache.felix</groupId>
> > +          <artifactId>maven-bundle-plugin</artifactId>
> > +          <version>1.1.0-SNAPSHOT</version>
> > +          <inherited>true</inherited>
> > +        </plugin>
> >        </plugins>
> >      </pluginManagement>
> >      <plugins>
> > @@ -194,6 +200,15 @@
> >            <jdkLevel>${maven.compile.source}</jdkLevel>
> >          </configuration>
> >        </plugin>
> > +      <plugin>
> > +        <groupId>org.apache.felix</groupId>
> > +        <artifactId>maven-bundle-plugin</artifactId>
> > +        <configuration>
> > +          <instructions>
> > +            <Bundle-SymbolicName>org.apache.commons.${pom.artifactId}</Bundle-SymbolicName>
> > +          </instructions>
> > +        </configuration>
> > +      </plugin>
> >      </plugins>
> >    </build>
> >
> >
> > Index: /Users/cziegeler/Developer/workspaces/default/commons-proper/lang/pom.xml
> > ===================================================================
> > --- /Users/cziegeler/Developer/workspaces/default/commons-proper/lang/pom.xml   (revision 605909)
> > +++ /Users/cziegeler/Developer/workspaces/default/commons-proper/lang/pom.xml   (working copy)
> > @@ -22,13 +22,14 @@
> >    <parent>
> >      <groupId>org.apache.commons</groupId>
> >      <artifactId>commons-parent</artifactId>
> > -    <version>5</version>
> > +    <version>6-SNAPSHOT</version>
> >    </parent>
> >    <modelVersion>4.0.0</modelVersion>
> >    <groupId>commons-lang</groupId>
> >    <artifactId>commons-lang</artifactId>
> >    <version>2.4-SNAPSHOT</version>
> >    <name>Commons Lang</name>
> > +  <packaging>bundle</packaging>
> >
> >    <inceptionYear>2001</inceptionYear>
> >      <description>
> > @@ -401,6 +402,16 @@
> >            <tarLongFileMode>gnu</tarLongFileMode>
> >          </configuration>
> >        </plugin>
> > +      <plugin>
> > +        <groupId>org.apache.felix</groupId>
> > +        <artifactId>maven-bundle-plugin</artifactId>
> > +        <extensions>true</extensions>
> > +        <configuration>
> > +          <instructions>
> > +            <Export-Package>*;version=${pom.version}</Export-Package>
> > +          </instructions>
> > +        </configuration>
> > +      </plugin>
> >      </plugins>
> >    </build>
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > For additional commands, e-mail: dev-help@commons.apache.org
> >
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org

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


[jira] Resolved: (FELIX-449) Add option to limit the classpath passed to BND to just the local project (ie. target/classes)

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

Stuart McCulloch resolved FELIX-449.
------------------------------------

    Resolution: Fixed

Applied patch - will deploy new snapshot later on

> Add option to limit the classpath passed to BND to just the local project (ie. target/classes)
> ----------------------------------------------------------------------------------------------
>
>                 Key: FELIX-449
>                 URL: https://issues.apache.org/jira/browse/FELIX-449
>             Project: Felix
>          Issue Type: Improvement
>          Components: Maven Bundle Plugin
>    Affects Versions: 1.0.0
>            Reporter: Stuart McCulloch
>            Assignee: Stuart McCulloch
>         Attachments: FELIX_449_20080109.txt, validator-MANIFEST-bundle-excludeDependencies.MF, validator-MANIFEST-bundle.MF, validator-MANIFEST-normal.MF
>
>
> Email thread from Apache Commons:
> On Dec 28, 2007 12:35 PM, Carsten Ziegeler <cz...@apache.org> wrote:
> > Hi,
> >
> > in the meantime Stuart fixed the problem with the maven bundleplugin, so
> > I think we can give it a test drive :)
> >
> > Attached is a patch for the parent pom of commons and one to demonstrate
> > how to add support for OSGi to commons-lang.
> >
> > The changes to the parent pom are minimal: it just adds the maven
> > bundleplugin from the Apache Felix project. We currently need to use a
> > snapshot version, but a release is comming soon.
> > Besides adding the plugin, the patch also configures the bundle symbolic
> > name for all modules. The symbolic name is the unique identifier which
> > should follow java package naming. The best value is to use something
> > like "org.apache.commons.{artifactId}" where artifact id is commons-lang
> > or commons-collections etc.
> >
> > The patch to commons lang is also very simple. It changes the parent pom
> > to the current snapshot (which includes the changes from above) and sets
> > the packaging to bundle - this ensures that the bundleplugin runs and
> > creates the resulting jar file. So the bundleplugin replaces the maven
> > jar plugin. If you leave the packaging as "jar" the bundleplugin will
> > not run.
> > The last part of the patch adds the configuration to the bundleplugin.
> > The export "*" exports all packages definied in this module for other
> > bundles, so all classes are public. All packages are marked with the
> > current version which allows to run different versions in parallel.
> > The imports are not specified as they are calculated automatically by
> > the bundleplugin.
> >
> > And that's it :)
> >
> > The changes to the other projects should be similar.
> I tried using the bundle plugin (I checked out and built the latest
> from svn) with Commons Validator and it produced the following
> MANIFEST.MF:
>    http://people.apache.org/~niallp/commons-osgi/commons-validator-MANIFEST.MF
> It seems to have picked up some Manifest entries from BeanUtils  - for example:
> Extension-Name: org.apache.commons.beanutils
> Implementation-Version: 1.6
> Specification-Title: Jakarta Commons Beanutils
> Implementation-Title: org.apache.commons.beanutils
> Niall
> (N.B. The BeanUtils 1.7.0 jar has version incorectly specifying 1.6 in
> its manifest.
> > Carsten
> >
> >
> > --
> > Carsten Ziegeler
> > cziegeler@apache.org
> >
> > Index: /Users/cziegeler/Developer/workspaces/default/commons-proper/commons-parent/pom.xml
> > ===================================================================
> > --- /Users/cziegeler/Developer/workspaces/default/commons-proper/commons-parent/pom.xml (revision 605909)
> > +++ /Users/cziegeler/Developer/workspaces/default/commons-proper/commons-parent/pom.xml (working copy)
> > @@ -159,6 +159,12 @@
> >            <artifactId>maven-release-plugin</artifactId>
> >            <version>2.0-beta-7</version>
> >          </plugin>
> > +        <plugin>
> > +          <groupId>org.apache.felix</groupId>
> > +          <artifactId>maven-bundle-plugin</artifactId>
> > +          <version>1.1.0-SNAPSHOT</version>
> > +          <inherited>true</inherited>
> > +        </plugin>
> >        </plugins>
> >      </pluginManagement>
> >      <plugins>
> > @@ -194,6 +200,15 @@
> >            <jdkLevel>${maven.compile.source}</jdkLevel>
> >          </configuration>
> >        </plugin>
> > +      <plugin>
> > +        <groupId>org.apache.felix</groupId>
> > +        <artifactId>maven-bundle-plugin</artifactId>
> > +        <configuration>
> > +          <instructions>
> > +            <Bundle-SymbolicName>org.apache.commons.${pom.artifactId}</Bundle-SymbolicName>
> > +          </instructions>
> > +        </configuration>
> > +      </plugin>
> >      </plugins>
> >    </build>
> >
> >
> > Index: /Users/cziegeler/Developer/workspaces/default/commons-proper/lang/pom.xml
> > ===================================================================
> > --- /Users/cziegeler/Developer/workspaces/default/commons-proper/lang/pom.xml   (revision 605909)
> > +++ /Users/cziegeler/Developer/workspaces/default/commons-proper/lang/pom.xml   (working copy)
> > @@ -22,13 +22,14 @@
> >    <parent>
> >      <groupId>org.apache.commons</groupId>
> >      <artifactId>commons-parent</artifactId>
> > -    <version>5</version>
> > +    <version>6-SNAPSHOT</version>
> >    </parent>
> >    <modelVersion>4.0.0</modelVersion>
> >    <groupId>commons-lang</groupId>
> >    <artifactId>commons-lang</artifactId>
> >    <version>2.4-SNAPSHOT</version>
> >    <name>Commons Lang</name>
> > +  <packaging>bundle</packaging>
> >
> >    <inceptionYear>2001</inceptionYear>
> >      <description>
> > @@ -401,6 +402,16 @@
> >            <tarLongFileMode>gnu</tarLongFileMode>
> >          </configuration>
> >        </plugin>
> > +      <plugin>
> > +        <groupId>org.apache.felix</groupId>
> > +        <artifactId>maven-bundle-plugin</artifactId>
> > +        <extensions>true</extensions>
> > +        <configuration>
> > +          <instructions>
> > +            <Export-Package>*;version=${pom.version}</Export-Package>
> > +          </instructions>
> > +        </configuration>
> > +      </plugin>
> >      </plugins>
> >    </build>
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> > For additional commands, e-mail: dev-help@commons.apache.org
> >
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org

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