Maven Unable To Download Dependencies !!EXCLUSIVE!!

0 views
Skip to first unread message

Isidora Herline

unread,
Jan 24, 2024, 10:33:46 PM1/24/24
to cilhicapca
Failed to execute goal on project accessing-data-mysql: Could not resolve dependencies for project com.example:accessing-data-mysql:jar:0.0.1-SNAPSHOT: Failed to collect dependencies at org.springframework.boot:spring-boot-configuration-processor:jar:2.4.7: Failed to read artifact descriptor for org.springframework.boot:spring-boot-configuration-processor:jar:2.4.7: Could not transfer artifact org.springframework.boot:spring-boot-configuration-processor:pom:2.4.7 from/to central ( ): Transfer failed for -boot-configuration-processor/2.4.7/spring-boot-configuration-processor-2.4.7.pom: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty -> [Help 1]
After a failed attempt, maven will leave a small file in your local .m2 repository that will prevent any attempt to re-download the file unless the update interval has elapsed or you force the updates using the maven -U switch described in other answers.
maven unable to download dependencies
I know it's quite late to answer this, but if some one like me reaches this point, then for JDK11 and maven 3.6.3 (recently mavaddat-javid verified using Maven 4.0.0-alpha-4 and JDK 19.0.2) you can use the following:
First try to access that very URL on you browser and check if it's operational. If you can access the website, the problem is not on your network. Problably you'll need to fix your Java trusted certificates list somehow in order to accept that server. Have a look at this question/answer: "PKIX path building failed" and "unable to find valid certification path to requested target"
Tried upgrading the build to use 2.2 and I still see the same results. Interestingly enough in fiddling with getting you a minimal example I have made a discovery. It looks like all internal dependencies that are defined in the block of the pom will correctly resolve, however anything that is defined in the block always looks in central.
Well because we are using the versionManagement from the spring boot plugin it uses the suggested versions from the properties file and iterates over every dependency and sets their version. I may be able to then iterate over the dependencies after the versions have been set and place them in the pom using the api you guys expose for modifying the generated pom. It would be simpler if I could just prevent the maven-publish plugin from generating the dependencies for me. But of course this is assuming I can hook in after the versions have been set by the spring-boot plugin.
I am currently going through a Spring and Maven tutorial, and I am unable to add the existing libraries in .m2 folder to my Eclipse project to be used further. When I add dependency of two Spring jar files in tab, two things should happen ideally but it does not happen:
It is not possible to build "POM-first" bundles (i.e. bundles built with maven-bundle-plugin) and "MANIFEST-fist" bundles (i.e. bundles built by Tycho) in the same reactor. This is a known limitation in Tycho.
The reason is that Tycho does its dependency resolution too early in the Maven lifecycle when the maven-bundle-plugin has not yet had a chance to generate the Manifest (needed by Tycho). Addressing this problem needs quite large changes, but I still hope to get this done in mid-term.
Just look at the first one, you do not have org.apache.axis2.transaction 0.0.0. in your maven repository. To be honest, i am not sure what is jar used for and how to get it, I was just missing some plugin dependency from other version of eclipse so i just need jar in /eclipse/pluginsSo what you do is create a p2 repository yourself. Here is another guy who right a link how to use script to create the p2 repository -a-p2-repository-from-features-and-plugins/
After that, verify the tag of maven-bundle-plugin [You can either include all the dependencies or you can configure to not include specific ones]. The scope attribute lets you configure which dependency jars you want to include based on their include scope. You should not include the dependencies which are only needed for compile and for the test.
I have multi module maven project.When I try to build site, e.g. execute maven site on parent project it fails to resolve dependency to one of modules.But if I just compile (mvn clean compile on parent project) it or run tests (mvn clean test on parent project) there are no dependency problems.
I am not sure why Maven tries to find myproj-common's jar in step 3, it seems to have nothing to do with mvn site. The exception happens quite early in maven core, before getting into maven-site-plugin. It looks not like a problem of maven-site-plugin but a common behavior of all maven lifecycles (except clean I believe).
I am setting up a project in eclipse . This projects builds successfully through command line(all mvn commands like mvn package, mvn compile, mvn clean install) work perfectly fine. While setting up this project on STS or Eclipse . I see some of the dependencies are not getting downloaded even though they are present in pom.xml. However, searching them in the maven repository and downloading the jar to my local computer and then adding them to build path makes it work on Eclipse.
However manually adding them to the build path created a new folder (Reference Library) and resolved the Eclipse Errors . Why did Eclipse not download and import these dependencies by themselves from the maven repository ?? Is it a bug in Eclipse or some problem from my side . Please help.
In this case I had to delete the whole folder of the problematic dependency in the local maven repository. Only then did Maven update work (Right-click on the project and select Project > Maven > Update Project.... )
I was facing similar sort of issue. I tried deleting folders inside .m2 and again building maven project.
I could download all dependency except one dependency which we have created by ourselves and published on Nexus.
Then I changed by java pointing from JRE to JDK which solved my problem
I hope this helps someone as it took me 2 days to realize. I re-imported the project multiple times and followed every possible step I've seen online and in the end I had added a small piece of xml code within the pom.xml. Even though it wasn't erroring or even showing a warning it was preventing maven from reading the lifecycle-mappings.
Click into your pom.xml and go to the dependencies tab on the bottom left, if you see an error there it's likely your pom.xml is corrupted in some way and maven will never attempt to download the dependencies even though you won't get any real error. I had looked back at a previous PR and noticed where/what I added and removed it and was able to get maven to work.
How are you telling maven the credentials for GitLab? GitLab will return a 404 (ie: Not Found) status if authorization fails, which can be really confusing. Is it possible that the versions that appear to work are actually coming from somewhere else, like your local machine?
I tried to use both maven deploy and nexus-staging-maven-plugin. The result is the same. I can see the artefacts in Nexus but cannot reference them with their version. One note is that when I try the following I got a response like
The Maven reactor is weird that way, it keeps modules around only for certain tasks. When running a build target that only does something for one subproject, then even if Maven builds dependencies first, it does not keep them around in the reactor (sometimes).
"Failed to read artifact descriptor" problems generally indicate a problem with the dependency's pom file in the maven repository. I would suggest you to double check if the pom file's name is the same with the name maven expects, and also to check if the pom file contents are valid.
[ERROR] Failed to execute goal on project billing: Could not resolve dependencies for project com.company.team.billing:billing:jar:3.5.1-SNAPSHOT: Failed to collect dependencies at com.company.team:billing-api:jar:3.5.1-SNAPSHOT: Failed to read artifact descriptor for com.company.team:billing-api:jar:3.5.1-SNAPSHOT: Failure to find
Conclusion.So my advice in case you encountered with the error in multi-module configuration whould be: thoroughly check groupId and artifactId of the dependencies on neighbour modules.
For me it was a problem where sub-dependencies weren't found. I finally found the real issue by looking at the "Error Log"-view that held a An internal error occurred during: "Building".-line. Double-clicking it showed a pop-up with a stacktrace and the last cause finally disclosed a broken JAR in my local repository. I cleaned that up and Eclipse/m2e was able to work again.
This error is basically saying that maven couldn't read a certain dependency from local repository. It might happend because a jar file didn't get downloaded correctly. So, go to your maven local repository and make sure there isn't any .lastUpdated extension file.
On all the banned dependencies, please add provided to indicate to maven that it does not need to package those dependencies as the parent application will provide them. The default value for is compile so right now Maven is trying to compile those dependencies into your plugin, which should not work and is now failing in newer versions of Bitbucket.
Did you create a post? I got the same problem. When I use provided, my plugin is disable or disappear. And when I use compile, I got this error message during build : [WARNING] Rule 0: org.apache.maven.plugins.enforcer.BannedDependencies failed with message: make sure platform artifacts are not bundled into plugin Found Banned Dependency: org.apache.httpcomponents:httpcore:jar:4.4.14 Found Banned Dependency: org.apache.httpcomponents:httpclient:jar:4.5.13 Use 'mvn dependency:tree' to locate the source of the banned dependencies.
I would appreciate to find your post Cheers
f5d0e4f075
Reply all
Reply to author
Forward
0 new messages