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.
Related
I am building my apps with Maven-3 and i guess after auto-refresh of maven-surefire-plugin to 3.0.0-M1 i am not able to do build and getting the below error.
As a initial step, I have cleared the directory /org/apache/maven in my repository however still i am facing the issue. Can anyone advise. Note - if i am downgrading the surefire plugin to 2.x then I am able to build it.
Error log
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.444s
[INFO] Finished at: Thu Nov 08 16:04:53 GMT 2018
[INFO] Final Memory: 60M/704M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1:test (default-test) on project TEST_PROJECT: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1:test failed: Unable to load the mojo 'test' (or one of its required components) from the plugin 'org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1': com.google.inject.ProvisionException: Guice provision errors:
[ERROR]
[ERROR] 1) No implementation for org.codehaus.plexus.languages.java.jpms.LocationManager was bound.
[ERROR] while locating org.apache.maven.plugin.surefire.SurefirePlugin
[ERROR] at ClassRealm[plugin>org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1, parent: sun.misc.Launcher$AppClassLoader#5c647e05]
[ERROR] while locating org.apache.maven.plugin.Mojo annotated with #com.google.inject.name.Named(value=org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1:test)
[ERROR]
[ERROR] 1 error
[ERROR] role: org.apache.maven.plugin.Mojo
[ERROR] roleHint: org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1:test
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1:test (default-test) on project TEST_PROJECT: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1:test failed: Unable to load the mojo 'test' (or one of its required components) from the plugin 'org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1'
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
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: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: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.plugin.PluginExecutionException: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1:test failed: Unable to load the mojo 'test' (or one of its required components) from the plugin 'org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1'
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:115)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: org.apache.maven.plugin.PluginContainerException: Unable to load the mojo 'test' (or one of its required components) from the plugin 'org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1'
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:488)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:92)
... 20 more
Caused by: org.codehaus.plexus.component.repository.exception.ComponentLookupException: com.google.inject.ProvisionException: Guice provision errors:
1) No implementation for org.codehaus.plexus.languages.java.jpms.LocationManager was bound.
while locating org.apache.maven.plugin.surefire.SurefirePlugin
at ClassRealm[plugin>org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1, parent: sun.misc.Launcher$AppClassLoader#5c647e05]
while locating org.apache.maven.plugin.Mojo annotated with #com.google.inject.name.Named(value=org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1:test)
1 error
role: org.apache.maven.plugin.Mojo
roleHint: org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1:test
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:257)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:245)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo(DefaultMavenPluginManager.java:455)
... 21 more
Caused by: com.google.inject.ProvisionException: Guice provision errors:
1) No implementation for org.codehaus.plexus.languages.java.jpms.LocationManager was bound.
while locating org.apache.maven.plugin.surefire.SurefirePlugin
at ClassRealm[plugin>org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1, parent: sun.misc.Launcher$AppClassLoader#5c647e05]
while locating org.apache.maven.plugin.Mojo annotated with #com.google.inject.name.Named(value=org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M1:test)
1 error
at com.google.inject.internal.InjectorImpl$3.get(InjectorImpl.java:974)
at com.google.inject.Scopes$1$1.get(Scopes.java:59)
at org.sonatype.guice.bean.locators.LazyBeanEntry.getValue(LazyBeanEntry.java:83)
at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:49)
at org.codehaus.plexus.DefaultPlexusContainer.lookup(DefaultPlexusContainer.java:253)
... 23 more
You can upgrade your maven version to 3.6.0 latest to solve this issue. This can be compatible from 3.3.9 maven version.
Looking at the comments on upgrading maven version, we updated our maven version and was able to overcome the surefire plugin issue using maven 3.3.9. Didn't get any issues.
I found that my NetBeans was using a very old maven (3.0.5) even though I had a brand new maven installed.
On my Mac, I had to go to the menu "Netbeans/Preferences", select the "Maven" tab, and change from "Bundled", browsed to latest, and this got rid of the error above for me.
I had this problem until I discovered that we were not explicitly specifying the version of the surefire plugin. Once I changed our pom.xml file to set the version, it worked.
You can downgrade the version of maven-surefire-plugin to 2.12.4 using the pluginManagement tag. It worked for me.
If you are facing the issue in netbeans IDE you need to change default mavenhome version.follow the below steps
in menu bar tools->Options->click java tab --> under categories --> Execution --> Maven home drop down select manually installed location of the maven
I agree with SomMS's answer
But as an FYI, I found this thread, immediately dismissed that maven version could be the problem the as I just (last week) built this RHEL VM and it was new and shiny
... 15 minutes later I decided to check the maven version to find it was v3.0.5!
Hopefully the next guy doesn't make the same mistake
And if you are wondering how to get the version of whats installed try
mvn --version
I used #SomMS's suggestion and upgraded Maven in order to fix the issue. It worked.
The problem is that, at the time of this writing, the latest version of Maven available on CentOS 7 is 3.0.5 (default repository), which is really old (Feburary 2013). Most other distros have way newer Maven versions available to them.
My only solution was to do a manual download and add path to its binary in PATH env-variable. Downside here is that now rpm/yum are not aware of its existence.
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>
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
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
My configuration is :
* OS : Windows 8
* Neo4j community 2.1.6 (latest stable)
* IDE : NetBeans 8.0.2 (latest)
* java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b18)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)
I created a maven Java project and put the Hello world example provided by Neo4j guys for the appropriate version.
I added all the main dependencies (neo4j-kernel 2.1.6) and maven transitively added the remaining dependencies.
Build process is 100% OK
I still get a the following exception at runtime :
Exception in thread "main" java.lang.RuntimeException: Error starting org.neo4j.kernel.EmbeddedGraphDatabase, C:\Users\Mehdy\Documents\NetBeansProjects\neo4j-example\target\neo4j-hello-db
I looked in the stack trace and I found $EmbeddedGraphDatabase constructor is deprecated.
Here's the whole console output :
------------------------------------------------------------------------
Building neo4j-example 1.0-SNAPSHOT
------------------------------------------------------------------------
--- exec-maven-plugin:1.2.1:exec (default-cli) # neo4j-example ---
Exception in thread "main" java.lang.RuntimeException: Error starting org.neo4j.kernel.EmbeddedGraphDatabase, C:\Users\Mehdy\Documents\NetBeansProjects\neo4j-example\target\neo4j-hello-db
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:366)
at org.neo4j.kernel.EmbeddedGraphDatabase.<init>(EmbeddedGraphDatabase.java:59)
at org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:91)
at org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:181)
at org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase(GraphDatabaseFactory.java:71)
at com.lirmm.neo4j.example.Hello.createDb(Hello.java:51)
at com.lirmm.neo4j.example.Hello.main(Hello.java:41)
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.impl.transaction.XaDataSourceManager#53f65459' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:513)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:115)
at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:343)
... 6 more
Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource#4d95d2a2' was successfully initialized, but failed to start. Please see attached cause exception.
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:513)
at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:115)
at org.neo4j.kernel.impl.transaction.XaDataSourceManager.start(XaDataSourceManager.java:164)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:507)
... 8 more
Caused by: java.lang.IllegalArgumentException: No schema index provider org.neo4j.kernel.api.index.SchemaIndexProvider found. Kernel extensions available on classpath:
Class path entries:
C:\Users\Mehdy\Documents\NetBeansProjects\neo4j-example\target\classes
C:\Users\Mehdy\.m2\repository\org\neo4j\neo4j-kernel\2.1.6\neo4j-kernel-2.1.6.jar
C:\Users\Mehdy\.m2\repository\org\neo4j\neo4j-primitive-collections\2.1.6\neo4j-primitive-collections-2.1.6.jar
C:\Users\Mehdy\.m2\repository\org\apache\geronimo\specs\geronimo-jta_1.1_spec\1.1.1\geronimo-jta_1.1_spec-1.1.1.jar
at org.neo4j.kernel.api.index.SchemaIndexProvider$2.select(SchemaIndexProvider.java:140)
at org.neo4j.kernel.extension.KernelExtensions.resolveDependency(KernelExtensions.java:206)
at org.neo4j.kernel.InternalAbstractGraphDatabase$DependencyResolverImpl.resolveDependency(InternalAbstractGraphDatabase.java:1524)
at org.neo4j.kernel.impl.nioneo.xa.NeoStoreXaDataSource.start(NeoStoreXaDataSource.java:337)
at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:507)
... 11 more
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 10.883s
Finished at: Wed Dec 10 12:55:47 CET 2014
Final Memory: 5M/72M
------------------------------------------------------------------------
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project neo4j-example: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project neo4j-example: Command execution failed.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
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:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
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.plugin.MojoExecutionException: Command execution failed.
at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:362)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1)
at org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:377)
at org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:160)
at org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:610)
at org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:352)
... 21 more
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
I don't think it's a dependency problem but the use of a deprecated method. How can I get rid of this code snippet and use something compliant neo4j 2.1.6 ?
I tried different solutions found in SO, but still the same result.
What should I do to make this work ?
You're missing a dependency. Neo4j requires a schema index provider which is located in neo4j-lucene-index. Since it's an exchangeable component (you can write your own index provider) it's bundled in a separate artifact.
Amend your dependencies in pom.xml with:
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-lucene-index</artifactId>
<version>2.1.6</version>
</dependency>
If you only want to have one single dependency for all neo4j stuff in your pom.xml use:
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-community</artifactId>
<version>2.1.6</version>
</dependency>