Reputation: 5063
I just have this weird problem using maven + artifactory. I have a project which I first build using maven-compiler 2.3.2, and maven2. It build successfully and I was able to deploy in artifatory 2.5.
Eventually I've added several modules and one requires the use of maven-compiler-plugin 2.4, which also requires me to install maven3, because I'm having several errors otherwise. So my app is working again.
But when I checkout on a new machine and maven compiles, I got the ff error:
Could not resolve dependencies for project com.xxxjar:0.0.1-SNAPSHOT: Failed to collect depend
encies for <list of jars>. Failure to find <snapshot> in <repo> was cached in the local repository, resolution will not be reattempted until the update interval of <repo> has elapsed or updates are forced.
What's weird is that when I carry over, my m2 directory from the first machine where I have first develop with maven2, it compiles without error. So clearly some setting or jar is being missed by maven3?
Also I tried setting my snapshot repository "maven snapshot version" setting to Unique as stated from other forums. I also tried almost all possible combinations that I can configure in artifactory repository setting.
My pom.xml distribution setting:
<distributionManagement>
<!-- <repository>
<id>release</id>
<name>xx</name>
<url>xx-repo-release</url>
</repository> -->
<snapshotRepository>
<id>snapshots</id>
<name>xx</name>
<url>xx-snapshots</url>
</snapshotRepository>
</distributionManagement>
Additional info: When I run install in another machine I have:
2012-05-25 17:21:32,316 [pool-1-thread-3] [WARN ] (o.a.e.DownloadServiceImpl:343) - Sending HTTP error code 409: The repository 'xx-repo-release' rejected the artifact 'xx-repo-release:com/xx/xx/0.0.1-SNAPSHOT/xx-0.0.1-SNAPSHOT.pom' due to its snapshot/release handling policy..
2012-05-25 17:21:32,342 [pool-1-thread-13] [WARN ] (o.a.e.DownloadServiceImpl:343) - Sending HTTP error code 409: The repository 'xx-repo-release' rejected the artifact 'xx-repo-release:com/xx/xx/0.0.1-SNAPSHOT/xx-0.0.1-SNAPSHOT.pom' due to its snapshot/release handling policy..
2012-05-25 17:21:32,350 [pool-1-thread-7] [WARN ] (o.a.e.DownloadServiceImpl:343) - Sending HTTP error code 409: The repository 'libs-release-local' rejected the artifact 'libs-release-local:com/xx/xx/0.0.1-SNAPSHOT/xx-0.0.1-SNAPSHOT.pom' due to its snapshot/release handling policy..
settings.xml are the same for both machine. And also same version of maven. Why is it pointing to release?
Thanks,
czetsuya
Upvotes: 1
Views: 931
Reputation: 1
I have pointed to an artifactory 3.1.1.1 instalation and have the above problem in a project who declare the dependency for log4j:log4j:1.2.17.
When a looked for that dependency on artifactory in GAVC search only appears the pom in the jcenter-cache repo.
The solution for me was running the following command:
mvn clean install -U
After that a looked again for log4j:log4j:1.2.17 with GAVC and now appears pom an jar. Of course in my laptop on $HOME/.m2/repository/log4j/log4j/1.2.17/log4j-1.2.17.jar was downloaded.
Thanks to mike.tihonchik.
Upvotes: 0
Reputation: 6933
I think another solution might be to run the following command: mvn clean install -U
Upvotes: 1
Reputation: 5063
The problem is dependency issue. I have a model module which is under a parent pom project. While I was able to deploy the model module in the remote repository, I forgot to deploy it's parent which causes the problem.
Solution: http://czetsuya-tech.blogspot.com/2012/05/could-not-resolve-dependencies-for.html
Upvotes: 0