You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Clement Escoffier <cl...@apache.org> on 2007/06/21 17:10:10 UTC

Problem when solving dependencies in install-file phase

Hello,


We are implementing a Maven plugin to transform Maven repositories into 
OSGi Bundle Repository (OBR). This plugin provides several phase as :
- install
- install:install-file
- deploy
- deploy:deploy-file

Install & Deploy work fine, however we have issues on install-file and 
deploy-file.

So I execute it with :
mvn install:install-file 
org.apache.felix:maven-bundle-plugin:install-file -Dfile=o.a.f.xxx.jar 
-DartifactId=xxx -DgroupId=test -Dversion=0.7.7 -Dpackaging=jar

For a strange reason, when we execute this command, Maven try to solve 
plugin dependencies. But instead of resolving dependencies "normally" 
(as desbribe in the plugin pom file), it looks for artifacts inside the 
'test' groupId (and sometimes with a bad version number, 0.7.7 instead 
of the specified version).

 For example, my plugin pom file contains a dependency on org.osgi core :
...
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.osgi.core</artifactId>
<version>0.9.0-incubator-SNAPSHOT</version>
</dependency>
...

However,at runtime, Maven looks for org.osgi.core inside the 
org.apache.felix.tools groupId instead of org.apache.felix, and of the 
0.7.7  :


C:\projet\Stage>mvn install:install-file 
org.apache.felix.tools:maven-bundle-plugin:install-file 
-Dfile=org.apache.felix.ipojo-0.7.1
-incubator-SNAPSHOT.jar -DartifactId=ipojo -DgroupId=test 
-Dversion=0.7.7 -Dpackaging=jar
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'install'.
[INFO] 
----------------------------------------------------------------------------
[INFO] Building Unnamed - tools:ipojo:jar:0.7.1
[INFO]    task-segment: [install:install-file] (aggregator-style)
[INFO] 
----------------------------------------------------------------------------
[INFO] [install:install-file]
[INFO] Installing 
C:\projet\Stage\org.apache.felix.ipojo-0.7.1-incubator-SNAPSHOT.jar to 
C:\projet\Stage\mvn_r
epo\test\ipojo\0.7.7\ipojo-0.7.7.jar
[INFO] 
----------------------------------------------------------------------------
[INFO] Building Unnamed - tools:ipojo:jar:0.7.1
[INFO]    task-segment: [homega.tools:obrPlugin:repository ]
[INFO] 
----------------------------------------------------------------------------
Downloading: 
http://repo1.maven.org/maven2/test/org.osgi.core/0.7.7/org.osgi.core-0.7.7.pom 
<http://repo1.maven.org/maven2/test/org.osgi.core/0.7.7/org.osgi.core-0.7.7.pom>
Downloading: 
http://repo1.maven.org/maven2/test/org.osgi.core/0.7.7/org.osgi.core-0.7.7.pom
Downloading: 
http://repo1.maven.org/maven2/test/org.apache.felix.shell/0.7.7/org.apache.felix.shell-0.7.7.pom
Downloading: 
http://repo1.maven.org/maven2/test/org.apache.felix.shell/0.7.7/org.apache.felix.shell-0.7.7.pom
Downloading: 
http://repo1.maven.org/maven2/test/org.osgi.core/0.7.7/org.osgi.core-0.7.7.jar 
<http://repo1.maven.org/maven2/test/org.osgi.core/0.7.7/org.osgi.core-0.7.7.jar>
Downloading: 
http://repo1.maven.org/maven2/test/org.apache.felix.shell/0.7.7/org.apache.felix.shell-0.7.7.jar 
<http://repo1.maven.org/maven2/test/org.apache.felix.shell/0.7.7/org.apache.felix.shell-0.7.7.jar>
[INFO] 
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] 
------------------------------------------------------------------------
[INFO] Failed to resolve artifact.

Missing:
----------
1) test:org.osgi.core:jar:0.7.7
  Try downloading the file manually from the project website.
  Then, install it using the command:
      mvn install:install-file -DgroupId=test -DartifactId=org.osgi.core \
          -Dversion=0.7.7 -Dpackaging=jar -Dfile=/path/to/file
  Path to dependency:
        1) org.apache.felix:maven-bundle-plugin:maven-plugin:1.0.0
        2) 
org.apache.felix:org.apache.felix.shell:jar:0.9.0-incubator-SNAPSHOT
        3) test:org.osgi.core:jar:0.7.7

2) test:org.apache.felix.shell:jar:0.7.7
  Try downloading the file manually from the project website.
  Then, install it using the command:
      mvn install:install-file -DgroupId=test 
-DartifactId=org.apache.felix.shell \
          -Dversion=0.7.7 -Dpackaging=jar -Dfile=/path/to/file
  Path to dependency:
        1) homega.tools:obrPlugin:maven-plugin:1.0.0
        2) 
org.apache.felix:org.apache.felix.bundlerepository:jar:0.9.0-incubator-SNAPSHOT
        3) test:org.apache.felix.shell:jar:0.7.7
----------
2 required artifacts are missing. 

So, I don't understand why Maven resolves the dependencies as described. 
How can we fix this problem ?

Thank you for your response.

Regards,

Clement