Cannot resolve plugs-ins in Intellij after upgrading to version 2019.3 (CE)

robbie70 :

I have just upgraded my Intellij from version 2019.2.x to 2019.3 but am getting the following Maven plug-in errors in my Java project.

Cannot resolve plugin org.codehaus.mojo:exec-maven-plugin:1.6.0
Cannot resolve plugin org.apache.maven.plugins:maven-resources-plugin:3.1.0

Below are the versions listed of Maven (which I just upgraded from 3.6.0 to 3.6.3) and Java v11.

> Apache Maven 3.6.3  Maven home: /usr/local/Cellar/maven/3.6.3/libexec
> Java version: 11.0.2, vendor: Oracle Corporation, runtime:
/Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home Default
locale: en_GB, platform encoding: UTF-8 OS name: "mac os x", version:
"10.15.1", arch: "x86_64", family: "mac"

Below is an extract from the intellij log file (idea.log)

2019-11-29 13:05:06,759 [4279936]   INFO - pl.ProjectRootManagerComponent - project roots have changed 
2019-11-29 13:05:06,794 [4279971]   INFO - .diagnostic.PerformanceWatcher - Pushing properties took 4ms; general responsiveness: ok; EDT responsiveness: ok 
2019-11-29 13:05:06,815 [4279992]   INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 20ms; general responsiveness: ok; EDT responsiveness: ok 
2019-11-29 13:05:07,480 [4280657]   INFO -      #org.jetbrains.idea.maven - org.apache.maven.plugin.PluginResolutionException: Plugin org.codehaus.mojo:exec-maven-plugin:1.6.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.codehaus.mojo:exec-maven-plugin:jar:1.6.0 
java.lang.RuntimeException: org.apache.maven.plugin.PluginResolutionException: Plugin org.codehaus.mojo:exec-maven-plugin:1.6.0 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.codehaus.mojo:exec-maven-plugin:jar:1.6.0
	at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:120)
	at org.jetbrains.idea.maven.server.Maven3XServerEmbedder.resolvePlugin(Maven3XServerEmbedder.java:1161)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359)
	at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
	at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:562)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:796)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:677)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:676)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.RuntimeException: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.codehaus.mojo:exec-maven-plugin:jar:1.6.0
	at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:255)
	at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:171)
	at org.eclipse.aether.internal.impl.DefaultRepositorySystem.readArtifactDescriptor(DefaultRepositorySystem.java:255)
	at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:106)
	... 18 more
Caused by: java.lang.RuntimeException: org.eclipse.aether.resolution.ArtifactResolutionException: Failure to transfer org.codehaus.mojo:exec-maven-plugin:pom:1.6.0 from https://nexus.xxisp.yyyyyy.net/repository/public/ was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced. Original error: Could not transfer artifact org.codehaus.mojo:exec-maven-plugin:pom:1.6.0 from/to nexus (https://nexus.xxisp.yyyyyy.net/repository/public/): Connect to nexus.xxisp.yyyyyy.net:443 [nexus.xxisp.yyyyyy.net/81.135.143.77] failed: Operation timed out (Connection timed out)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:424)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:229)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:207)
	at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:240)
	... 21 more
Caused by: java.lang.RuntimeException: org.eclipse.aether.transfer.ArtifactTransferException: Failure to transfer org.codehaus.mojo:exec-maven-plugin:pom:1.6.0 from https://nexus.xxisp.yyyyyy.net/repository/public/ was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced. Original error: Could not transfer artifact org.codehaus.mojo:exec-maven-plugin:pom:1.6.0 from/to nexus (https://nexus.xxisp.yyyyyy.net/repository/public/): Connect to nexus.xxisp.yyyyyy.net:443 [nexus.xxisp.yyyyyy.net/81.135.143.77] failed: Operation timed out (Connection timed out)
	at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.newException(DefaultUpdateCheckManager.java:225)
	at org.eclipse.aether.internal.impl.DefaultUpdateCheckManager.checkArtifact(DefaultUpdateCheckManager.java:193)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.gatherDownloads(DefaultArtifactResolver.java:559)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:483)
	at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:401)
	... 24 more

Does anyone know how to debug this and better fix it ?

UPDATE: I have managed to resolve the issue now. I think the problem was that although at the time that I did the upgrade I was connected to the internet I wasn't connected to my company VPN (as I was working from home that day) and this may have caused the look-up to my company's NEXUS repo to fail. Later, when I did connect to the VPN, Maven wasn't able to re-sync the plug-ins for some reason. So the issue wasn't related to the Intellij upgrade at all. I hope this technique to resolve these types of errors can help someone else.

robbie70 :

This post gist/github helped me to resolve both issues.

1/Cannot resolve plugin org.codehaus.mojo:exec-maven-plugin:1.6.0

I located the entry for this plugin in the .m2 directory,

/Users/my-user/.m2/repository/org/codehaus/mojo/exec-maven-plugin/1.6.0

I deleted this entry and did a Maven re-sync from within Intellij. This time it seemed to find it ok.

I managed to fix the second error using the same approach,

2/Cannot resolve plugin org.apache.maven.plugins:maven-resources-plugin:3.1.0

this plug-in is located under,

/Users/my-user/.m2/repository/org/apache/maven/plugins/maven-resources-plugin/3.1.0

I deleted this entry as well and then did another Maven re-sync from within Intellij and this worked too.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=356508&siteId=1