-
Bug
-
Resolution: Fixed
-
Major
-
None
-
Hudson 1.395
When using uniqueVersion == true with Maven deployments for artifacts that have attached artifacts (specifically hpi artifacts in this case...) I've observed the following behavior:
- MavenArtifactRecord.deploy for pom and main artifact (hpi) occurs as expected, assigning unique version in sequence (i.e. "-5")
- When MavenArtifactRecord.deploy reaches the iteration for .attachedArtifacts (line #128) and begins deploying these the unique version will be incremented (i.e. "-6")
- I've confirmed that when the artifact is "transformed" by the SnapshotTransformer, specifically line #104, that an incorrect "nextBuildNumber" is determined. This is due to #resolveLatestSnapshotBuildNumber (line 151) returning the "current" build number.
This seems to be a regression for 1.395 as the same setup worked fine in 1.383
- is duplicated by
-
JENKINS-8769 "Deploy to Maven repository" behaviour broken in >1.382
-
- Closed
-
@Olamy-
Thanks for looking into it. Very frustrating problem for me right now. I have confirmed that the same behavior is exhibited when I overload MavenArtifactRecord.deployArtifact to use the "default" Maven Deployer rather than the "maven2" implementation you added back in December.
The upside to switching to the built-in artifact deployer was that I can finally use the httpclient wagon provider for uploads, which was a really nice find while debugging the original issue of incrementing snapshot versions![](/images/icons/emoticons/smile.png)
As a bit more detail here's what I'm seeing uploaded into Nexus for a single build:
mygroup:myartifact:1.8-SNAPSHOT,2343434-1:pom
mygroup:myartifact:1.8-SNAPSHOT,2343434-1:hpi
mygroup:myartifact:1.8-SNAPSHOT,2343435-2:jar <- Where this is the "attached" artifact on the build.
I had thought earlier that the timestamps were identical but noticed later on that might have been a fluke and the timestamp will fluctuate a bit between the pom+main and attached artifacts. In the maven-metadata.xml I see 3 artifacts listed, each with different extension elements: pom, hpi and jar. Only the jar shows as build #2 and that's also listed as the "current build". So when I go to grab the latest snapshot of the hpi artifact- it's not found as there is no hpi artifact in build #2, just the jar.
Please let me know if I can provide additional detail. I'm even happy to submit a patch if you have a suggestion on where I should "fix" this!