Regression: Could not resolve dependencies for project
------------------------------------------------------
Key: MNG-5082
URL: http://jira.codehaus.org/browse/MNG-5082
Project: Maven 2 & 3
Issue Type: Bug
Affects Versions: 3.0.3
Reporter: Florian Brunner
Priority: Blocker
Sometimes, when you need a jar, which is not available from a repository, and
for some reason you don't want to deploy it to the corporate repository (yet),
you can do something like this:
<build>
<plugins>
...
<plugin>
<artifactId>maven-install-plugin</artifactId>
<executions>
<execution>
<id>some-lib</id>
<phase>validate</phase>
<goals>
<goal>install-file</goal>
</goals>
<configuration>
<file>lib/some-lib-1.1.jar</file>
<groupId>org.someorg.somelib</groupId>
<artifactId>some-lib</artifactId>
<version>1.1</version>
<packaging>jar</packaging>
</configuration>
</execution>
</executions>
</plugin>
...
</plugins>
</build>
And then you can declare a dependency on this lib like this:
<dependencies>
...
<dependency>
<groupId>org.someorg.somelib</groupId>
<artifactId>some-lib</artifactId>
<version>1.1</version>
</dependency>
...
</dependencies>
This worked fine with Maven 2.2.1 but not with Maven 3.0.3 -> regression!
Error message:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.951s
[INFO] Finished at: Thu Apr 28 15:53:15 BST 2011
[INFO] Final Memory: 4M/121M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project myproject: Could not resolve
dependencies for project someGroupId:someArtifactId:jar:0.1-SNAPSHOT: Could not
find artifact org.someorg.somelib:some-lib:jar:1.1 in nexus (<nexus url>) ->
[Help 1]
[ERROR]
There is a work-around, which at least works in some cases:
mvn clean validate
mvn install
Some notes on this work-around:
- install should call validate (which it does, but apparently with some
side-effects). It should not be necessary to call validate explicitly.
- "mvn clean validate install" does not work! It shouldn't matter if you call
"mvn clean validate install" or "mvn clean validate" and "mvn install". Both
should have the same result.
- I currently don't see a way to specify in Jenkins/ Hudson to first execute
"clean validate" and then "install" -> broken build on continuous integration
server which has to be fixed manually
- This work-around breaks the Maven way, because you cannot simply go to a
project anymore and just call "mvn clean install" to build it.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira