Maven can't find dependencies [dependencyResolutionException] - maven

I added a Maven dependency to my project and my project compiles locally, while it doesn't compile on server. It can not resolve the newly added dependency.
This is my pom.xml file:
<repositories>
<repository>
<id>rep</id>
<name>Repository</name>
<url>http://artifacts.com/rep</url>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
</releases>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.project.rest</groupId>
<artifactId>common</artifactId>
<version>2.0.5</version>
</dependency>
</dependencies>
And this my console output with an error:
Downloading: http://artifacts.com/rep/com/project/rest/common/2.0.5/common-2.0.5.pom
[WARNING] The POM for com.project.rest:common:jar:2.0.5 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.154s
[INFO] Finished at: Tue Feb 03 06:58:35 BRT 2015
[INFO] Final Memory: 9M/152M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project server: Could not resolve dependencies for project org.server:
server:jar:2.5.1-SNAPSHOT: The following artifacts could not be resolved: com.project.rest:common:jar:2.0.5:
Could not find artifact com.project.rest:common:jar:2.0.5 in rep (http://artifacts.com/rep) -> [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/DependencyResolutionException
(I hid all real URLs and package.)
What could be the problem?

The first line "Downloading:..." only says that maven tries to download the artifact. It is no statement about success. If maven is successful you will get another line starting with "Downloaded: ..."
So in your case maven was not able to download the file. Check the logged url in your browser if it does exist and if it is protected.
BTW <updatePolicy>always</updatePolicy> is quite uncommon for release repos, because releases should not change any more.

Make sure your repository is configured properly. Try to search, in your repo, for
com.project.rest:common of version 2.0.5.
Is this your own project? some jar that you have built? are you sure you deployed it to your repo? if it is not in your repo, try to search for it in your local repo (usually .m2/repository/com/project...)

DependencyResolutionException
(source: Maven Confluence)
This error generally occurs when Maven could not download dependencies. Possible causes for this error are:
The POM misses the declaration of the <repository> which hosts the artifact.
The repository you have configured requires authentication and Maven failed to provide the correct credentials to the server. In this case, make sure your ${user.home}/.m2/settings.xml contains a <server> declaration whose <id> matches the <id> of the remote repository to use. See the Maven Settings Reference for more details.
The remote repository in question uses SSL and the JVM running Maven does not trust the certificate of the server.
There is a general network problem that prevents Maven from accessing any remote repository, e.g. a missing proxy configuration.
You have configured Maven to perform strict checksum validation and the files to download got corrupted.
Maven failed to save the files to your local repository, see LocalRepositoryNotAccessibleException for more details.
In Maven 3 if you just had a failed download and have fixed it (e.g. by uploading the jar to a repository) it will cache the failure. To force a refresh add -U to the command line.
In case of a general network-related problem, you could also consult the following articles:
Configuring a Proxy
Security and Deployment Settings
Guide to Remote Repository Access through Authenticated HTTPS

The project you mentioned doesn't contains POM i.e. it is not a MAVEN project. The .m2(look this at c drive or where you have installed) repository contains all the dependencies folders look there whether it contains the required project or not i.e. com.project.rest.

Like suggested by console output, you can check the Maven Wiki page (http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException) for more information on where the problem might lay.
Given the information you provided. I would guess we are looking at the point one issue:
The POM misses the declaration of the which hosts the artifact.
Maven repositories are of three types: local, central and remote.
In your case, your local repository contains the project specific artifacts, but the central repository doesn't.
Local repository is on your local machine. When you run a Maven build, Maven automatically downloads all the dependency jars into the local repository.
Central repository is web repository provided by a community and it contains a number of commonly used libraries, found here https://repo1.maven.org/maven2/.
Remote repository is developer's own custom repository containing required libraries or other project jars. Developer defines these repositories in POM file using tags.
I would suggest the following:
check your repository tag, if the repository is correct
check if the repository contains the artifacts specified in your dependency tag

If you are using IntelliJ IDE (Jetbrains) and code is correct then
Check the TOGGLE OFFLINE MODE button. If we enable offline mode, then IDE do not let maven download a dependency and it cannot found the library that causes error.
So make sure your project is build in ONLINE mode.

Related

How to deal with vanished Maven repository (caching)?

There used to be a repository that supplied us a certain version of a certain package - au.csiro.aehrc.variant-spark:variant-spark_2.12:jar:0.4.0-a0-dev1. Let's pretend the repository was at 12.3.4.567. In my settings.xml, I have an entry for it:
<repository>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>3rdParty</id>
<url>https://12.3.4.567:8081/repository/maven-group</url>
</repository>
When that repository was up and running, I was able to acquire the package and my mvn build succeeds. Other, newer developers can't build with the same configuration, because that repository no longer can supply them the jar file. If I comment out that repository in my settings.xml, my build fails:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 57.864 s
[INFO] Finished at: 2022-12-16T06:35:31-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project my-project:
Could not resolve dependencies for project gov.x.y:my-project:jar:1.1.0-SNAPSHOT:
Could not find artifact au.csiro.aehrc.variant-spark:variant-spark_2.12:jar:0.4.0-a0-dev1
in central (https://repo1.maven.org/maven2) -> [Help 1]
If I remove the comment characters in my settings.xml, it builds again.
I don't have a good feel for how Maven caching works. There appears to be some kind of caching of mvn artifacts on my local machine that gets found based on a repository key. I'm afraid that at some point the cache will be modified, and I will no longer be able to build.
How can I make my development world a safer place and also make au.csiro.aehrc.variant-spark:variant-spark_2.12:jar:0.4.0-a0-dev1 (and its dependencies) available to other developers? (BTW, I haven't been able to find that version of variant-spark on any public repositories.) Is there a way I can work backwards from my local Maven artifacts such that we could create a local repository to supply the artifacts?
I'm open to hearing about kludgy, simple safeguards as well as how to do things the right way.
You have now found out why it is so important to use artifacts published to Maven Central or somewhere similar that won't go away. Your build server should have found this a while back - you may want to consider setting one up for the next time something breaks.
Right now, I would suggest:
back up your computer (or at least the .m2 folder).
set up a local repository manager like Nexus or Artifactory and install these files in it in the same location so others can use it immediatlye.
create a virtual repository that invisibly merges this local repository with Maven Central
tell everybody to set up their settings.xml to use that as a mirror.
This should get everybody up and running again.
Then, strongly reconsider if depending on an artifact only present in your office is a good idea. Is it elsewhere under a different name? Can you utilize something else? Can you get the source so you can fork and maintain it yourself?

_remote.repositories prevents maven from resolving remote parent

I have my company parent pom in releases repository on a company Nexus instance.
I have mirror settings of <mirrorOf>external:*,!central</mirrorOf>, I don't want to proxy central since our Nexus is a bit slow.
When I have a maven project, with parent set like:
<parent>
<groupId>com.acme.maven</groupId>
<artifactId>parent-pom</artifactId>
<version>2</version>
<relativePath />
</parent>
and the parent-pom project is not available in local repository the build will fail -- this is as expected so far.
However if I download the parent-pom using dependency:get goal, the pom file gets downloaded to local repository. However when I try to build the project it fails with:
[exec] [ERROR] The project com.acme:test:0.0.1-SNAPSHOT (/home/acme/pom.xml) has 1 error
[exec] [ERROR] Non-resolvable parent POM: Failure to find com.acme.maven:parent-pom:pom:2 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced and 'parent.relativePath' points at no local POM # line 5, column 13 -> [Help 2]
Now if I remove the _remote.repositories file (and only that file) from .m2/repository/com/acme/maven/parent-pom/2/ the build will succeed.
I have some kind of a workaround, but manually removing internal files from maven repository doesn't sound like a good idea. How can avoid it?
Also I have no idea why is this happening, some explanation will be much appreciated.
Other approaches:
maven-ant tasks dependencies task works (_remote.repositories file doesn't appear at all)
trying to build with -U
using dependency:copy fails
using dependency:list on a pom.xml having the parent-pom as dependency also fails
_remote.repositories content:
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
#Mon Sep 14 19:59:41 CEST 2015
parent-pom-2.pom>internal-repo=
I think the answer is here:
Maven 3.0+ enforces that downloaded artifacts were resolved from a
repository url/id that matches an url available for the current
session.
..
IIRC there is a CLI option that you can enabled in Maven 3.1.1 that
tells Maven "I know what I am doing and don't make that check this
time" i.e.
--legacy-local-repository
Indeed adding --legacy-local-repository to the dependency:get invocation makes it not produce the _remote.repositories, and the parent-pom can be resolved.
Ant's dependencies task behaviour can, I think, be explained by it using Maven 2 code.

Errors in pom.xml with dependencies (Missing artifact...)

A friend has passed me a Maven project that I'm trying to run locally in my computer. All that I have done in Eclipse, I selected:
File -> Import -> Existing Maven Projects
After that, the project showed me 4 errors in my pom.xml (Missing artifact..):
I tried removing the content of .m2 folder and then in Eclipse I clicked on my project and chose "Run as" -> "Maven clean" and then "Run as" -> "Maven install". But I still have the same errors. I'm new with Spring so I dont know what else to do.
EDIT:
When I try to do: run as/ maven install, this is what my console says:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building DataLayer 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for javax.persistence:javax.persistence:jar:1.0.0 is missing, no dependency information available
[WARNING] The POM for hibernate-core:hibernate-core:jar:4.2.1.Final is missing, no dependency information available
[WARNING] The POM for hibernate-commons-annotations:hibernate-commons-annotations:jar:4.0.1.Final is missing, no dependency information available
[WARNING] The POM for jboss-logging:jboss-logging:jar:3.1.0.CR2 is missing, no dependency information available
[WARNING] The POM for jta:jta:jar:1.1 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.065s
[INFO] Finished at: Wed Aug 07 11:41:45 VET 2013
[INFO] Final Memory: 4M/90M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project DataLayer: Could not resolve dependencies for project SocialManager:DataLayer:jar:0.0.1-SNAPSHOT: The following artifacts could not be resolved: javax.persistence:javax.persistence:jar:1.0.0, hibernate-core:hibernate-core:jar:4.2.1.Final, hibernate-commons-annotations:hibernate-commons-annotations:jar:4.0.1.Final, jboss-logging:jboss-logging:jar:3.1.0.CR2, jta:jta:jar:1.1: Failure to find javax.persistence:javax.persistence:jar:1.0.0 in http://repository.jboss.org/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of JBoss repository has elapsed or updates are forced -> [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.
EDIT2: This is my complete pom.xml: https://dl.dropboxusercontent.com/u/31349296/pom.xml It looks pretty awful when I try to paste the code here.
It seemed that a lot of dependencies were incorrect.
Download the whole POM here
A good place to look for the correct dependencies is the Maven Repository website.
I know it is an old question. But I hope my answer will help somebody. I had the same issue and I think the problem is that it cannot find those .jar files in your local repository. So what I did is I added the following code to my pom.xml and it worked.
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/libs-milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
It means maven is not able to download artifacts from repository.
Following steps will help you:
Go to repository browser and check if artifact exist.
Check settings.xml to see if proper respository is specified.
Check proxy settings.
This is a very late answer,but this might help.I went to this link and searched for ojdbc8(I was trying to add jdbc oracle driver)
When clicked on the result , a note was displayed like this:
I clicked the link in the note and the correct dependency was mentioned like below
I was running into this trying to resolve a separate issue with a Maven/Java/Selenium/Cucumber project. For some reason, even though the Maven repo page for com.google.guava snippet had this in it, I resolved this by removing bundle from it.
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>31.1-jre</version>
<!--type>bundle</type-->
</dependency>
Exact error message:
Missing artifact com.google.guava:guava:bundle:31.1-jre
I also found this article helpful.
How to Debug Dependency Conflicts in Maven and Gradle
I somehow had this issue after I lost internet connection. I was able to fix it by updating the Maven indexes in Eclipse and then selecting my project and updating the Snapshots/releases.
SIMPLE..
First check with the closing tag of project. It should be placed after all the dependency tags are closed.This way I solved my error.
--Sush
happy coding :)
In my case, My STS was pointing to JRE. I have modified the build path to connect with JDK.
Once I connected to JDK, the pom.xml issue was resolved.

getting Tycho to resolve dependencies from old-style Eclipse update site

I'm trying to build a plugin that depends on org.apache.uima.runtime, which is part of the UIMA Eclipse plugins hosted on the UIMA Eclipse update site. This update site is an old-style (pre-p2) update site, so I know that Tycho won't resolve those dependencies. So I'm trying to make a local copy of the UIMA Eclipse update site, upgrade it to p2, and then get the dependencies from there. Here's what I tried:
$ svn co http://svn.apache.org/repos/asf/uima/uimaj/trunk/uimaj-eclipse-update-site/
...
Checked out revision 1395335.
$ java -jar /.../eclipse/plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar \
-application org.eclipse.equinox.p2.publisher.UpdateSitePublisher \
-metadataRepository file:/.../uimaj-eclipse-update-site \
-artifactRepository file:/.../uimaj-eclipse-update-site \
-source /.../uimaj-eclipse-update-site
Generating metadata for ..
Generation completed with success [0 seconds].
If I look at the uimaj-eclipse-update-site directory, I now see an artifacts.xml and a content.xml, so that seems right. I also checked it with the p2 repository browser, and nothing shows up as "PARTIAL", and I can see an org.apache.uima.runtime.feature.jar 2.4.0 and an org.apache.uima.runtime.feature.group 2.4.0.
I now add this local site to the pom.xml of my Eclipse plugin:
<repository>
<id>uima</id>
<layout>p2</layout>
<url>file:/.../uimaj-eclipse-update-site</url>
</repository>
When I run mvn compile in my updated project, Tycho finds the local update site, but still can't find org.apache.uima.runtime:
...
[INFO] Adding repository file:/.../uimaj-eclipse-update-site
[INFO] Adding repository file:/.../uimaj-eclipse-update-site
[INFO] Resolving dependencies of MavenProject: org.cleartk:org.cleartk.plugin.jcasgen.m2e:0.9.1.qualifier # /.../jcasgen-m2e-connector/org.cleartk.plugin.jcasgen.m2e/pom.xml
[INFO] Cannot complete the request. Generating details.
[INFO] Cannot complete the request. Generating details.
[INFO] {osgi.ws=cocoa, osgi.os=macosx, osgi.arch=x86_64, org.eclipse.update.install.features=true}
[ERROR] Cannot resolve project dependencies:
[ERROR] Software being installed: org.cleartk.plugin.jcasgen.m2e 0.9.1.qualifier
[ERROR] Missing requirement: org.cleartk.plugin.jcasgen.m2e 0.9.1.qualifier requires 'bundle org.apache.uima.runtime [2.4.0,3.0.0)' but it could not be found
[ERROR]
[ERROR] Internal error: java.lang.RuntimeException: "No solution found because the problem is unsatisfiable."
...
What am I doing wrong?
If you want to replicate the error, I'm running mvn compile from this directory (after modifying the pom.xml as above):
http://cleartk.googlecode.com/git/jcasgen-m2e-connector/
EDIT: I do see org.apache.uima.runtime in the generated artifacts.xml:
<artifact classifier='org.eclipse.update.feature' id='org.apache.uima.runtime' version='2.4.0'>
<properties size='4'>
<property name='artifact.size' value='9466'/>
<property name='download.size' value='9466'/>
<property name='download.md5' value='f9d4f1f8dc54f0a99379dcede2fc2700'/>
<property name='download.contentType' value='application/zip'/>
</properties>
</artifact>
Browsing the svn repo link, it looks like the plugins directory is empty and there are only features present. You may just need to run maven first to "build" it and populate the plug-ins directory.
If you have all of the content you could run the p2 features and bundles publisher application to generate a p2 repository directly. If it is to be consumed in a Tycho build the category side of the update site does not need to be generated.
I got late to the party but Apache UIMA now has a p2 repository.
In your pom.xml add the uima repository:
<repositories>
<repository>
<id>uima</id>
<url>http://www.apache.org/dist/uima/eclipse-update-site</url>
<layout>p2</layout>
</repository>
</repositories>

maven deploy:deploy-file fails (409 Conflict), yet artifact uploads successfully

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.
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.
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.
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 ?
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.
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.
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.
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).
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).
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.
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.
The world snapshot was written in lower case inside the pom.xml file. It must be written in upper case.
Ali

Resources