Maven not working when 'mvn package' command is run - java

I am working on a Spring mvc using Eclipse. Until now I was using ant to create war file. But now I switched to Maven. I have copied Maven 3.3 on my system and set system variables for Maven. It works fine, when I run Maven following command from command prompt:
mvn -version
I have created a pom.xml file in my Spring mvc app's root directory. I run Maven through command prompt, not through Eclipse. When I run following command:
mvn -X package
it shows following errors:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 22.590 s
[INFO] Finished at: 2015-06-16T12:52:16+05:30
[INFO] Final Memory: 4M/15M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.mav
en.plugins:maven-resources-plugin:jar:2.6: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from/to central (https://repo.maven.apache.
org/maven2): Connect to repo.maven.apache.org:443 [repo.maven.apache.org/199.27.79.215] failed: Connection timed out: connect -> [Help 1]
org.apache.maven.plugin.PluginResolutionException: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to
read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:117)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor(DefaultMavenPluginManager.java:179)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDescriptor(DefaultMavenPluginManager.java:298)
at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor(DefaultBuildPluginManager.java:241)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecution(DefaultLifecycleExecutionPlanCalculator.java:169)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecutions(DefaultLifecycleExecutionPlanCalculator.java:155)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.java:131)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.java:145)
at org.apache.maven.lifecycle.internal.builder.BuilderCommon.resolveBuildPlan(BuilderCommon.java:96)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:109)
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:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
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.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:302)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:218)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.readArtifactDescriptor(DefaultRepositorySystem.java:287)
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:103)
... 26 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from/to central
(https://repo.maven.apache.org/maven2): Connect to repo.maven.apache.org:443 [repo.maven.apache.org/199.27.79.215] failed: Connection timed out: connect
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:287)
... 29 more
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from/to central (htt
ps://repo.maven.apache.org/maven2): Connect to repo.maven.apache.org:443 [repo.maven.apache.org/199.27.79.215] failed: Connection timed out: connect
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.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:249)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:520)
at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:421)
... 32 more
Caused by: org.apache.maven.wagon.TransferFailedException: Connect to repo.maven.apache.org:443 [repo.maven.apache.org/199.27.79.215] failed: Connection timed out: connec
t
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:1066)
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:960)
at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:116)
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:560)
at org.eclipse.aether.transport.wagon.WagonTransporter.execute(WagonTransporter.java:427)
at org.eclipse.aether.transport.wagon.WagonTransporter.get(WagonTransporter.java:404)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$GetTaskRunner.runTask(BasicRepositoryConnector.java:447)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:350)
... 37 more
Caused by: org.apache.maven.wagon.providers.http.httpclient.conn.HttpHostConnectException: Connect to repo.maven.apache.org:443 [repo.maven.apache.org/199.27.79.215] fail
ed: Connection timed out: connect
at org.apache.maven.wagon.providers.http.httpclient.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:140)
at org.apache.maven.wagon.providers.http.httpclient.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:318)
at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:363)
at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.MainClientExec.execute(MainClientExec.java:219)
at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195)
at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RetryExec.execute(RetryExec.java:86)
at org.apache.maven.wagon.providers.http.httpclient.impl.execchain.RedirectExec.execute(RedirectExec.java:108)
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:832)
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:983)
... 46 more
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at org.apache.maven.wagon.providers.http.httpclient.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:239)
at org.apache.maven.wagon.providers.http.httpclient.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:123)
... 56 more
It says connection timed out, but my internet is running fine.

199.27.79.215 is not the right IP address for repo.maven.apache.org. The right IP address is 23.235.40.215 (as of 9/10/2015 from my desktop). If I open a browser to https://199.27.79.215/, I get a web page which says unknown domain: 199.27.79.215.
The problem is that Maven is being run in an environment without a direct connection to the Internet. Maven needs to be configured to go through the HTTP Proxy. The Maven documentation for this is found here. Here's the information...
Configuring a proxy
You can configure a proxy to use for some or all of your HTTP requests
with Maven. The username and password are only required if your proxy
requires basic authentication (note that later releases may support
storing your passwords in a secured keystore - in the mean time,
please ensure your settings.xml file (usually
${user.home}/.m2/settings.xml) is secured with permissions appropriate
for your operating system).
The nonProxyHosts setting accepts wild cards, and each host not to
proxy is separated by the | character. This matches the JDK
configuration equivalent.
<settings>
.
.
<proxies>
<proxy>
<id>example-proxy</id>
<active>true</active>
<protocol>http</protocol>
<host>proxy.example.com</host>
<port>8080</port>
<username>proxyuser</username>
<password>somepassword</password>
<nonProxyHosts>www.google.com|*.example.com</nonProxyHosts>
</proxy>
</proxies>
.
.
</settings>

I found that setting my MAVEN_OPTS environment variable worked. Apparently JDK7 has some issues with it: https://issues.apache.org/jira/browse/MNG-5162
export MAVEN_OPTS="-Djava.net.preferIPv4Stack=true"

You are using the repository which is available at
repo.maven.apache.org:443 [repo.maven.apache.org/199.27.79.215]
and as the error says, maven is not able to reach that URL:
org/maven2): Connect to repo.maven.apache.org:443 [repo.maven.apache.org/199.27.79.215] failed: Connection timed out: connect -> [Help 1]
Check your internet connection and make sure you are able to reach the repo. You can test it by trying to hit the URL in browser or by using curl

Related

ArtifactDescriptorException when running a clojure hello world in a docker container

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

Resolving Maven dependencies: Proxy authentication problems

I am working at a company where the local machines are working behind a proxy. The proxy requires no authentication. I have a maven project in IntelliJ which works on my laptop but which I cannot get working on the local machine.
So I have imported the project on my local machine.
Set the proxy settings in IntelliJ
Set the proxy settings in my maven settings.xml as shown in this stackoverflow queston
I have also tried the solution presented in this question
where I add -DproxySet=true -DproxyHost=myproxy.com -DproxyPort=3128 with my proxy settings.
I keep on getting the following errors. In IntelliJ my pom file says:
I have also tried mvn -U clean install as suggested here But then I get the following errorstack:
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building testforce 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.845 s
[INFO] Finished at: 2018-01-23T11:32:41+01:00
[INFO] Final Memory: 12M/309M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (http://repo1.maven.org/maven2): Not authorized by proxy , ReasonPhrase:Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. ). -> [Help 1]
org.apache.maven.plugin.PluginResolutionException: Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:117)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor(DefaultMavenPluginManager.java:181)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDescriptor(DefaultMavenPluginManager.java:286)
at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor(DefaultBuildPluginManager.java:241)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecution(DefaultLifecycleExecutionPlanCalculator.java:169)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecutions(DefaultLifecycleExecutionPlanCalculator.java:155)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.java:131)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.java:145)
at org.apache.maven.lifecycle.internal.builder.BuilderCommon.resolveBuildPlan(BuilderCommon.java:96)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:110)
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 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.eclipse.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5
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.DefaultRepositorySystem.readArtifactDescriptor(DefaultRepositorySystem.java:296)
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:103)
... 26 more
Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (http://repo1.maven.org/maven2): Not authorized by proxy , ReasonPhrase:Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. ).
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)
... 29 more
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (http://repo1.maven.org/maven2): Not authorized by proxy , ReasonPhrase:Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. ).
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)
... 32 more
Caused by: org.apache.maven.wagon.authorization.AuthorizationException: Not authorized by proxy , ReasonPhrase:Proxy Authentication Required ( Forefront TMG requires authorization to fulfill the request. Access to the Web Proxy filter is denied. ).
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:1011)
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)
... 37 more
[ERROR]
[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/PluginResolutionException
So according to the error it has failed to authenticate on the proxy, but the proxy needs no authentication. Any idea's how to tackle this issue?
Be sure to declare proxy in maven folder/conf/settings.xml:
<proxy>
<id>optional</id>
<active>true</active>
<protocol>https</protocol>
<username>user</username>
<password></password>
<host>proxyhost</host>
<port>443</port>
<nonProxyHosts>local.net|some.host.com</nonProxyHosts>
</proxy>
Be sure to link the correct settings.xml in Intellij Project clicking on File\Settings\Maven\User Settings File.
Also your exact error is
org.apache.maven.plugin.PluginResolutionException
It seems you need to declare the dependency's pluginrepo in the pom.xml OR the dependency isn't managed anymore from the oldest repo.
Infact the dependency 2.5 is super old, try:
<!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-clean-plugin -->
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.0.0</version>
</dependency>
EDIT:
probably due to Proxy settings (Kerberos NTLM proxy maybe) try this in settings.xml:
<username>DOMAINNAME\USERNAME</username>
Try this, hope it will work.
Eclipse -> window -> preferences -> search for proxy -> Network connection
** check the proxy (password should be correct)
Go to C:\Users\****\.m2\settings.xml - check the setting.xml file - verfiy these lines ->
<id>http-proxy</id>
<active>true</active>
<protocol>http</protocol>
<host>***host***</host>
<port>8080</port>
<username>***username***</username>
<password>***password***</password>
<nonProxyHosts>****</nonProxyHosts>
</proxy>

Could not find artifact org.springframework.boot:spring-boot-starter:jar:2.0.0.BUILD-SNAPSHOT in local-developer-group while running spring-boot-cli

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.

Maven install generates meta-data-local.xml instead of meta-data.xml

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

Maven - exception during project building

When I'm trying to build project I get exception:
Downloading:
http://repo.maven.apache.org/maven2/log4j/log4j/1.2.14/log4j-1.2.14.jar
Nov 4, 2012 5:47:16 PM
org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultRequestDirector
tryExecute INFO: I/O exception (java.net.SocketException) caught when
processing request: Connection reset Nov 4, 2012 5:47:16 PM
org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultRequestDirector
tryExecute INFO: Retrying request Nov 4, 2012 5:48:16 PM
org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultRequestDirector
tryExecute INFO: I/O exception (java.net.SocketException) caught when
processing request: Connection reset Nov 4, 2012 5:48:16 PM
org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultRequestDirector
tryExecute INFO: Retrying request Nov 4, 2012 5:49:17 PM
org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultRequestDirector
tryExecute INFO: I/O exception (java.net.SocketException) caught when
processing request: Connection reset Nov 4, 2012 5:49:17 PM
org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultRequestDirector
tryExecute INFO: Retrying request [DEBUG] Writing resolution tracking
file
/root/.m2/repository/log4j/log4j/1.2.14/log4j-1.2.14.jar.lastUpdated
[INFO]
------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO]
------------------------------------------------------------------------ [INFO] Total time: 4:03.016s [INFO] Finished at: Sun Nov 04 17:50:17
CET 2012 [INFO] Final Memory: 5M/15M [INFO]
------------------------------------------------------------------------ [ERROR] Failed to execute goal on project
jboss-ejb3-examples-ch04-firstejb: Could not resolve dependencies for
project
org.jboss.ejb3.examples:jboss-ejb3-examples-ch04-firstejb:jar:1.0.0-cr-1:
Could not transfer artifact log4j:log4j:jar:1.2.14 from/to central
(http://repo.maven.apache.org/maven2): Connection reset -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to
execute goal on project jboss-ejb3-examples-ch04-firstejb: Could not
resolve dependencies for project
org.jboss.ejb3.examples:jboss-ejb3-examples-ch04-firstejb:jar:1.0.0-cr-1:
Could not transfer artifact log4j:log4j:jar:1.2.14 from/to central
(http://repo.maven.apache.org/maven2): Connection reset at
org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:210)
at
org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resolveProjectDependencies(LifecycleDependencyResolver.java:117)
at
org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAreResolved(MojoExecutor.java:258)
at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:201)
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:84)
at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at
org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320) at
org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) at
org.apache.maven.cli.MavenCli.execute(MavenCli.java:537) at
org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196) at
org.apache.maven.cli.MavenCli.main(MavenCli.java:141) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597) at
org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.project.DependencyResolutionException:
Could not resolve dependencies for project
org.jboss.ejb3.examples:jboss-ejb3-examples-ch04-firstejb:jar:1.0.0-cr-1:
Could not transfer artifact log4j:log4j:jar:1.2.14 from/to central
(http://repo.maven.apache.org/maven2): Connection reset at
org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:189)
at
org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDependencies(LifecycleDependencyResolver.java:185)
... 22 more Caused by:
org.sonatype.aether.resolution.DependencyResolutionException: Could
not transfer artifact log4j:log4j:jar:1.2.14 from/to central
(http://repo.maven.apache.org/maven2): Connection reset at
org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:375)
at
org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:183)
... 23 more Caused by:
org.sonatype.aether.resolution.ArtifactResolutionException: Could not
transfer artifact log4j:log4j:jar:1.2.14 from/to central
(http://repo.maven.apache.org/maven2): Connection reset at
org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:538)
at
org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:216)
at
org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDependencies(DefaultRepositorySystem.java:358)
... 24 more Caused by:
org.sonatype.aether.transfer.ArtifactTransferException: Could not
transfer artifact log4j:log4j:jar:1.2.14 from/to central
(http://repo.maven.apache.org/maven2): Connection reset at
org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:951)
at
org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:939)
at
org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:669)
at
org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:60)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662) Caused by:
org.apache.maven.wagon.TransferFailedException: Connection reset at
org.apache.maven.wagon.shared.http4.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:799)
at
org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:116)
at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88)
at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61) at
org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:601)
... 4 more Caused by: java.net.SocketException: Connection reset at
java.net.SocketInputStream.read(SocketInputStream.java:168) at
org.apache.maven.wagon.providers.http.httpclient.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:149)
at
org.apache.maven.wagon.providers.http.httpclient.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:111)
at
org.apache.maven.wagon.providers.http.httpclient.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:264)
at
org.apache.maven.wagon.providers.http.httpclient.impl.conn.DefaultResponseParser.parseHead(DefaultResponseParser.java:98)
at
org.apache.maven.wagon.providers.http.httpclient.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:252)
at
org.apache.maven.wagon.providers.http.httpclient.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:282)
at
org.apache.maven.wagon.providers.http.httpclient.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:247)
at
org.apache.maven.wagon.providers.http.httpclient.impl.conn.AbstractClientConnAdapter.receiveResponseHeader(AbstractClientConnAdapter.java:219)
at
org.apache.maven.wagon.providers.http.httpclient.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:298)
at
org.apache.maven.wagon.providers.http.httpclient.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)
at
org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:633)
at
org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:454)
at
org.apache.maven.wagon.providers.http.httpclient.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
at
org.apache.maven.wagon.providers.http.httpclient.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754)
at
org.apache.maven.wagon.shared.http4.AbstractHttpClientWagon.execute(AbstractHttpClientWagon.java:674)
at
org.apache.maven.wagon.shared.http4.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:793)
... 8 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
What is the problem? I think pom and other things are ok as it is example from book, so it should build.
Buried in there you'll see:
http://repo.maven.apache.org/maven2: Connection reset
You have a network problem. Maybe you're on wifi and getting interference... who knows.
Maybe it is IPv4 vs IPv6 incompatibility problem. you can try with mvn clean -Djava.net.preferIPv4Stack. if it is,you can set to MVN_OPTIONS or disable IPv6 on your network adapter.
refer from:https://coderanch.com/t/588928/java-net-SocketException-caught-connecting
I got same kind of problem - it was my anti virus who was blocked the port in behind. Disable anti-virus and or change firewall settings & it should work... :)
Exception itself has the solution check the link in last line of the exception.
[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
Check it you may have one of those.
I had the same problem - my builds were failing with "Connection Reset" messages, for all different dependencies, even though my internet connection seemed fine for other sites.
The problem went away when I upgraded Maven from version 3.0.4 to 3.2.2.
Adding a web proxy entry/declaration to Maven settings.xml as described in their documentation resolved the ERROR messages if the current system is behind a web proxy.
Hope it helps!
I had the same problem, just sharing my solution. After checking that it wasn't a network issue. The error was that I had the wrong java version configured in the moment, I had 1.7 and this project was configured to work with 1.8. After changing it back, the code was built successfully and the references downloaded.
Hope it helps someone.

Categories

Resources