3

I have a problem with downloading artifacts from our local nexus, sorry if this is a bit long.

Our sources tree is divided into several projects, let's call them A and B. B is dependent on a release version of A that is deployed to our local Nexus server. Whenever I release a new A the next several builds (In TeamCity) fail to download the new artifacts and I see the error:

Could not resolve dependencies for project B-groupId:B-artifactId:jar:B-version: 
Could not find artifact A-groupId:A-artifactId:jar:A-newVersion

Here are some relevant facts:

  1. We are building with the -T 1C maven option
  2. The artifact DOES exist in nexus - if I go the the download URL it works
  3. When I build it locally it works
  4. Eventually things work out, meaning it fails to download a certain artifact the first time, the next time it succeeds but fails on another and so on until all artifacts are downloaded
  5. Another project also released to the same local repository works fine when its version is updated
  6. I see these multiple downloading lines in the log:

    Downloading: http://nexus.company.com:8081/nexus/content/groups/public/com/company/group/artifact/1.0.10/artifact-1.0.10.pom
    

    this line repeats several time for each of the just released artifacts

  7. It doesn't seem to be an issue of the nexus index (Like I mentioned - building locally works fine, and also on some of the TeamCity agents it works)
  8. Also - doesn't seem to be a network problem because both the TeamCity agent and the nexus server are in the same datacenter

Sorry if this was a long read, but I would really appreciate any help. This thing is bugging us crazy.

Thanks

Gerold Broser
  • 14,080
  • 5
  • 48
  • 107
Guy Marom
  • 166
  • 1
  • 9
  • You wrote it works on some agents so this mean on some it does not? Can you post full error output...Which Maven Version do you use? Does the build work locally with `-T 1C` ? Have you started the build manually on the agent? – khmarbaise Sep 12 '15 at 16:51
  • Try it without `-T`. [Parallel builds in Maven 3](https://cwiki.apache.org/confluence/display/MAVEN/Parallel+builds+in+Maven+3): „_Experimental feature for 3.0! ... there **will** be undiscovered issues_“. We experienced strange things happening randomly with it from time to time. – Gerold Broser Sep 13 '15 at 18:37
  • @khmarbaise This is all the errors I see. We're using maven 3.0.5. It does work locally with -T 1C and I haven't tried starting it locally on the agent. I will – Guy Marom Sep 14 '15 at 20:53
  • @GeroldBroser If you have strange things you are using old plugins etc. Better using Maven 3.1.1 and up-to-date plugins. And 3.0 is long time ago...I'm working with `-T`option for a large build with 370 modules which works perfectly... – khmarbaise Sep 15 '15 at 13:51
  • @khmarbaise unfortunately upgrading to 3.1.1 did not help. And on further investigation this seems indeed like some bug in maven. I'm saying this because I noticed that for each line stating "Downloading ..." I also see a line stating "Downloaded ..." which means the download was successful and that Maven decided for some reason that it wasn't – Guy Marom Sep 21 '15 at 14:24
  • What modules has the problem? Which artifact causes the problem? Always the same artifact? Are using the most up-to-date plugins ? What gives you the impressions that it is a bug in Maven? Log files? – khmarbaise Sep 21 '15 at 15:55
  • It's not a specific module, it's a different one each time. Also not a specific artifact - I'm updating a single version property that is used by a group of our artifacts. So each build it's a different one that "fails" to be downloaded. I updated maven-dependency-plugin to the latest version, other than that is there anything else I can do? And like I said - it's the Maven logs that gave me the impression that it's a Maven bug. Even though Maven says the file was downloaded, it's still failing the build with an error saying the file was not downloaded. – Guy Marom Sep 23 '15 at 17:27
  • 1
    This seems related:https://issues.apache.org/jira/browse/MNG-5315 – Daniel Magnusson Jul 26 '16 at 11:11

0 Answers0