my maven installation recently started throwing a NoSuchAlgorithmException when trying to download plugins and/or dependencies. (See stacktrace below). I'm using Intellij Idea community edition, but have tried running mvn clean install from the CLI as well. Same issue.
I've tried a lot of options on SO and other websites but no success. What I've tried thus far are a few variations of the following (I'm on a Windows 10 system):
Upgrade to maven 3.5, was on 3.0
Upgrade and downgrade my java installation to Zulu 19.30.11-jdk19.0.1 and Microsoft jdk17.0.2. This included changing my JAVA_HOME and path variables.
Installed the https://repo.maven.apache.org/maven2/ SSL certificate (repo.maven.apache.org.crt) downloaded via chrome to java folder lib/security/cacerts using the KeyTool.
Add command line args: -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true
Turn the computer off and on again :D
I have no idea why this is happening, but I hope someone can assist. If you need any further information, please let me know.
Stacktrace from CLI after running mvn clean install -X when trying to build this JavaFX project from Github source:
[ERROR] Failed to execute goal on project module1: Could not resolve dependencies for project com.dlsc.jpackagefx:module1:jar:1.0-SNAPSHOT: Failed to collect dependencies at org.openjfx:javafx-controls:jar:17.0.0.1: Failed to read artifact descriptor for org.openjfx:javafx-controls:jar:17.0.0.1: Could not transfer artifact org.openjfx:javafx-controls:pom:17.0.0.1 from/to central (https://repo.maven.apache.org/maven2): java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext): problem accessing trust store -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project module1: Could not resolve dependencies for project com.dlsc.jpackagefx:module1:jar:1.0-SNAPSHOT: Failed to collect dependencies at org.openjfx:javafx-controls:jar:17.0.0.1
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:221)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies(LifecycleDependencyResolver.java:127)
at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved(MojoExecutor.java:246)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:200)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project com.dlsc.jpackagefx:module1:jar:1.0-SNAPSHOT: Failed to collect dependencies at org.openjfx:javafx-controls:jar:17.0.0.1
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:177)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:195)
... 23 more
Caused by: org.eclipse.aether.collection.DependencyCollectionException: Failed to collect dependencies at org.openjfx:javafx-controls:jar:17.0.0.1
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:300)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.collectDependencies(DefaultRepositorySystem.java:325)
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:169)
... 24 more
Caused by: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.openjfx:javafx-controls:jar:17.0.0.1
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:283)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:199)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.resolveCachedArtifactDescriptor(DefaultDependencyCollector.java:544)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.getArtifactDescriptorResult(DefaultDependencyCollector.java:528)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:418)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:372)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.process(DefaultDependencyCollector.java:360)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:263)
... 26 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact org.openjfx:javafx-controls:pom:17.0.0.1 from/to central (https://repo.maven.apache.org/maven2): java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:453)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:255)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:232)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:268)
... 33 more
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact org.openjfx:javafx-controls:pom:17.0.0.1 from/to central (https://repo.maven.apache.org/maven2): java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext)
at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:52)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:364)
at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:76)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:590)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:258)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:529)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:430)
... 36 more
Caused by: org.apache.maven.wagon.TransferFailedException: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext)
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:1068)
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:962)
at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:126)
at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88)
at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)
at org.eclipse.aether.transport.wagon.WagonTransporter$GetTaskRunner.run(WagonTransporter.java:569)
at org.eclipse.aether.transport.wagon.WagonTransporter.execute(WagonTransporter.java:436)
at org.eclipse.aether.transport.wagon.WagonTransporter.get(WagonTransporter.java:413)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$GetTaskRunner.runTask(BasicRepositoryConnector.java:456)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:359)
... 41 more
Caused by: java.net.SocketException: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext)
at java.base/javax.net.ssl.DefaultSSLSocketFactory.throwException(SSLSocketFactory.java:267)
at java.base/javax.net.ssl.DefaultSSLSocketFactory.createSocket(SSLSocketFactory.java:289)
at org.apache.maven.wagon.providers.http.httpclient.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:363)
at org.apache.maven.wagon.providers.http.httpclient.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:353)
at org.apache.maven.wagon.providers.http.httpclient.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:141)
at org.apache.maven.wagon.providers.http.httpclient.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec.execute(RetryExec.java:88)
at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.maven.wagon.providers.http.httpclient.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
at org.apache.maven.wagon.providers.http.httpclient.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.execute(AbstractHttpClientWagon.java:834)
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:985)
... 50 more
Caused by: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext)
at java.base/java.security.Provider$Service.newInstance(Provider.java:1868)
at java.base/sun.security.jca.GetInstance.getInstance(GetInstance.java:236)
at java.base/sun.security.jca.GetInstance.getInstance(GetInstance.java:164)
at java.base/javax.net.ssl.SSLContext.getInstance(SSLContext.java:185)
at java.base/javax.net.ssl.SSLContext.getDefault(SSLContext.java:110)
at java.base/javax.net.ssl.SSLSocketFactory.getDefault(SSLSocketFactory.java:83)
at java.base/javax.net.ssl.HttpsURLConnection.getDefaultSSLSocketFactory(HttpsURLConnection.java:336)
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.createConnManager(AbstractHttpClientWagon.java:348)
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.<clinit>(AbstractHttpClientWagon.java:274)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at com.google.inject.internal.DefaultConstructionProxyFactory$1.newInstance(DefaultConstructionProxyFactory.java:86)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:105)
at com.google.inject.internal.ConstructorInjector.access$000(ConstructorInjector.java:32)
at com.google.inject.internal.ConstructorInjector$1.call(ConstructorInjector.java:89)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:133)
at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:87)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:267)
at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1103)
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)
at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1051)
at org.eclipse.sisu.space.AbstractDeferredClass.get(AbstractDeferredClass.java:48)
at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:53)
at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:65)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:133)
at com.google.inject.internal.ProvisionListenerStackCallback.provision(ProvisionListenerStackCallback.java:68)
at com.google.inject.internal.ProviderInternalFactory.circularGet(ProviderInternalFactory.java:63)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.get(InternalFactoryToInitializableAdapter.java:45)
at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1016)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1012)
at org.eclipse.sisu.inject.Guice4$1.get(Guice4.java:162)
at org.eclipse.sisu.inject.LazyBeanEntry.getValue(LazyBeanEntry.java:81)
at org.eclipse.sisu.plexus.LazyPlexusBean.getValue(LazyPlexusBean.java:51)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:263)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:255)
at org.eclipse.aether.internal.transport.wagon.PlexusWagonProvider.lookup(PlexusWagonProvider.java:67)
at org.eclipse.aether.transport.wagon.WagonTransporter.lookupWagon(WagonTransporter.java:280)
at org.eclipse.aether.transport.wagon.WagonTransporter.<init>(WagonTransporter.java:124)
at org.eclipse.aether.transport.wagon.WagonTransporterFactory.newInstance(WagonTransporterFactory.java:136)
at org.eclipse.aether.internal.impl.DefaultTransporterProvider.newTransporter(DefaultTransporterProvider.java:119)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector.<init>(BasicRepositoryConnector.java:124)
at org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory.newInstance(BasicRepositoryConnectorFactory.java:189)
at org.eclipse.aether.internal.impl.DefaultRepositoryConnectorProvider.newRepositoryConnector(DefaultRepositoryConnectorProvider.java:122)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:525)
... 37 more
Caused by: java.security.KeyManagementException: problem accessing trust store
at java.base/sun.security.ssl.SSLContextImpl$DefaultManagersHolder.<clinit>(SSLContextImpl.java:942)
at java.base/sun.security.ssl.SSLContextImpl$DefaultSSLContext.<init>(SSLContextImpl.java:1111)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at java.base/java.security.Provider$Service.newInstanceOf(Provider.java:1879)
at java.base/java.security.Provider$Service.newInstanceUtil(Provider.java:1886)
at java.base/java.security.Provider$Service.newInstance(Provider.java:1861)
... 89 more
After searching a bit further when updating to maven 3.8.7, I inspected my Path variables and noted the following System Variable:
MAVEN_OPTS
-Xmx512m -Djavax.net.ssl.trustStore=/Library/Java/JavaVirtualMachines/jdk-11.0.8.jdk/Contents/Home/lib/security/cacerts -Djavax.net.ssl.trustStorePassword=xxxxxxxx
This pointed to a specific certificate - leading all my maven versions to use an outdated or possibly deleted certificate. I deleted this variable and the maven build worked.
I checked all the other java and maven variables and made sure they make sense.
Related
I'm getting ArtifactDescriptorException: Failed to read artifact descriptor for org.clojure:clojure:jar when running a literal hello world program using the command clojure -M file.clj in a docker container. No issue doing it locally. Some googling suggests it might be a maven issue but there're no dependencies so I don't see why it's trying to get anything from a maven repo.
Full error output:
org.clojure:clojure:jar:1.10.2
org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.clojure:clojure:jar:1.10.2
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 clojure.tools.deps.alpha.extensions.maven$eval1068$fn__1070.invoke(maven.clj:107)
at clojure.lang.MultiFn.invoke(MultiFn.java:244)
at clojure.tools.deps.alpha$expand_deps$children_task__785$fn__787$fn__788.invoke(alpha.clj:403)
at clojure.tools.deps.alpha.util.concurrent$submit_task$task__502.invoke(concurrent.clj:34)
at clojure.lang.AFn.call(AFn.java:18)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
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:829)
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact org.clojure:clojure:pom:1.10.2 from/to central (https://repo1.maven.org/maven2/): repo1.maven.org: Temporary failure in name resolution
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)
... 11 more
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact org.clojure:clojure:pom:1.10.2 from/to central (https://repo1.maven.org/maven2/): repo1.maven.org: Temporary failure in name resolution
at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:52)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:369)
at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:75)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:628)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:262)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:499)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:401)
... 14 more
Caused by: java.net.UnknownHostException: repo1.maven.org: Temporary failure in name resolution
at java.base/java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java.base/java.net.InetAddress$PlatformNameService.lookupAllHostAddr(InetAddress.java:929)
at java.base/java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1529)
at java.base/java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:848)
at java.base/java.net.InetAddress.getAllByName0(InetAddress.java:1519)
at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1378)
at java.base/java.net.InetAddress.getAllByName(InetAddress.java:1306)
at org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:45)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.resolveHostname(DefaultClientConnectionOperator.java:263)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:162)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:326)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:605)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:440)
at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:835)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
at org.apache.http.impl.client.DecompressingHttpClient.execute(DecompressingHttpClient.java:164)
at org.eclipse.aether.transport.http.HttpTransporter.execute(HttpTransporter.java:290)
at org.eclipse.aether.transport.http.HttpTransporter.implGet(HttpTransporter.java:246)
at org.eclipse.aether.spi.connector.transport.AbstractTransporter.get(AbstractTransporter.java:67)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$GetTaskRunner.runTask(BasicRepositoryConnector.java:457)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:364)
... 19 more
I have a problem when doing a SonarQube Scan from Jenkins. See the stacktrace in debug mode :
[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar (default-cli) on project scbm-order-parent: Unable to register extension org.sonarsource.scm.git.JGitBlameCommand from plugin 'scmgit': org/eclipse/jgit/api/Git: org.eclipse.jgit.api.Git -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar (default-cli) on project scbm-order-parent: Unable to register extension org.sonarsource.scm.git.JGitBlameCommand from plugin 'scmgit'
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:582)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to register extension org.sonarsource.scm.git.JGitBlameCommand from plugin 'scmgit'
at org.sonarsource.scanner.maven.bootstrap.ExceptionHandling.handle(ExceptionHandling.java:36)
at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute(ScannerBootstrapper.java:81)
at org.sonarsource.scanner.maven.SonarQubeMojo.execute(SonarQubeMojo.java:122)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: java.lang.IllegalStateException: Unable to register extension org.sonarsource.scm.git.JGitBlameCommand from plugin 'scmgit'
at org.sonar.core.platform.ComponentContainer.addExtension(ComponentContainer.java:249)
at org.sonar.scanner.bootstrap.ExtensionInstaller.doInstall(ExtensionInstaller.java:76)
at org.sonar.scanner.bootstrap.ExtensionInstaller.install(ExtensionInstaller.java:57)
at org.sonar.scanner.scan.ProjectScanContainer.addBatchExtensions(ProjectScanContainer.java:227)
at org.sonar.scanner.scan.ProjectScanContainer.doBeforeStart(ProjectScanContainer.java:115)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:141)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:128)
at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:47)
at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:86)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:143)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:128)
at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:118)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:117)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy31.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:233)
at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
at org.sonarsource.scanner.maven.bootstrap.ScannerBootstrapper.execute(ScannerBootstrapper.java:78)
... 22 more
Caused by: java.lang.NoClassDefFoundError: org/eclipse/jgit/api/Git
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.getDeclaredMethods(Class.java:1975)
at org.picocontainer.injectors.AdaptingInjection$1.run(AdaptingInjection.java:203)
at java.security.AccessController.doPrivileged(Native Method)
at org.picocontainer.injectors.AdaptingInjection.injectionMethodAnnotated(AdaptingInjection.java:200)
at org.picocontainer.injectors.AdaptingInjection.methodAnnotatedInjectionAdapter(AdaptingInjection.java:171)
at org.picocontainer.injectors.AdaptingInjection.createComponentAdapter(AdaptingInjection.java:70)
at org.picocontainer.behaviors.AbstractBehaviorFactory.createComponentAdapter(AbstractBehaviorFactory.java:44)
at org.picocontainer.behaviors.OptInCaching.createComponentAdapter(OptInCaching.java:45)
at org.picocontainer.DefaultPicoContainer.addComponent(DefaultPicoContainer.java:536)
at org.picocontainer.DefaultPicoContainer.access$300(DefaultPicoContainer.java:84)
at org.picocontainer.DefaultPicoContainer$AsPropertiesPicoContainer.addComponent(DefaultPicoContainer.java:1149)
at org.sonar.core.platform.ComponentContainer.addExtension(ComponentContainer.java:247)
... 44 more
Caused by: java.lang.ClassNotFoundException: org.eclipse.jgit.api.Git
at org.sonar.classloader.ParentFirstStrategy.loadClass(ParentFirstStrategy.java:39)
at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:87)
at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:76)
... 58 more
Used versions :
Jenkins 1.624 (ok... old one but cannot upgrade it now)
sources scan with Java 8
Sonarqube 6.3 (Git plugin version 1.2, java plugin version 4.6.0.8784)
Extract from the pom.xml :
<pluginManagement>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>3.2</version>
</plugin>
</pluginManagement>
mvn command line :
clean install -U -X org.sonarsource.scanner.maven:sonar-maven-plugin:3.2:sonar -Dsonar.host.url=http://x.x.x.x:9000 -Dsonar.working.directory=/tmp/.sonar/ -Dsonar.login=xxxxxxxxxxxxxx -DskipTests=true site
Any idea ?
I have also tried to add the JGit artifact in the plugin management part in my pom.xml, without success... :(
Ok, it works now. Just disable Git SCM plugin. Don't know why...
Then disable Sonar XML Plugin because of the next error :
Caused by: java.lang.ClassNotFoundException: org.sonar.squidbridge.api.AnalysisException
If anyone know why, please answer :)
I have also seen that some guys have updated JGit dependency version in Sonar Git plugin : https://groups.google.com/forum/#!topic/sonarqube/TcRrB9XBk8o.
Not tested...
We ran into a similar issue with Sonarqube v5.6.7. The root cause appears to have been that the local cache of the plugin library that gets downloaded by the sonar scanner was corrupted.
Content found under "/logs/ssc/sonar/cache/cache":
./675ef60911b1d93e17e84ab20261e18a
./675ef60911b1d93e17e84ab20261e18a/sonar-xml-plugin-1.5-SNAPSHOT.jar_unzip
./675ef60911b1d93e17e84ab20261e18a/sonar-xml-plugin-1.5-SNAPSHOT.jar_unzip/META-INF
./675ef60911b1d93e17e84ab20261e18a/sonar-xml-plugin-1.5-SNAPSHOT.jar_unzip/META-INF/lib
Note that the "lib" dir was empty. Deleting the entire content of the "/logs/ssc/sonar/cache/cache" cache directory and running another project scan caused it to re-download and the lib dir was now populated with the list of dependency libraries for that plugin.
To find where the local cache of plugin jars lived I ran "strace -f -e trace=open,close,read,write -o strace.log " and then searched "strace.log" for a plugin name.
I'm trying to follow the instruction on how to run a Spring application from command line: getting-started-cli-example. After I run the application by entering spring run app.groovy I got the following error:
C:\Users\Administrator\Desktop>spring run app.groovy
startup failed:
General error during conversion: org.eclipse.aether.resolution.DependencyResolutionException: The fo
llowing artifacts could not be resolved: org.springframework.boot:spring-boot-starter:jar:2.0.0.BUIL
D-SNAPSHOT, org.springframework.boot:spring-boot-starter-web:jar:2.0.0.BUILD-SNAPSHOT: Could not fin
d artifact org.springframework.boot:spring-boot-starter:jar:2.0.0.BUILD-SNAPSHOT in local-developer-
group (http://192.168.10.245:8081/nexus/content/groups/public)
org.springframework.boot.cli.compiler.grape.DependencyResolutionFailedException: org.eclipse.aether.
resolution.DependencyResolutionException: The following artifacts could not be resolved: org.springf
ramework.boot:spring-boot-starter:jar:2.0.0.BUILD-SNAPSHOT, org.springframework.boot:spring-boot-sta
rter-web:jar:2.0.0.BUILD-SNAPSHOT: Could not find artifact org.springframework.boot:spring-boot-star
ter:jar:2.0.0.BUILD-SNAPSHOT in local-developer-group (http://192.168.10.245:8081/nexus/content/grou
ps/public)
at org.springframework.boot.cli.compiler.grape.AetherGrapeEngine.resolve(AetherGrapeEngine.java:322)
at org.springframework.boot.cli.compiler.grape.AetherGrapeEngine.grab(AetherGrapeEngine.java:127)
at groovy.grape.Grape.grab(Grape.java:167)
at groovy.grape.GrabAnnotationTransformation.visit(GrabAnnotationTransformation.java:378)
at org.codehaus.groovy.transform.ASTTransformationVisitor$3.call(ASTTransformationVisitor.java:321)
at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:931)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:593)
at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:569)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:546)
at org.springframework.boot.cli.compiler.GroovyCompiler.compile(GroovyCompiler.java:205)
at org.springframework.boot.cli.command.run.SpringApplicationRunner.compile(SpringApplicationRunner.java:129)
at org.springframework.boot.cli.command.run.SpringApplicationRunner.compileAndRun(SpringApplicationRunner.java:101)
at org.springframework.boot.cli.command.run.RunCommand$RunOptionHandler.run(RunCommand.java:111)
at org.springframework.boot.cli.command.options.OptionHandler.run(OptionHandler.java:84)
at org.springframework.boot.cli.command.OptionParsingCommand.run(OptionParsingCommand.java:54)
at org.springframework.boot.cli.command.CommandRunner.run(CommandRunner.java:219)
at org.springframework.boot.cli.command.CommandRunner.runAndHandleErrors(CommandRunner.java:171)
at org.springframework.boot.cli.SpringCli.main(SpringCli.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: org.eclipse.aether.resolution.DependencyResolutionException: The following artifacts coul
d not be resolved: org.springframework.boot:spring-boot-starter:jar:2.0.0.BUILD-SNAPSHOT, org.spring
framework.boot:spring-boot-starter-web:jar:2.0.0.BUILD-SNAPSHOT: Could not find artifact org.springf
ramework.boot:spring-boot-starter:jar:2.0.0.BUILD-SNAPSHOT in local-developer-group (http://192.168.
10.245:8081/nexus/content/groups/public)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:384)
at org.springframework.boot.cli.compiler.grape.AetherGrapeEngine.resolve(AetherGrapeEngine.java:317)
... 25 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: The following artifacts could
not be resolved: org.springframework.boot:spring-boot-starter:jar:2.0.0.BUILD-SNAPSHOT, org.springfr
amework.boot:spring-boot-starter-web:jar:2.0.0.BUILD-SNAPSHOT: Could not find artifact org.springfra
mework.boot:spring-boot-starter:jar:2.0.0.BUILD-SNAPSHOT in local-developer-group (http://192.168.10
.245:8081/nexus/content/groups/public)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:444)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:367)
... 26 more
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find artifact org.spring
framework.boot:spring-boot-starter:jar:2.0.0.BUILD-SNAPSHOT in local-developer-group (http://192.168
.10.245:8081/nexus/content/groups/public)
at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:39)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:355)
at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:67)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
1 error
I tried to change the local-developer-group url in settings.xml of my maven installation to http://repo.spring.io/snapshot/ since the error report clearly says the required artifact cannot be found, but still I got the the same error. It seems the spring-boot-cli doesn't use the settings of my maven installation. But I couldn't think of another place where this url can be specified.
You should use the release version of spring-boot-cli instead of the cutting edge snapshot version: Manual installation.
The maven settings.xml spring-boot-cli uses is located in the .m2 directory.
I downloaded and installed the latest version of spring cli (1.5.1), i created a groovy file with #RestController and #RequestMapping but when i try to run it i have these errors.
startup failed:
General error during conversion: org.eclipse.aether.resolution.DependencyResolutionException: Failed to collect dependencies at org.codehaus.groovy:groovy-templates:jar:2.4.7
org.springframework.boot.cli.compiler.grape.DependencyResolutionFailedException: org.eclipse.aether.resolution.DependencyResolutionException: Failed to collect dependencies at org.codehaus.groovy:groovy-templates:jar:2.4.7
at org.springframework.boot.cli.compiler.grape.AetherGrapeEngine.resolve(AetherGrapeEngine.java:322)
at org.springframework.boot.cli.compiler.grape.AetherGrapeEngine.grab(AetherGrapeEngine.java:127)
at groovy.grape.Grape.grab(Grape.java:167)
at groovy.grape.GrabAnnotationTransformation.visit(GrabAnnotationTransformation.java:378)
at org.codehaus.groovy.transform.ASTTransformationVisitor$3.call(ASTTransformationVisitor.java:321)
at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:931)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:593)
at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:569)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:546)
at org.springframework.boot.cli.compiler.GroovyCompiler.compile(GroovyCompiler.java:205)
at org.springframework.boot.cli.command.run.SpringApplicationRunner.compile(SpringApplicationRunner.java:129)
at org.springframework.boot.cli.command.run.SpringApplicationRunner.compileAndRun(SpringApplicationRunner.java:101)
at org.springframework.boot.cli.command.run.RunCommand$RunOptionHandler.run(RunCommand.java:111)
at org.springframework.boot.cli.command.options.OptionHandler.run(OptionHandler.java:84)
at org.springframework.boot.cli.command.OptionParsingCommand.run(OptionParsingCommand.java:54)
at org.springframework.boot.cli.command.CommandRunner.run(CommandRunner.java:219)
at org.springframework.boot.cli.command.CommandRunner.runAndHandleErrors(CommandRunner.java:171)
at org.springframework.boot.cli.SpringCli.main(SpringCli.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: org.eclipse.aether.resolution.DependencyResolutionException: Failed to collect dependencies at org.codehaus.groovy:groovy-templates:jar:2.4.7
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:380)
at org.springframework.boot.cli.compiler.grape.AetherGrapeEngine.resolve(AetherGrapeEngine.java:317)
... 25 more
Caused by: org.eclipse.aether.collection.DependencyCollectionException: Failed to collect dependencies at org.codehaus.groovy:groovy-templates:jar:2.4.7
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:291)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:341)
... 26 more
Caused by: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.codehaus.groovy:groovy-templates:jar:2.4.7
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:335)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:217)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.resolveCachedArtifactDescriptor(DefaultDependencyCollector.java:535)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.getArtifactDescriptorResult(DefaultDependencyCollector.java:519)...
... 27 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact org.codehaus.groovy:groovy-templates:pom:2.4.7 from/to central (http://repo1.maven.org/maven2/): Connect to repo1.maven.org:80 timed out
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:444)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:223)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:320)
... 34 more
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact org.codehaus.groovy:groovy-templates:pom:2.4.7 from/to central (http://repo1.maven.org/maven2/): Connect to repo1.maven.org:80 timed out
at org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:43)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:355)
at org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:67)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:581)...
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:520)...
... 37 more...
I read to run it a couple of times and it should work but it doesn't.
Its most likely due to network or proxy related issue. Please follow the link
https://docs.spring.io/spring-boot/docs/current/reference/html/cli-maven-settings.html
Also you should set JAVA_TOOL_OPTIONS env variable:
-Dhttp.proxyHost=YOUR_PROXY_HOST -Dhttp.proxyPort=YOUR_PROXY_PORT -Dhttps.proxySet=true
When I run maven install -o -X, maven puts the output (a jar) to the .m2 folder. The problem is that in my case this generates a metadata file named "maven-metadata-local.xml". When I reference this artifact from another maven build, maven complains that the metadata file "maven-metadata.xml" cannot be found (at the exact same location).
So basically I have to questions:
Where does the "-local" part come from and what does it exactly mean?
How to I make this build work, i.e. tell maven to name the meta-data file "maven-metadata.xml" while building the first artifact or tell maven to look for the file "maven-metadata-local.xml" when resolving the dependencies in the second build?
The dependency in the second pom is:
<dependencies>
<dependency>
<groupId>a.b.c</groupId>
<artifactId>d</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
the location of the jar in the local .m2 directory is
.m2/a/b/c/d/1.0.0-SNAPSHOT/d-1.0.0-SNAPSHOT.jar
Here is the error message:
[DEBUG] =======================================================================
[DEBUG] Cannot access central (https://repo1.maven.org/maven2) in offline mode and the metadata ch.*****.*****:*****-server:1.0.0-SNAPSHOT/maven-metadata.xml has not been downloaded from it before
[DEBUG] Cannot access central (https://repo1.maven.org/maven2) in offline mode and the metadata ch.*****.*****:*****-server:1.0.0-SNAPSHOT/maven-metadata.xml has not been downloaded from it before
[DEBUG] Could not find metadata ch.*****.*****:*****-project:1.0.0-SNAPSHOT/maven-metadata.xml in local (/home/*****/.m2/repository)
[DEBUG] Cannot access central (https://repo1.maven.org/maven2) in offline mode and the metadata ch.*****.*****:*****-project:1.0.0-SNAPSHOT/maven-metadata.xml has not been downloaded from it before
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=1, ConflictMarker.markTime=0, ConflictMarker.nodeCount=2, ConflictIdSorter.graphTime=0, ConflictIdSorter.topsortTime=1, ConflictIdSorter.conflictIdCount=1, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=3, ConflictResolver.conflictItemCount=1, DefaultDependencyCollector.collectTime=17, DefaultDependencyCollector.transformTime=7}
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.268 s
[INFO] Finished at: 2016-11-29T15:25:03+01:00
[INFO] Final Memory: 16M/481M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project *****-assembly: Could not resolve dependencies for project ch.*****.*****:*****-assembly:pom:1.0.0-SNAPSHOT: Failed to collect dependencies at ch.*****.*****:*****-server:jar:1.0.0-SNAPSHOT: Failed to read artifact descriptor for ch.*****.*****:*****-server:jar:1.0.0-SNAPSHOT: Cannot access central (https://repo1.maven.org/maven2) in offline mode and the artifact ch.*****.*****:*****-project:pom:1.0.0-SNAPSHOT has not been downloaded from it before. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project *****-assembly: Could not resolve dependencies for project ch.*****.*****:*****-assembly:pom:1.0.0-SNAPSHOT: Failed to collect dependencies at ch.*****.*****:*****-server:jar:1.0.0-SNAPSHOT
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:221)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies(LifecycleDependencyResolver.java:127)
at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved(MojoExecutor.java:245)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:199)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.project.DependencyResolutionException: Could not resolve dependencies for project ch.*****.*****:*****-assembly:pom:1.0.0-SNAPSHOT: Failed to collect dependencies at ch.*****.*****:*****-server:jar:1.0.0-SNAPSHOT
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:180)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:195)
... 23 more
Caused by: org.eclipse.aether.collection.DependencyCollectionException: Failed to collect dependencies at ch.*****.*****:*****-server:jar:1.0.0-SNAPSHOT
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:291)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.collectDependencies(DefaultRepositorySystem.java:316)
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:172)
... 24 more
Caused by: org.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for ch.*****.*****:*****-server:jar:1.0.0-SNAPSHOT
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:329)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:198)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.resolveCachedArtifactDescriptor(DefaultDependencyCollector.java:535)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.getArtifactDescriptorResult(DefaultDependencyCollector.java:519)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:409)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.processDependency(DefaultDependencyCollector.java:363)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.process(DefaultDependencyCollector.java:351)
at org.eclipse.aether.internal.impl.DefaultDependencyCollector.collectDependencies(DefaultDependencyCollector.java:254)
... 26 more
Caused by: org.apache.maven.model.resolution.UnresolvableModelException: Cannot access central (https://repo1.maven.org/maven2) in offline mode and the artifact ch.*****.*****:*****-project:pom:1.0.0-SNAPSHOT has not been downloaded from it before.
at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel(DefaultModelResolver.java:177)
at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel(DefaultModelResolver.java:226)
at org.apache.maven.model.building.DefaultModelBuilder.readParentExternally(DefaultModelBuilder.java:1000)
at org.apache.maven.model.building.DefaultModelBuilder.readParent(DefaultModelBuilder.java:800)
at org.apache.maven.model.building.DefaultModelBuilder.build(DefaultModelBuilder.java:329)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:320)
... 33 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Cannot access central (https://repo1.maven.org/maven2) in offline mode and the artifact ch.*****.*****:*****-project:pom:1.0.0-SNAPSHOT has not been downloaded from it before.
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:444)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:246)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:223)
at org.apache.maven.repository.internal.DefaultModelResolver.resolveModel(DefaultModelResolver.java:173)
... 38 more
Caused by: org.eclipse.aether.transfer.ArtifactNotFoundException: Cannot access central (https://repo1.maven.org/maven2) in offline mode and the artifact ch.*****.*****:*****-project:pom:1.0.0-SNAPSHOT has not been downloaded from it before.
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:391)
... 41 more
Caused by: org.eclipse.aether.transfer.RepositoryOfflineException: Cannot access central (https://repo1.maven.org/maven2) in offline mode
at org.eclipse.aether.internal.impl.DefaultOfflineController.checkOffline(DefaultOfflineController.java:72)
at org.eclipse.aether.internal.impl.Utils.checkOffline(Utils.java:115)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:387)
... 41 more
[ERROR]
[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