IntelliJ gets errors when trying to download artifacts from NEXUS repo (sometimes)
已回答
Any ideas on why the following error happens?
If I see a red underline for an JAR that didn't download, I search in my maven repo to see if the file exists and I find that an error occurred when trying to download the file. This doesn't happen all the time but when it does, it looks as follows.
This is an internal file that maven is using (mvn --version is Apache Maven 3.8.1):
cat $HOME/.m2/repository/org/codehaus/woodstox/stax2-api/3.1.4/stax2-api-3.1.4.jar.lastUpdated
#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
#Tue Jun 29 03:08:31 UTC 2021
@default-ACME\ Nexus-https\://nexus.example.com/repository/maven-public/.lastUpdated=1624936111874
https\://nexus.example.com/repository/maven-public/.error=Could not transfer artifact org.codehaus.woodstox\:stax2-api\:jar\:3.1.4 from/to ACME Nexus (https\://nexus.example.com/repository/maven-public)\: Transfer failed for https\://nexus.example.com/repository/maven-public/org/codehaus/woodstox/stax2-api/3.1.4/stax2-api-3.1.4.jar
Notice the backslash in the URL.
My maven settings file has:
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository/>
<interactiveMode/>
<usePluginRegistry/>
<offline/>
<pluginGroups/>
<mirrors>
<mirror>
<id>ACME Nexus</id>
<name>ACME Nexus</name>
<url>https://nexus.example.com/repository/maven-public</url>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>
<proxies/>
<profiles/>
<activeProfiles/>
</settings>
请先登录再写评论。
What is the error in IntelliJ IDEA?
Does "File | Invalidate caches and Restart" help to resolve that?
Do you see anything in idea.log while the issue is being reproduced?
I spent several hours troubleshooting this yesterday and now that I have it working I don't want to regress and waste time on it. It may be a few days or more before I respond but if/when I have more info I will respond.
I recall running "File | Invalidate caches and Restart" and it not changing anything, but I can't say for certain, as I shut IntelliJ down several times and deleted my .m2/repository and tried several experiments.
Typically, howerver, I compile from the command line (mvn clean install) and then use IntelliJ to download "the rest". IntelliJ tries to download some plugins that were not downloaded from the mvn clean install command and those attempts would fail with the error message in my initial post.
In one experiment (which has me working right now), I deleted my $HOME/.m2/repository and ran Build Project from inside IntelliJ. This required IntelliJ to download all of the artifacts needed and there were no errors.
Thanks for the response, and I'll respond when I have more info.
So the problem re-occurred today, so I'm going to try the suggestion.
> Does "File | Invalidate caches and Restart" help to resolve that?
Nope that didn't work for me.
I looked t the log file and it just confirms that there was an issue downloading the NEXUS/maven artifacts.
From what I see (in the log file) this is not an IntelliJ problem, so I don't know that there is anything IntelliJ can do.
I say this because the log files say things like this:
Below is a snippet of one of the failures on some publicly available artifacts.
When I look at the .m2/repository of what was downloaded this shows up
So the bottom line is that, I think you can consider this issue "closed" because it's not an IntelliJ problem.
Or if it is, then I don't understand why some days it can download successfully and other days it gets the above error.
The errors happen apparently randomly on different artifacts.
It's been a difficult problem to troubleshoot.
To date, the work around has been to delete my .m2/repository directory and redownload everything until everything is successfully downloaded (quite frustrating).
Actually maybe this is an IntelliJ problem, when I run maven clean install artifacts are downloaded without a problem. I'm using:
What IDE version do you use?
Could you please try the version from https://www.jetbrains.com/idea/nextversion/ It has several related improvements.
Also, is it possible to have a sample project and steps to reproduce this problem and IDE logs zipped? For uploading you can use https://uploads.jetbrains.com or any file sharing service.
Thank you very much in advance.
Andrey Dernov
> What IDE version do you use?
I'm currently using
IntelliJ IDEA 2021.1.1 (Ultimate Edition)
Build #IU-211.7142.45, built on April 30, 2021
Runtime version: 11.0.10+9-b1341.41 amd64
VM: Dynamic Code Evolution 64-Bit Server VM by JetBrains s.r.o.
Linux 4.14.231-173.360.amzn2.x86_64
GC: ParNew, ConcurrentMarkSweep
Memory: 3062M
Cores: 4
Registry: directory.access.checker.enabled=false, ide.balloon.shadow.size=0
Non-Bundled Plugins: com.ifengxue.plugin.jpa-support (2.0.7-RC3), org.jetbrains.kotlin (211-1.5.10-release-891-IJ7142.45)
Kotlin: 211-1.5.10-release-891-IJ7142.45
> Could you please try the version from https://www.jetbrains.com/idea/nextversion/ It has several related improvements.
Yes, I'll try it. I was able to download it.
> it possible to have a sample project and steps to reproduce this problem and IDE logs zipped?
The project is quite large and I'm not sure what subset of it will reproduce the problem, but I will try and use a brand new (IntelliJ created) Spring-Boot project to see the problem occurs with that. If that happens, I will be able to upload the project and logs.
I'm not sure when I'll have time to do this. I end up loosing a day each time this happens but eventually everything downloads and I can continue with my work. I got things to that point this morning so I need to make progress on my current tasking before I investigate this. But if/when this happens again, I'll create the test project first and send it to you.
So after updating the latest version of IntelliJ
I'm seeing the same problem as described above.
One thing I noticed is that the error that was in the log file now appears on the Sync Build output that says
So I created a SpringBoot project using New | Spring Initializr. I selected:
I removed my $HOME/.m2/repository directory and ran File | Invalidate Caches (and restart).
So with nothing downloaded from NEXUS/Maven, I tried to build from within IntelliJ and got the same error as described above.
So the problem is not as intermittent as I thought. It appears to be a problem with IntelliJ not being able to download or interact with NEXUS. The version of NEXUS I'm using is:
This may be a show stopper for me but for the time being I can first build outside of IntelliJ and then run from inside IntelliJ.
If you still need my idea.log file, let me know where I can upload it and I'll reset it and send you just this problem.
Thanks for information!
I reported issue on YouTrack: https://youtrack.jetbrains.com/issue/IDEA-274458. Please follow it for updates.
Thanks for reporting the issue. I've struggled with this for years never taking the time to isolate the issue. Thanks for creating the ticket. Hopefully it's easy to fix once an environment is setup that can reproduce it. :-) He said, knowing that might be difficult
Thanks for your help, I love the product and the support you and your team provides.
You are welcome!
You should check if there correct ca-bundle in certificate which nexus use to serve inbound ssl.
I solved the problem only after replacing self-signed certificate with trusted (including ca-bundle).
I found this via google and it seems exactly like my problem. Sometimes artifacts on the nexus are found, sometimes it will try to force an update and there is no vpn-connection and it doesnt take my cache, it instead fails with an error until I try again and again and it suddenly works.
@... I am facing same exception. Here is a line from the exception log which was created:
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: javax.enterprise.concurrent:javax.enterprise.concurrent-api:pom:1.0 failed to transfer from https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact javax.enterprise.concurrent:javax.enterprise.concurrent-api:pom:1.0 from/to central (https://repo.maven.apache.org/maven2): transfer failed for https://repo.maven.apache.org/maven2/javax/enterprise/concurrent/javax.enterprise.concurrent-api/1.0/javax.enterprise.concurrent-api-1.0.pom
Ysharma1, the part of the error message you provided doesn't look related to the problem described in this topic. Could you please share with us the full IntelliJIDEA log? You can do it using the JetBrains Uploads service and post the ID you receive here.