You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "David Jencks (JIRA)" <ji...@apache.org> on 2009/08/29 10:35:33 UTC

[jira] Created: (FELIX-1539) generated-classes not included in bundle

generated-classes not included in bundle
----------------------------------------

                 Key: FELIX-1539
                 URL: https://issues.apache.org/jira/browse/FELIX-1539
             Project: Felix
          Issue Type: Bug
          Components: Maven Bundle Plugin
    Affects Versions: maven-bundle-plugin-2.0.0
            Reporter: David Jencks


We have a project using the xmlbeans-maven-plugin to generate some sources.  When I change the packaging type to bundle the generated-sources are still compiled into target/generated-classes/xmlbeans but they are not included in the jar.

An example of such a project is at https://svn.apache.org/repos/asf/geronimo/server/trunk/framework/modules/geronimo-service-builder.  The maven-bundle-plugin is configured in an ancestor pom so all you should need to do is change the packaging to bundle and look at the jar.

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


[jira] Resolved: (FELIX-1539) generated-classes not included in bundle

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

Stuart McCulloch resolved FELIX-1539.
-------------------------------------

    Resolution: Fixed

Marking as fixed because classes from generated sources are now included, but we can't automatically capture random binary files

> generated-classes not included in bundle
> ----------------------------------------
>
>                 Key: FELIX-1539
>                 URL: https://issues.apache.org/jira/browse/FELIX-1539
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-2.0.0
>            Reporter: David Jencks
>            Assignee: Stuart McCulloch
>             Fix For: maven-bundle-plugin-2.0.1
>
>
> We have a project using the xmlbeans-maven-plugin to generate some sources.  When I change the packaging type to bundle the generated-sources are still compiled into target/generated-classes/xmlbeans but they are not included in the jar.
> An example of such a project is at https://svn.apache.org/repos/asf/geronimo/server/trunk/framework/modules/geronimo-service-builder.  The maven-bundle-plugin is configured in an ancestor pom so all you should need to do is change the packaging to bundle and look at the jar.

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


[jira] Commented: (FELIX-1539) generated-classes not included in bundle

Posted by "Guillaume Nodet (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1539?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12752022#action_12752022 ] 

Guillaume Nodet commented on FELIX-1539:
----------------------------------------

Well, you can use the maven bundle plugin to only generate the manifest metadata and tell the jar plugin to use this generated manifest.
That would solve your problem I guess.

> generated-classes not included in bundle
> ----------------------------------------
>
>                 Key: FELIX-1539
>                 URL: https://issues.apache.org/jira/browse/FELIX-1539
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-2.0.0
>            Reporter: David Jencks
>            Assignee: Stuart McCulloch
>             Fix For: maven-bundle-plugin-2.0.1
>
>
> We have a project using the xmlbeans-maven-plugin to generate some sources.  When I change the packaging type to bundle the generated-sources are still compiled into target/generated-classes/xmlbeans but they are not included in the jar.
> An example of such a project is at https://svn.apache.org/repos/asf/geronimo/server/trunk/framework/modules/geronimo-service-builder.  The maven-bundle-plugin is configured in an ancestor pom so all you should need to do is change the packaging to bundle and look at the jar.

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


[jira] Assigned: (FELIX-1539) generated-classes not included in bundle

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

Stuart McCulloch reassigned FELIX-1539:
---------------------------------------

    Assignee: Stuart McCulloch

> generated-classes not included in bundle
> ----------------------------------------
>
>                 Key: FELIX-1539
>                 URL: https://issues.apache.org/jira/browse/FELIX-1539
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-2.0.0
>            Reporter: David Jencks
>            Assignee: Stuart McCulloch
>             Fix For: maven-bundle-plugin-2.0.1
>
>
> We have a project using the xmlbeans-maven-plugin to generate some sources.  When I change the packaging type to bundle the generated-sources are still compiled into target/generated-classes/xmlbeans but they are not included in the jar.
> An example of such a project is at https://svn.apache.org/repos/asf/geronimo/server/trunk/framework/modules/geronimo-service-builder.  The maven-bundle-plugin is configured in an ancestor pom so all you should need to do is change the packaging to bundle and look at the jar.

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


[jira] Updated: (FELIX-1539) generated-classes not included in bundle

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

Stuart McCulloch updated FELIX-1539:
------------------------------------

    Fix Version/s: maven-bundle-plugin-2.0.1

This is similar to the generated source issue - we need to discover all the attached directories (for both source and classes) using the Maven project API, rather than rely on the standard single source and single build output directory defined in the POM model.

> generated-classes not included in bundle
> ----------------------------------------
>
>                 Key: FELIX-1539
>                 URL: https://issues.apache.org/jira/browse/FELIX-1539
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-2.0.0
>            Reporter: David Jencks
>             Fix For: maven-bundle-plugin-2.0.1
>
>
> We have a project using the xmlbeans-maven-plugin to generate some sources.  When I change the packaging type to bundle the generated-sources are still compiled into target/generated-classes/xmlbeans but they are not included in the jar.
> An example of such a project is at https://svn.apache.org/repos/asf/geronimo/server/trunk/framework/modules/geronimo-service-builder.  The maven-bundle-plugin is configured in an ancestor pom so all you should need to do is change the packaging to bundle and look at the jar.

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


[jira] Resolved: (FELIX-1539) generated-classes not included in bundle

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

Stuart McCulloch resolved FELIX-1539.
-------------------------------------

    Resolution: Fixed

Fixed in trunk.

> generated-classes not included in bundle
> ----------------------------------------
>
>                 Key: FELIX-1539
>                 URL: https://issues.apache.org/jira/browse/FELIX-1539
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-2.0.0
>            Reporter: David Jencks
>            Assignee: Stuart McCulloch
>             Fix For: maven-bundle-plugin-2.0.1
>
>
> We have a project using the xmlbeans-maven-plugin to generate some sources.  When I change the packaging type to bundle the generated-sources are still compiled into target/generated-classes/xmlbeans but they are not included in the jar.
> An example of such a project is at https://svn.apache.org/repos/asf/geronimo/server/trunk/framework/modules/geronimo-service-builder.  The maven-bundle-plugin is configured in an ancestor pom so all you should need to do is change the packaging to bundle and look at the jar.

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


[jira] Commented: (FELIX-1539) generated-classes not included in bundle

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

Stuart McCulloch commented on FELIX-1539:
-----------------------------------------

Sigh, I knew I should have retyped the explanation that disappeared when I had to log back in...

Anyway here goes - the Bnd tool used by the maven-bundle-plugin was specifically designed
so you could pull classes and resources into a bundle based on a selected set of packages.
It therefore does not simply zip up the contents of "target/classes" like the maven-jar-plugin.

However, we try to make it as easy as possible for people to migrate projects over to bundle
packaging. We turn resource settings into Include-Resource instructions, add dependencies
using Embed-Dependency (also updates the Bundle-ClassPath), and scan the local source
code to select a default set of packages.

All of which means it is now possible to take most Maven projects, flip the packaging from jar
to bundle, and have the same project but with OSGi metadata and added Bnd tool verification.

Unfortunately there will always be projects where this won't be be enough - for example for
xmlbean, we detect the generated source and generate the appropriate package defaults to
pull in the extra classes. But we miss the extra files under "schemaorg_apache_xmlbeans"
because there's no correlation between their location and any specified package.

In such situations you need to add instructions (in this case Include-Resource) to tell Bnd
about these additional files. There's no other way it can find out about them - they're just an
arbitrary path under "target/classes".

We've also had this discussion many times in the past on the Felix lists (ie. should we just
grab everything under "target/classes"?) and the consensus from the committers has been
that the bundleplugin should primarily behave like Bnd - ie. you could take your instructions
and use them with Bnd outside of Maven without too much trouble. In that regard we want
to keep using Bnd to generate the final bundle rather than just using jar.

But we also support people who do want to keep using the maven-jar-plugin - just use the
"bundle:manifest" goal to generate the manifest, and configure the jarplugin to pick it up...

We could maybe make this easier to use (ie. another packaging type or a switch) so you
wouldn't need to add the extra build executions - anyone out there willing to come up with
a patch or even a suggested process?

In summary I'll mark this issue as resolved, as it is working as designed - you just need
an Include-Resource instruction to pull in the extra "schemaorg_apache_xmlbeans" files


> generated-classes not included in bundle
> ----------------------------------------
>
>                 Key: FELIX-1539
>                 URL: https://issues.apache.org/jira/browse/FELIX-1539
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-2.0.0
>            Reporter: David Jencks
>            Assignee: Stuart McCulloch
>             Fix For: maven-bundle-plugin-2.0.1
>
>
> We have a project using the xmlbeans-maven-plugin to generate some sources.  When I change the packaging type to bundle the generated-sources are still compiled into target/generated-classes/xmlbeans but they are not included in the jar.
> An example of such a project is at https://svn.apache.org/repos/asf/geronimo/server/trunk/framework/modules/geronimo-service-builder.  The maven-bundle-plugin is configured in an ancestor pom so all you should need to do is change the packaging to bundle and look at the jar.

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


[jira] Reopened: (FELIX-1539) generated-classes not included in bundle

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

Stuart McCulloch reopened FELIX-1539:
-------------------------------------


re-opening to reflect final resolution

> generated-classes not included in bundle
> ----------------------------------------
>
>                 Key: FELIX-1539
>                 URL: https://issues.apache.org/jira/browse/FELIX-1539
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-2.0.0
>            Reporter: David Jencks
>            Assignee: Stuart McCulloch
>             Fix For: maven-bundle-plugin-2.0.1
>
>
> We have a project using the xmlbeans-maven-plugin to generate some sources.  When I change the packaging type to bundle the generated-sources are still compiled into target/generated-classes/xmlbeans but they are not included in the jar.
> An example of such a project is at https://svn.apache.org/repos/asf/geronimo/server/trunk/framework/modules/geronimo-service-builder.  The maven-bundle-plugin is configured in an ancestor pom so all you should need to do is change the packaging to bundle and look at the jar.

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


[jira] Resolved: (FELIX-1539) generated-classes not included in bundle

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

Stuart McCulloch resolved FELIX-1539.
-------------------------------------

    Resolution: Won't Fix

As mentioned above, this is the expected behaviour.

> generated-classes not included in bundle
> ----------------------------------------
>
>                 Key: FELIX-1539
>                 URL: https://issues.apache.org/jira/browse/FELIX-1539
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-2.0.0
>            Reporter: David Jencks
>            Assignee: Stuart McCulloch
>             Fix For: maven-bundle-plugin-2.0.1
>
>
> We have a project using the xmlbeans-maven-plugin to generate some sources.  When I change the packaging type to bundle the generated-sources are still compiled into target/generated-classes/xmlbeans but they are not included in the jar.
> An example of such a project is at https://svn.apache.org/repos/asf/geronimo/server/trunk/framework/modules/geronimo-service-builder.  The maven-bundle-plugin is configured in an ancestor pom so all you should need to do is change the packaging to bundle and look at the jar.

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


[jira] Reopened: (FELIX-1539) generated-classes not included in bundle

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

David Jencks reopened FELIX-1539:
---------------------------------


The java classes from the xmlbeans plugin are now included, but not the binary files that get generated into target/generated-classes/xmlbeans/

e.g.

target/generated-classes/xmlbeans/schemaorg_apache_xmlbeans/system/s465C16165F2451560A5F5A06D89553B9/dependencieselement.xsb 

<peanut-gallery>
Personally I think that trying to duplicate the functionality of such a major maven component as the jar plugin in a third party non-maven-aware project such as bnd is doomed to failure.  I've never understood why the bundle plugin doesn't just specify what needs to get into the jar and add stuff to the manifest.
</peanut-gallery>

> generated-classes not included in bundle
> ----------------------------------------
>
>                 Key: FELIX-1539
>                 URL: https://issues.apache.org/jira/browse/FELIX-1539
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-2.0.0
>            Reporter: David Jencks
>            Assignee: Stuart McCulloch
>             Fix For: maven-bundle-plugin-2.0.1
>
>
> We have a project using the xmlbeans-maven-plugin to generate some sources.  When I change the packaging type to bundle the generated-sources are still compiled into target/generated-classes/xmlbeans but they are not included in the jar.
> An example of such a project is at https://svn.apache.org/repos/asf/geronimo/server/trunk/framework/modules/geronimo-service-builder.  The maven-bundle-plugin is configured in an ancestor pom so all you should need to do is change the packaging to bundle and look at the jar.

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