53

NOTE:

I now realize that the jar got placed into my repository, but the pom.xml did not. Now, I have another project where the pom.xml fails to get promoted, but the jar is placed in the repository.

However, another project, both the pom.xml and the jar do get placed in the repository.


I have a project in Jenkins where I use the promotion plugin to deploy my artifacts in Maven via the deploy:deploy-file goal.

This works for several other projects I have in Maven, but it fails for this project. The funny thing is that the file (but not the pom.xml) uploads anyway. I've verified this by removing the artifact from our Maven repository, then running the promotion. The artifact is in our repository after the promotion.

Here's the log I'm getting. Broke up the extra long lines the best I could:

[workspace] $ /bin/bash -xe /opt/tomcat/apache-tomcat-7.0.27/temp/hudson7357923598740079329.sh
+ FILE_LOC=/mnt/jenkins/builds/metricsdb-trunk/21/archive/target/archive
+ mvn deploy:deploy-file
    -Dversion=0.8.0
    -Dfile=/mnt/jenkins/builds/metricsdb-trunk/21/archive/target/archive/metricsdb-etl.jar
    -DpomFile=/mnt/jenkins/builds/metricsdb-trunk/21/archive/target/archive/pom.xml
    -Durl=http://repo.vegicorp.com/artifactory/ext-release-local -DrepositoryId=VegiCorp
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Command Line Spring Batch Module 0.8.0.CI-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-deploy-plugin:2.7:deploy-file (default-cli) @ metricsdb-etl ---
Uploading: http://repo.vegicorp.com/artifactory/ext-release-local/com/vegicorp/batch/metricsdb/metricsdb-etl/0.8.0/metricsdb-etl-0.8.0.jar
2/38 KB   
4/38 KB   
[...]

Uploaded: http://repo.vegicorp.com/artifactory/ext-release-local/com/vegicorp/batch/metricsdb/metricsdb-etl/0.8.0/metricsdb-etl-0.8.0.jar (38 KB at 202.2 KB/sec)
Uploading: http://repo.vegicorp.com/artifactory/ext-release-local/com/vegicorp/batch/metricsdb/metricsdb-etl/0.8.0/metricsdb-etl-0.8.0.pom
2/7 KB     
4/7 KB   
[...]

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.243s
[INFO] Finished at: Thu Oct 04 14:38:52 CDT 2012
[INFO] Final Memory: 4M/119M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file
    (default-cli) on project metricsdb-etl: Failed to deploy artifacts:
    Could not transfer artifact com.vegicorp.batch.metricsdb:metricsdb-etl:pom:0.8.0 from/to
    VegiCorp (http://repo.vegicorp.com/artifactory/ext-release-local):
    Failed to transfer file: http://repo.vegicorp.com/artifactory/ext-release-local/com/vegicorp/batch/metricsdb/metricsdb-etl/0.8.0/metricsdb-etl-0.8.0.pom.
    Return code is: 409, ReasonPhrase:Conflict. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
failed build hudson.tasks.Shell@24a6e7f9 SUCCESS
Finished: FAILURE

Output with the debug flag (-X) is in Pastebin.

3
  • I think it would be better to ask this question in Artifactory mail list (I assume you're using this repository manager). I assume it has something to do with it, not maven itself. Commented Oct 5, 2012 at 7:13
  • Have you tried with -X to see if the debug trace is useful? Note, a brief search suggests getting Jenkins to recognise this might be challenging. Commented Oct 5, 2012 at 7:14
  • @DuncanJones I did run it with the -X flag. I've put the output in Pastebin
    – David W.
    Commented Oct 5, 2012 at 14:19

11 Answers 11

50

I found the problem. Two problems actually:

  • I only had the release repository setup, and I was attempting to save a snapshot release in the release repository. Artifactory was setup to only allow releases in the release repository. This can be modified in the Artifactory setting, but I decided against this.

  • My pom.xml has a different version in it than I was trying to save it to. For example, the pom.xml said version 2.0 and I was trying to save the release as 2.0.2. Artifactory rejected the pom (but not the jar) for this reason.

I found the Artifactory setting (which is per repository) that asks whether or not to "Suppress POM consistency checks". Checking this box will allow me to set the version to one, but have the pom say another.

I also had to modify my Maven "settings.xml" file to allow for both a Release and Snapshot repository. I also have to modify my URL to the snapshot repository.

We were only using Ivy for a while (which doesn't have a snapshot concept), so we were just putting stuff in the release repository. This is a Maven project, and the developer marked the version in the POM as a SNAPSHOT.

Unfortunately, Maven documentation is pretty poor, and there still aren't any good books on Maven. Even worse is that the error messages are simply poor. What does "409, ReasonPhrase:Conflict. -> [Help 1]" mean?

Not that Ivy documentation is so much better, but Ant in Action has some excellent sections on using Ivy.

7
  • 5
    In case it helps someone in future. I received the 409 errors after creating a typo in a Group Id: trailing dot. Drove me nuts. So there are multiple possible causes. Commented Sep 26, 2014 at 5:56
  • 1
    I guess the bad documentation is part of the business model ;-) And yes. I totally can confirm that the documentation is very poor if you want to dive deeper into the project! Commented Sep 28, 2014 at 13:32
  • 1
    I had conflict with the groupId. your answer help me find this. thanks.
    – roterl
    Commented Nov 20, 2014 at 15:58
  • I had a problem with an artifactId containing a property like <artifactId>goose_${scala.version}</artifactId>. Most probably there is a validation that the upload path is consistent with the value in the uploaded pom.xml. Commented Oct 14, 2016 at 12:18
  • @MarkPhillips you are a champ! with your one liner, you solved me a lot of head/heart ache! cheers man!
    – Marci-man
    Commented Oct 14, 2019 at 12:48
37

Ensure that you include -SNAPSHOT as part of your version if you are publishing to the snapshot repository.

And remove -SNAPSHOT in case you are publishing it to a non-snapshot repository.

3
  • 1
    This should probably have been a comment, not an answer. With a bit more rep, you will be able to post comments. Until then, please do not use answers as a workaround. Commented Apr 22, 2015 at 2:15
  • 6
    Thanks for the advice. Happy to have my answer removed although, I think the information adds to the body of knowledge about such errors. I did try adding a comment but as you identified, I do not have sufficient rep. When looking to solve my own issue I searched for artifactory and 409 and this was the only stackoverflow answer. Is it better to keep information about 409s in one place or should I ask and answer my own question?
    – B5A7
    Commented Apr 22, 2015 at 4:41
  • If it's a different question in any significant way, post it (and go ahead and self-answer too), but make clear how it differs from this one in the question itself. SO is not hard up for question space, so all the questions that are at all separate should be asked separately, as long as they're clearly distinguished. Commented Apr 22, 2015 at 5:19
6

Yeah....Multiple Reason for same error. May be it will help somebody

1. Login as Admin to Artifactory
2. Configuration -> Repositories
3. Edit the Local Repository ---> Suppress POM Consistency Checks

This solves my problem.... Not sure. Right approach or not ?

1
  • 1
    check the version in the pom.xml file to make sure that the version is the one you want. If it is, I wouldn't worry about it.
    – David W.
    Commented Oct 30, 2014 at 12:00
4

I also face this problem, and I found the reason is the parent project didn't deploy in the snapshot repository. I run mvn deploy in the parent folder, and the problem resolved.

4

Had that error message too. For me the problem was that the setup of the server is to accept only release, not SNAPSHOT. After removing the SNAPSHOT from the pom, it worked fine.

1

In my case the POM file associated with the jar file (external, in same dir) had a dependency to itself. This was a offline zipped repo from a third party that I needed to load into artifactory.

I modified the POM files, removed the self-dependency and made sure the package info was right. Then artifacts deployed with no problems. Sent email to vendor so they can fix in their build.

1

I had this issue as well and it turned out that we had include/exclude rules set up on the repository I was trying to deploy to and my deployment didn't match those rules.

My solution was to point the deployment at a new repository that had **/* as the include rule (and the pattern from my other repository as an exclude rule to keep them separate).

0

I have been experiencing the same problem. (TL;DR: solution see last line)

During the deploy from jenkins to Artifactory, sometimes (magic!) a 409 - conflict error appeared with the following error message on the Artifactory log:

[WARN ] (o.a.e.UploadServiceImpl:239) - Sending HTTP error code 409: Checksum policy 'LocalRepoChecksumPolicy: CLIENT' rejected the artifact 'gradle-integration:com.redacted.java/fooProject/123/foo-123.jar'. Checksums info: ChecksumsInfo{checksums={SHA-1=ChecksumInfo{type=SHA-1, original='da39a3ee5e6b4b0d3255bfef95601890afd80709', actual='1459689f0be058f4ecef7e6fe3576f1550a8afda'}, MD5=ChecksumInfo{type=MD5, original='d41d8cd98f00b204e9800998ecf8427e', actual='14c7a498de028d6eb5882b3c698bc456'}}}.

As the trained eye might notice: The MD5# d41d8cd98f00b204e9800998ecf8427e is the checksum for an empty file or string.

Which means that the following must be happening: The copy job that prepares the Artifacts in the publish folder had not finished and therefore the file was empty when the checksum was calculated.

However when the deploy happened the file was there, Artifactory now receives a checksum which is incorrect and correctly refuses the file with the error code 409.

THE SOLUTION (is simple): Make 100% sure the files are definitely there before you start the deploy job (add a pause or proper logic).

0

There is a good possibility that the space on your remote repo is full. Verify that before going all technical and wasting time. Wasted 2-3 hrs thinking its a logical problem.

0

In my case the root cause for that very error was dependency version property that was not in the root pom.

The solution was moving the property to root pom where the version for the dependency was required.

So, missing version property of a dependency.

Very misleading error message indeed.

0

The world snapshot was written in lower case inside the pom.xml file. It must be written in upper case.

Ali

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.