You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Thomas Diesler (JIRA)" <ji...@apache.org> on 2009/04/15 10:36:14 UTC

[jira] Created: (FELIX-1039) Inconsistency packaging vs. type

Inconsistency packaging vs. type
--------------------------------

                 Key: FELIX-1039
                 URL: https://issues.apache.org/jira/browse/FELIX-1039
             Project: Felix
          Issue Type: Bug
          Components: Maven Bundle Plugin
    Affects Versions: maven-bundle-plugin-2.0.0
         Environment: Maven-2.1.0
            Reporter: Thomas Diesler


The Maven Bundle Plugin uses 

  <packaging>bundle</packaging>

Scenario #1 - dependency uses type=bundle

    <dependency>
      <groupId>org.jboss.osgi</groupId>
      <artifactId>jboss-osgi-common</artifactId>
      <version>${version}</version>
      <type>bundle</type>
    </dependency>

with type=bundle the the dependency is resolved correctly from the the build reactor. 
'mvn package' succeeds. Note, the artefact is not yet in the local repository.

Scenario #2 - dependency uses unspecified type 

    <dependency>
      <groupId>org.jboss.osgi</groupId>
      <artifactId>jboss-osgi-common</artifactId>
      <version>${version}</version>
    </dependency>

'mvn package' fails if the artefact is not yet in the local repository
'mvn install' succeeds

Scenario #3 - the dependent bundle is not part of the reactor build

'mvn package' or 'mvn install' will always fail when the dependency is declared with type=bundle

Fazit:

If you declare the dependency with type=bundle, the dependency cannot be resolved from the repository.
If you don't declare a dependency type, the dependency can only be resolved from the repository. 'mvn package' will fail if the dependency is not in the repository.

Workaround:

Don't use type=bundle in the dependency and always install. i.e. 'mvn install'









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


[jira] Updated: (FELIX-1039) Inconsistency packaging vs. type

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

Stuart McCulloch updated FELIX-1039:
------------------------------------

    Fix Version/s:     (was: maven-bundle-plugin-2.0.1)
                   maven-bundle-plugin-2.1.0

Need more time to investigate potential ramifications, so bumping to after 2.0.1 maintenance release.

> Inconsistency packaging vs. type
> --------------------------------
>
>                 Key: FELIX-1039
>                 URL: https://issues.apache.org/jira/browse/FELIX-1039
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-2.0.0
>         Environment: Maven-2.1.0
>            Reporter: Thomas Diesler
>            Assignee: Stuart McCulloch
>             Fix For: maven-bundle-plugin-2.1.0
>
>
> The Maven Bundle Plugin uses 
>   <packaging>bundle</packaging>
> Scenario #1 - dependency uses type=bundle
>     <dependency>
>       <groupId>org.jboss.osgi</groupId>
>       <artifactId>jboss-osgi-common</artifactId>
>       <version>${version}</version>
>       <type>bundle</type>
>     </dependency>
> with type=bundle the the dependency is resolved correctly from the the build reactor. 
> 'mvn package' succeeds. Note, the artefact is not yet in the local repository.
> Scenario #2 - dependency uses unspecified type 
>     <dependency>
>       <groupId>org.jboss.osgi</groupId>
>       <artifactId>jboss-osgi-common</artifactId>
>       <version>${version}</version>
>     </dependency>
> 'mvn package' fails if the artefact is not yet in the local repository
> 'mvn install' succeeds
> Scenario #3 - the dependent bundle is not part of the reactor build
> 'mvn package' or 'mvn install' will always fail when the dependency is declared with type=bundle
> Fazit:
> If you declare the dependency with type=bundle, the dependency cannot be resolved from the repository.
> If you don't declare a dependency type, the dependency can only be resolved from the repository. 'mvn package' will fail if the dependency is not in the repository.
> Workaround:
> Don't use type=bundle in the dependency and always install. i.e. 'mvn install'

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


[jira] Commented: (FELIX-1039) Inconsistency packaging vs. type

Posted by "Thomas Diesler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/FELIX-1039?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12699116#action_12699116 ] 

Thomas Diesler commented on FELIX-1039:
---------------------------------------

Not sure if this is actually a general mvn issue

> Inconsistency packaging vs. type
> --------------------------------
>
>                 Key: FELIX-1039
>                 URL: https://issues.apache.org/jira/browse/FELIX-1039
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-2.0.0
>         Environment: Maven-2.1.0
>            Reporter: Thomas Diesler
>
> The Maven Bundle Plugin uses 
>   <packaging>bundle</packaging>
> Scenario #1 - dependency uses type=bundle
>     <dependency>
>       <groupId>org.jboss.osgi</groupId>
>       <artifactId>jboss-osgi-common</artifactId>
>       <version>${version}</version>
>       <type>bundle</type>
>     </dependency>
> with type=bundle the the dependency is resolved correctly from the the build reactor. 
> 'mvn package' succeeds. Note, the artefact is not yet in the local repository.
> Scenario #2 - dependency uses unspecified type 
>     <dependency>
>       <groupId>org.jboss.osgi</groupId>
>       <artifactId>jboss-osgi-common</artifactId>
>       <version>${version}</version>
>     </dependency>
> 'mvn package' fails if the artefact is not yet in the local repository
> 'mvn install' succeeds
> Scenario #3 - the dependent bundle is not part of the reactor build
> 'mvn package' or 'mvn install' will always fail when the dependency is declared with type=bundle
> Fazit:
> If you declare the dependency with type=bundle, the dependency cannot be resolved from the repository.
> If you don't declare a dependency type, the dependency can only be resolved from the repository. 'mvn package' will fail if the dependency is not in the repository.
> Workaround:
> Don't use type=bundle in the dependency and always install. i.e. 'mvn install'

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


[jira] Commented: (FELIX-1039) Inconsistency packaging vs. type

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

Stuart McCulloch commented on FELIX-1039:
-----------------------------------------

I really think this needs to be raised with the Maven team, because the maven-bundle-plugin doesn't directly participate in the Maven resolution process. Instead Maven reads the components.xml document from the maven-bundle-plugin to identify the packaging type, update the lifecycle, etc. - that's really the only input we have on dependency resolution in the reactor.

The components.xml document in the maven-bundle-plugin was written based on the published Maven documentation and AFAIK there is nothing wrong with it. So technically there is nothing we can really do from here, the resolution you mention in your issue happens before any of our code gets run.

If there is a problem with our components.xml I'd be happy to change it, but again I can't see any such issue based on the docs. BTW, have you enabled the bundle lifecycle in your plugin descriptor?

      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <version>2.0.0</version>
        <extensions>true</extensions>    <!-- this tells Maven to read our components.xml -->
      </plugin>

because without <extensions>true</extensions> you will have problems.

Also there have been several related issues regarding custom (ie. non-core) packaging types:

   http://jira.codehaus.org/browse/MNG-2140
   http://jira.codehaus.org/browse/MNG-2426
   (and several more, but they should be fixed)

furthermore I tend to use "mvn install" rather than rely on "mvn package" in the reactor, because of:

   http://jira.codehaus.org/browse/MNG-2720

but it looks like this was fixed in 2.1.0

> Inconsistency packaging vs. type
> --------------------------------
>
>                 Key: FELIX-1039
>                 URL: https://issues.apache.org/jira/browse/FELIX-1039
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-2.0.0
>         Environment: Maven-2.1.0
>            Reporter: Thomas Diesler
>
> The Maven Bundle Plugin uses 
>   <packaging>bundle</packaging>
> Scenario #1 - dependency uses type=bundle
>     <dependency>
>       <groupId>org.jboss.osgi</groupId>
>       <artifactId>jboss-osgi-common</artifactId>
>       <version>${version}</version>
>       <type>bundle</type>
>     </dependency>
> with type=bundle the the dependency is resolved correctly from the the build reactor. 
> 'mvn package' succeeds. Note, the artefact is not yet in the local repository.
> Scenario #2 - dependency uses unspecified type 
>     <dependency>
>       <groupId>org.jboss.osgi</groupId>
>       <artifactId>jboss-osgi-common</artifactId>
>       <version>${version}</version>
>     </dependency>
> 'mvn package' fails if the artefact is not yet in the local repository
> 'mvn install' succeeds
> Scenario #3 - the dependent bundle is not part of the reactor build
> 'mvn package' or 'mvn install' will always fail when the dependency is declared with type=bundle
> Fazit:
> If you declare the dependency with type=bundle, the dependency cannot be resolved from the repository.
> If you don't declare a dependency type, the dependency can only be resolved from the repository. 'mvn package' will fail if the dependency is not in the repository.
> Workaround:
> Don't use type=bundle in the dependency and always install. i.e. 'mvn install'

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


[jira] Updated: (FELIX-1039) Inconsistency packaging vs. type

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

Stuart McCulloch updated FELIX-1039:
------------------------------------

    Assignee:     (was: Stuart McCulloch)

> Inconsistency packaging vs. type
> --------------------------------
>
>                 Key: FELIX-1039
>                 URL: https://issues.apache.org/jira/browse/FELIX-1039
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-2.0.0
>         Environment: Maven-2.1.0
>            Reporter: Thomas Diesler
>             Fix For: maven-bundle-plugin-2.1.0
>
>
> The Maven Bundle Plugin uses 
>   <packaging>bundle</packaging>
> Scenario #1 - dependency uses type=bundle
>     <dependency>
>       <groupId>org.jboss.osgi</groupId>
>       <artifactId>jboss-osgi-common</artifactId>
>       <version>${version}</version>
>       <type>bundle</type>
>     </dependency>
> with type=bundle the the dependency is resolved correctly from the the build reactor. 
> 'mvn package' succeeds. Note, the artefact is not yet in the local repository.
> Scenario #2 - dependency uses unspecified type 
>     <dependency>
>       <groupId>org.jboss.osgi</groupId>
>       <artifactId>jboss-osgi-common</artifactId>
>       <version>${version}</version>
>     </dependency>
> 'mvn package' fails if the artefact is not yet in the local repository
> 'mvn install' succeeds
> Scenario #3 - the dependent bundle is not part of the reactor build
> 'mvn package' or 'mvn install' will always fail when the dependency is declared with type=bundle
> Fazit:
> If you declare the dependency with type=bundle, the dependency cannot be resolved from the repository.
> If you don't declare a dependency type, the dependency can only be resolved from the repository. 'mvn package' will fail if the dependency is not in the repository.
> Workaround:
> Don't use type=bundle in the dependency and always install. i.e. 'mvn install'

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


[jira] Updated: (FELIX-1039) Inconsistency packaging vs. type

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

Stuart McCulloch updated FELIX-1039:
------------------------------------

    Fix Version/s: maven-bundle-plugin-2.0.1
         Assignee: Stuart McCulloch

Look into tweaking the generated artifact type to see if this makes any difference - we have to be careful not to break existing builds though.
If there's no safe/compatible fix then I'll close this as WONTFIX because the safest workaround is to use "mvn install" or "mvn clean install".

> Inconsistency packaging vs. type
> --------------------------------
>
>                 Key: FELIX-1039
>                 URL: https://issues.apache.org/jira/browse/FELIX-1039
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-2.0.0
>         Environment: Maven-2.1.0
>            Reporter: Thomas Diesler
>            Assignee: Stuart McCulloch
>             Fix For: maven-bundle-plugin-2.0.1
>
>
> The Maven Bundle Plugin uses 
>   <packaging>bundle</packaging>
> Scenario #1 - dependency uses type=bundle
>     <dependency>
>       <groupId>org.jboss.osgi</groupId>
>       <artifactId>jboss-osgi-common</artifactId>
>       <version>${version}</version>
>       <type>bundle</type>
>     </dependency>
> with type=bundle the the dependency is resolved correctly from the the build reactor. 
> 'mvn package' succeeds. Note, the artefact is not yet in the local repository.
> Scenario #2 - dependency uses unspecified type 
>     <dependency>
>       <groupId>org.jboss.osgi</groupId>
>       <artifactId>jboss-osgi-common</artifactId>
>       <version>${version}</version>
>     </dependency>
> 'mvn package' fails if the artefact is not yet in the local repository
> 'mvn install' succeeds
> Scenario #3 - the dependent bundle is not part of the reactor build
> 'mvn package' or 'mvn install' will always fail when the dependency is declared with type=bundle
> Fazit:
> If you declare the dependency with type=bundle, the dependency cannot be resolved from the repository.
> If you don't declare a dependency type, the dependency can only be resolved from the repository. 'mvn package' will fail if the dependency is not in the repository.
> Workaround:
> Don't use type=bundle in the dependency and always install. i.e. 'mvn install'

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