Bonjour,
j'ai un probleme avec un plugin maven que je developpe. En fait quand je l'utilise dans un pom avec un projet existant il marche tres bien, mais si j'essaie de l'utiliser en ligne de commande j'obtiens l'erreur:
"Failed to resolve artifact"
j'execute mon plugin en tapant la ligne:
mvn install:install-file homega.tools:obrPlugin:repository -Dfile=org.apache.felix.ipojo-0.7.1-incubator-SNAPSHOT.jar -DartifactId=ipojo -DgroupId=org.apache.felix -Dversion=0.7.1-incubator-SNAPSHOT -Dpackaging=jar
Normalement le fichier que je passe en parametre (org.apache.felix.ipojo-0.7.1-incubator-SNAPSHOT.jar) doit etre installé avec le groupId, l'artifactId et la version que je donne et mon plugin doit s'executer ensuite.
Sauf que en ligne de commande Maven cherche des dependances de mon plugin completement abérentes, j'ai l'impression qu'il utilise le groupId et la version fournis dans la ligne pour determiner les dependances.
Voici mon pom.xml du plugin:
...
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.osgi.core</artifactId>
<version>0.9.0-incubator-SNAPSHOT</version>
</dependency>
...
et voila le resultat que j'obtiens quand je tente d'utiliser mon plugin en ligne de commande:
[INFO] ----------------------------------------------------------------------------
[INFO] Building Unnamed - tools:ipojo:jar:0.7.1
[INFO] task-segment: [homega.tools:obrPlugin:repository]
[INFO] ----------------------------------------------------------------------------
Downloading: http://repo1.maven.org/maven2/org/ap...core-0.7.7.pom
Downloading: http://repo1.maven.org/maven2/org/ap...core-0.7.7.pom
Downloading: http://repo1.maven.org/maven2/org/ap...he.felix.shell
-0.7.7.pom
Downloading: http://repo1.maven.org/maven2/org/ap...he.felix.shell
-0.7.7.pom
Downloading: http://repo1.maven.org/maven2/org/ap...he.felix.shell
-0.7.7.jar
Downloading: http://repo1.maven.org/maven2/org/ap...core-0.7.7.jar
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
Missing:
----------
1) org.apach.felix: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=org.apach.felix -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) org.apach.felix:org.apache.felix.shell:jar:0.7.7
2) org.apach.felix: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=org.apach.felix -DartifactId=org.osgi.core \
-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.shell:jar:0.9.0-incubator-SNAPSHOT
3) org.apach.felix:org.osgi.core:jar:0.7.7
----------
2 required artifacts are missing.
dernier point intéressant, si j'essaie d'installer un fichier dans le meme GroupId et avec le meme numero de version que les dependances, je n'obtient pas ces erreurs.
J'ai donc l'impression que maven recalcule les dependances à l'execution avec les parametres fournis ce qui me semble illogique.
voila si quelqu'un a deja eu ce probleme ou voit d'ou cela peut venir....
Merci par avance!
Partager