How do maven buildNumber metadata become inconsistent across multiple build agents?

We recently added a second build to our build environment and began to experience very unusual random build failures.

I have two separate Maven build machines: A and B , each of which starts Maven 2.2.1 and communicates with the Nexus 1.5.0 General Storage Manager. My problem is that build B will sometimes fail because it refuses to download the newer version of the general acme-1.0.0-SNAPSHOT dependency , previously created by A and uploaded to Nexus.

Inside the local repositories on both machines, I noticed some oddities in the repository metadata.

Machine A acme \ 1.0.0-SNAPSHOT \ maven-metadata-nexus.xml:

<metadata>
  <groupId>acme</groupId>
  <artifactId>acme</artifactId>
  <version>1.0.0-SNAPSHOT</version>
  <versioning>
    <snapshot>
      <buildNumber>1</buildNumber>
    </snapshot>
    <lastUpdated>20100525173546</lastUpdated>
  </versioning>
</metadata>

Machine B acme \ 1.0.0-SNAPSHOT \ maven-metadata-nexus.xml:

<metadata>
  <groupId>acme</groupId>
  <artifactId>acme</artifactId>
  <version>1.0.0-SNAPSHOT</version>
  <versioning>
    <snapshot>
      <buildNumber>2</buildNumber>
    </snapshot>
    <lastUpdated>20100519232317</lastUpdated>
  </versioning>
</metadata>

In Nexus acme / 1.0.0-SNAPSHOT / maven-metadata.xml:

<metadata>
  <groupId>acme</groupId>
  <artifactId>acme</artifactId>
  <version>1.0.0-SNAPSHOT</version>
  <versioning />
</metadata>

If I interpret the metadata files correctly (the documentation on the Internet is scarce), machine B appears that it has a newer version of acme dependencies (based on buildNumber), despite the fact that machine A built the last 6 days after machine B (based on timestamp). Nexus also does not seem to know the generally accepted buildNumber.

? , - ? - ?

:

  • settings.xml, updatePolicy "".
  • Nexus acme, A. B .
  • A B , Nexus.
  • .
  • , .
  • - Maven Nexus, .
  • CI (Atlassian Bamboo) , Nexus .
+3
2

, maven MNG-4142.

:

acme-1.0-SNAPSHOT ( 1) A Nexus. B, ​​ ​​ acme-1.0-SNAPSHOT ( 2) Nexus, 1.

, A, ​​ acme-1.0-SNAPSHOT, MNG-4142 . "", A 2 acme-1.0-SNAPSHOT, maven 1, . , -U.

, , , . cron, localCopy false, , , , , .

+2

, maven Nexus, acme, acme/1.0-SNAPSHOT. ( ).

, -U maven? , - maven, , - .

+2

Source: https://habr.com/ru/post/1747254/


All Articles