Spring XD - Test failures - spring-xd

I took the latest copy of XD source from github and tried building local. When I run the build task, the below errors comes up. I am running Redis on port 6379. Not sure if anything else is missing.
my /etc/hosts seems to look fine in the Mac. I had to do a -x test to skip the tests. Any possible resolution? Should I be running gemfire?
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
127.0.0.1 imac
13:49:47.920 [DEBUG] [TestEventLogger]
13:49:47.920 [DEBUG] [TestEventLogger] org.springframework.integration.x.gemfire.JsonStringToObjectTransformerTests > test FAILED
13:49:47.921 [DEBUG] [TestEventLogger] java.lang.RuntimeException: java.net.UnknownHostException
13:49:47.921 [DEBUG] [TestEventLogger] at com.gemstone.gemfire.distributed.internal.direct.DirectChannel.initAddress(DirectChannel.java:902)
13:49:47.921 [DEBUG] [TestEventLogger] at com.gemstone.gemfire.distributed.internal.direct.DirectChannel.<init>(DirectChannel.java:126)
13:49:47.921 [DEBUG] [TestEventLogger] at com.gemstone.gemfire.distributed.internal.membership.jgroup.JGroupMembershipManager.<init>(JGroupMembershipManager.java:1575)
13:49:47.921 [DEBUG] [TestEventLogger] at com.gemstone.gemfire.distributed.internal.membership.jgroup.JGroupMemberFactory.newMembershipManager(JGroupMemberFactory.java:111)
13:49:47.921 [DEBUG] [TestEventLogger] at com.gemstone.gemfire.distributed.internal.membership.MemberFactory.newMembershipManager(MemberFactory.java:95)
13:49:47.921 [DEBUG] [TestEventLogger] at com.gemstone.gemfire.distributed.internal.DistributionManager.<init>(DistributionManager.java:1180)
13:49:47.921 [INFO] [system.out] 13:49:47.921 [DEBUG] [org.gradle.process.internal.child.ActionExecutionWorker] Stopping client connection.
13:49:47.921 [DEBUG] [TestEventLogger] at com.gemstone.gemfire.distributed.internal.DistributionManager.<init>(DistributionManager.java:1238)
13:49:47.921 [DEBUG] [TestEventLogger] at com.gemstone.gemfire.distributed.internal.DistributionManager.create(DistributionManager.java:613)
13:49:47.921 [DEBUG] [TestEventLogger] at com.gemstone.gemfire.distributed.internal.InternalDistributedSystem.initialize(InternalDistributedSystem.java:515)
13:49:47.921 [DEBUG] [TestEventLogger] at com.gemstone.gemfire.distributed.internal.InternalDistributedSystem.newInstance(InternalDistributedSystem.java:230)
13:49:47.922 [DEBUG] [TestEventLogger] at com.gemstone.gemfire.distributed.DistributedSystem.connect(DistributedSystem.java:1105)
13:49:47.922 [DEBUG] [TestEventLogger] at com.gemstone.gemfire.cache.CacheFactory.create(CacheFactory.java:227)
13:49:47.922 [DEBUG] [TestEventLogger] at org.springframework.integration.x.gemfire.JsonStringToObjectTransformerTests.test(JsonStringToObjectTransformerTests.java:31)
13:49:47.922 [DEBUG] [TestEventLogger] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
13:49:47.922 [DEBUG] [TestEventLogger] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
13:49:47.922 [DEBUG] [TestEventLogger] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
13:49:47.922 [DEBUG] [TestEventLogger] at java.lang.reflect.Method.invoke(Method.java:606)
13:49:47.922 [DEBUG] [TestEventLogger] at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
13:49:47.922 [DEBUG] [TestEventLogger] at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
13:49:47.922 [DEBUG] [TestEventLogger] at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
13:49:47.922 [DEBUG] [TestEventLogger] at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
13:49:47.922 [DEBUG] [TestEventLogger] at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
13:49:47.923 [DEBUG] [TestEventLogger] at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
13:49:47.923 [DEBUG] [TestEventLogger] at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
13:49:47.923 [DEBUG] [TestEventLogger] at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
13:49:47.923 [DEBUG] [TestEventLogger] at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
13:49:47.923 [DEBUG] [TestEventLogger] at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
13:49:47.923 [DEBUG] [TestEventLogger] at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
13:49:47.923 [DEBUG] [TestEventLogger] at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
13:49:47.923 [DEBUG] [TestEventLogger] at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
13:49:47.923 [DEBUG] [TestEventLogger] at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:86)
13:49:47.923 [DEBUG] [TestEventLogger] at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:49)
13:49:47.924 [DEBUG] [TestEventLogger] at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:69)
13:49:47.924 [DEBUG] [TestEventLogger] at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:48)
13:49:47.924 [DEBUG] [TestEventLogger] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
13:49:47.924 [DEBUG] [TestEventLogger] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
13:49:47.924 [DEBUG] [TestEventLogger] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
13:49:47.924 [DEBUG] [TestEventLogger] at java.lang.reflect.Method.invoke(Method.java:606)
13:49:47.924 [DEBUG] [TestEventLogger] at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
13:49:47.924 [DEBUG] [TestEventLogger] at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
13:49:47.924 [DEBUG] [TestEventLogger] at org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
13:49:47.924 [DEBUG] [TestEventLogger] at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
13:49:47.925 [DEBUG] [TestEventLogger] at com.sun.proxy.$Proxy2.processTestClass(Unknown Source)
13:49:47.925 [DEBUG] [TestEventLogger] at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:105)
13:49:47.925 [DEBUG] [TestEventLogger] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
13:49:47.925 [DEBUG] [TestEventLogger] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
13:49:47.925 [DEBUG] [TestEventLogger] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
13:49:47.925 [DEBUG] [TestEventLogger] at java.lang.reflect.Method.invoke(Method.java:606)
13:49:47.925 [DEBUG] [TestEventLogger] at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
13:49:47.925 [DEBUG] [TestEventLogger] at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
13:49:47.925 [DEBUG] [TestEventLogger] at org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:355)
13:49:47.925 [DEBUG] [TestEventLogger] at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:64)
13:49:47.925 [DEBUG] [TestEventLogger] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
13:49:47.925 [DEBUG] [TestEventLogger] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
13:49:47.926 [DEBUG] [TestEventLogger] at java.lang.Thread.run(Thread.java:745)
13:49:47.926 [DEBUG] [TestEventLogger]
13:49:47.926 [DEBUG] [TestEventLogger] Caused by:
13:49:47.926 [DEBUG] [TestEventLogger] java.net.UnknownHostException
13:49:47.926 [DEBUG] [TestEventLogger] at com.gemstone.gemfire.internal.SocketCreator.getLocalHost(SocketCreator.java:312)
13:49:47.926 [DEBUG] [TestEventLogger] at com.gemstone.gemfire.distributed.internal.direct.DirectChannel.initAddress(DirectChannel.java:898)
13:49:47.926 [DEBUG] [TestEventLogger] ... 54 more
13:49:47.928 [DEBUG] [TestEventLogger]
13:49:47.928 [DEBUG] [TestEventLogger] org.springframework.integration.x.gemfire.JsonStringToObjectTransformerTests FAILED
13:49:47.928 [DEBUG] [TestEventLogger]
13:49:47.928 [DEBUG] [TestEventLogger] Gradle Test Executor 6 FAILED

A weird one. I agree, your /etc/hosts looks good. I have seen this on Linux boxes that sometimes use 127.0.1.1 instead of 127.0.0.1. The test simply starts a cache with
new CacheFactory().create(); If you are a GemFire user, you might want to check if you have any gemfire.properties or cache.xml files lying around in your home directory, current directory, or classpath. GemFire is notorious for finding those.

Agreed, your /etc/hosts file appears to be fine (though, I would format it so each host entry is on a single line).
Seems you might running GemFire 7?
Also, what Java vendor/version are you running on your Mac (Apple or Oracle JDK/JRE and version)?
Your version of Mac OS X maybe a factor(???), especially if you have disabled networking (i.e. no "active" NIC, connected with a valid IP, as determined by ifconfig), though this is less than clear.
In a nutshell, GemFire attempts to resolve/lookup the actual IP address of the local system (using GemFire's internal SocketCreator class) when the loopback address is only IP specified (as in your /etc/hosts file), or as returned by InetAddress.getLocalHost().
This resolution process is rather involved and is unfortunately contained within a "static initializer" block inside the SocketCreator class, when the class is loaded.
It seems unlikely that InetAddress.getLocalHost() would ever return null, but in this case the reason why the UnknownHostException in GemFire was thrown was because the SocketCreator.localHost class member variable was null...
310: public static InetAddress getLocalHost() throws UnknownHostException {
311: if (localHost == null) {
312: throw new UnknownHostException();
313: }
314: return localHost;
315: }
The "SocketCreator.localHost" static member variable is initialized inside the static initializer block.
So, either the static initializer was not called or InetAddress.getLocalHost() (possibly because networking was disabled?) returned null, though looking through GemFire's code that would have led to a NullPointerException (that I am uncertain whether might have gotten swallowed somewhere), so it seems more along the lines of the former, but neither answer seems likely, really.
One possible workaround (as it avoided this IP resolution step on startup of GemFire's Membership, as is seen in the stack trace) would be to modify the Spring XD test class, JsonStringToObjectTransformerTests, on line 31, to be...
31: new CacheFactory().set("mcast-port", "0").set("log-level", "warning").create();
This avoided the SocketCreator.getLocalHost() call from DirectChannel.initAddress(DirectChannel.java:898).
Also, setting the log-level to warn reduces the GemFire noise and significantly speeds up the test.
Hope this helps.

Related

Maven 401 unauthorized when deploying on archiva

I'm getting a "401 unauthorized" error from Apache Archiva repository when I try to deploy from a Maven build.
When using Maven 3.1.1 or lower it's working fine, I can deploy snapshots or releases on the Archiva repo. As soon as i'm using Maven 3.2.1 or greater, it's not working anymore. By looking at the release notes I could not figure out what could cause that.
Downloading from the repo is fine
Uploading on the repo results in 401 unauthorized
The users are declared in the settings.xml file in the .m2 folder
No proxy settings
Here is the debug trace of the deploy that's failing :
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) # Xplugin ---
[DEBUG] Dependency collection stats: {ConflictMarker.analyzeTime=0, ConflictMarker.markTime=0, ConflictMarker.nodeCount=32, ConflictIdSorter.graphTime=0, ConflictIdSorter.topsortTime=0, ConflictIdSorter.conflictIdCount=14, ConflictIdSorter.conflictIdCycleCount=0, ConflictResolver.totalTime=0, ConflictResolver.conflictItemCount=32, DefaultDependencyCollector.collectTime=3, DefaultDependencyCollector.transformTime=0}
[DEBUG] org.apache.maven.plugins:maven-deploy-plugin:jar:2.7:
[DEBUG] org.apache.maven:maven-plugin-api:jar:2.0.6:compile
[DEBUG] org.apache.maven:maven-project:jar:2.0.6:compile
[DEBUG] org.apache.maven:maven-settings:jar:2.0.6:compile
[DEBUG] org.apache.maven:maven-profile:jar:2.0.6:compile
[DEBUG] org.apache.maven:maven-artifact-manager:jar:2.0.6:compile
[DEBUG] org.apache.maven:maven-repository-metadata:jar:2.0.6:compile
[DEBUG] org.apache.maven:maven-plugin-registry:jar:2.0.6:compile
[DEBUG] org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile
[DEBUG] junit:junit:jar:3.8.1:compile
[DEBUG] classworlds:classworlds:jar:1.1-alpha-2:compile
[DEBUG] org.apache.maven:maven-model:jar:2.0.6:compile
[DEBUG] org.apache.maven:maven-artifact:jar:2.0.6:compile
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.5.6:compile
[DEBUG] Created new class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.7
[DEBUG] Importing foreign packages into class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.7
[DEBUG] Imported: < maven.api
[DEBUG] Populating class realm plugin>org.apache.maven.plugins:maven-deploy-plugin:2.7
[DEBUG] Included: org.apache.maven.plugins:maven-deploy-plugin:jar:2.7
[DEBUG] Included: junit:junit:jar:3.8.1
[DEBUG] Included: org.codehaus.plexus:plexus-utils:jar:1.5.6
[DEBUG] Excluded: org.apache.maven:maven-plugin-api:jar:2.0.6
[DEBUG] Excluded: org.apache.maven:maven-project:jar:2.0.6
[DEBUG] Excluded: org.apache.maven:maven-settings:jar:2.0.6
[DEBUG] Excluded: org.apache.maven:maven-profile:jar:2.0.6
[DEBUG] Excluded: org.apache.maven:maven-artifact-manager:jar:2.0.6
[DEBUG] Excluded: org.apache.maven:maven-repository-metadata:jar:2.0.6
[DEBUG] Excluded: org.apache.maven:maven-plugin-registry:jar:2.0.6
[DEBUG] Excluded: org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1
[DEBUG] Excluded: classworlds:classworlds:jar:1.1-alpha-2
[DEBUG] Excluded: org.apache.maven:maven-model:jar:2.0.6
[DEBUG] Excluded: org.apache.maven:maven-artifact:jar:2.0.6
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-deploy-plugin:2.7, parent: sun.misc.Launcher$AppClassLoader#55f96302]
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy' with basic configurator -->
[DEBUG] (f) artifact = com.application.pdfplugins:Xplugin:jar:3.1.0-00-SNAPSHOT
[DEBUG] (f) attachedArtifacts = []
[DEBUG] (s) localRepository = id: local
url: file:///C:/Users/bamboo/.m2/repository/
layout: default
snapshots: [enabled => true, update => always]
releases: [enabled => true, update => always]
[DEBUG] (f) offline = false
[DEBUG] (f) packaging = jar
[DEBUG] (f) pomFile = C:bamboo\xml-data\build-dir\26771457\PDFPLUGINS-XAS4-JOB1\Xplugin\dependency-reduced-pom.xml
[DEBUG] (f) project = MavenProject: com.application.pdfplugins:Xplugin:3.1.0-00-SNAPSHOT # C:bamboo\xml-data\build-dir\26771457\PFPLUGIN-X-JOB1\Xplugin\dependency-reduced-pom.xml
[DEBUG] (f) retryFailedDeploymentCount = 1
[DEBUG] (f) skip = false
[DEBUG] (f) updateReleaseInfo = false
[DEBUG] -- end configuration --
[DEBUG] Using transporter WagonTransporter with priority -1.0 for https://maven-dev.org/repository/built-artifacts/
[DEBUG] Using connector BasicRepositoryConnector with priority 0.0 for https://maven-dev.org/repository/built-artifacts/ with username=writer, password=***
[INFO] Downloading: https://maven-dev.org/repository/built-artifacts/com/application/pdfplugins/Xplugin/3.1.0-00-SNAPSHOT/maven-metadata.xml
[INFO] Downloaded: https://maven-dev.org/repository/built-artifacts/com/application/pdfplugins/Xplugin/3.1.0-00-SNAPSHOT/maven-metadata.xml (390 B at 11.5 KB/sec)
[DEBUG] Writing tracking file C:\Users\bamboo\.m2\repository\com\application\pdfplugins\Xplugin\3.1.0-00-SNAPSHOT\resolver-status.properties
[INFO] Uploading: https://maven-dev.org/repository/built-artifacts/com/application/pdfplugins/Xplugin/3.1.0-00-SNAPSHOT/Xplugin-3.1.0-00-20180604.152136-4.jar
[INFO] Uploading: https://maven-dev.org/repository/built-artifacts/com/application/pdfplugins/Xplugin/3.1.0-00-SNAPSHOT/Xplugin-3.1.0-00-20180604.152136-4.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 02:06 min
[INFO] Finished at: 2018-06-04T17:21:36+02:00
[INFO] Final Memory: 39M/592M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project Xplugin: Failed to deploy artifacts: Could not transfer artifact com.application.pdfplugins:Xplugin:jar:3.1.0-00-20180604.152136-4 from/to built-artifacts (https://maven-dev.org/repository/built-artifacts/): Failed to transfer file: https://maven-dev.org/repository/built-artifacts/com/application/pdfplugins/Xplugin/3.1.0-00-SNAPSHOT/Xplugin-3.1.0-00-20180604.152136-4.jar. Return code is: 401, ReasonPhrase: Unauthorized. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project Xplugin: Failed to deploy artifacts: Could not transfer artifact com.application.pdfplugins:Xplugin:jar:3.1.0-00-20180604.152136-4 from/to built-artifacts (https://maven-dev.org/repository/built-artifacts/): Failed to transfer file: https://maven-dev.org/repository/built-artifacts/com/application/pdfplugins/Xplugin/3.1.0-00-SNAPSHOT/Xplugin-3.1.0-00-20180604.152136-4.jar. Return code is: 401, ReasonPhrase: Unauthorized.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to deploy artifacts: Could not transfer artifact com.application.pdfplugins:Xplugin:jar:3.1.0-00-20180604.152136-4 from/to built-artifacts (https://maven-dev.org/repository/built-artifacts/): Failed to transfer file: https://maven-dev.org/repository/built-artifacts/com/application/pdfplugins/Xplugin/3.1.0-00-SNAPSHOT/Xplugin-3.1.0-00-20180604.152136-4.jar. Return code is: 401, ReasonPhrase: Unauthorized.
at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:193)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to deploy artifacts: Could not transfer artifact com.application.pdfplugins:Xplugin:jar:3.1.0-00-20180604.152136-4 from/to built-artifacts (https://maven-dev.org/repository/built-artifacts/): Failed to transfer file: https://maven-dev.org/repository/built-artifacts/com/application/pdfplugins/Xplugin/3.1.0-00-SNAPSHOT/Xplugin-3.1.0-00-20180604.152136-4.jar. Return code is: 401, ReasonPhrase: Unauthorized.
at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:143)
at org.apache.maven.plugin.deploy.AbstractDeployMojo.deploy(AbstractDeployMojo.java:167)
at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:157)
... 21 more
Caused by: org.eclipse.aether.deployment.DeploymentException: Failed to deploy artifacts: Could not transfer artifact com.application.pdfplugins:Xplugin:jar:3.1.0-00-20180604.152136-4 from/to built-artifacts (https://maven-dev.org/repository/built-artifacts/): Failed to transfer file: https://maven-dev.org/repository/built-artifacts/com/application/pdfplugins/Xplugin/3.1.0-00-SNAPSHOT/Xplugin-3.1.0-00-20180604.152136-4.jar. Return code is: 401, ReasonPhrase: Unauthorized.
at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:317)
at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:245)
at org.eclipse.aether.internal.impl.DefaultRepositorySystem.deploy(DefaultRepositorySystem.java:413)
at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:139)
... 23 more
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact com.application.pdfplugins:Xplugin:jar:3.1.0-00-20180604.152136-4 from/to built-artifacts (https://maven-dev.org/repository/built-artifacts/): Failed to transfer file: https://maven-dev.org/repository/built-artifacts/com/application/pdfplugins/Xplugin/3.1.0-00-SNAPSHOT/Xplugin-3.1.0-00-20180604.152136-4.jar. Return code is: 401, ReasonPhrase: Unauthorized.
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.connector.basic.BasicRepositoryConnector.put(BasicRepositoryConnector.java:274)
at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:311)
... 26 more
Caused by: org.apache.maven.wagon.TransferFailedException: Failed to transfer file: https://maven-dev.org/repository/built-artifacts/com/application/pdfplugins/Xplugin/3.1.0-00-SNAPSHOT/Xplugin-3.1.0-00-20180604.152136-4.jar. Return code is: 401, ReasonPhrase: Unauthorized.
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:642)
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:557)
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:539)
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:533)
at org.apache.maven.wagon.providers.http.AbstractHttpClientWagon.put(AbstractHttpClientWagon.java:513)
at org.eclipse.aether.transport.wagon.WagonTransporter$PutTaskRunner.run(WagonTransporter.java:644)
at org.eclipse.aether.transport.wagon.WagonTransporter.execute(WagonTransporter.java:427)
at org.eclipse.aether.transport.wagon.WagonTransporter.put(WagonTransporter.java:410)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$PutTaskRunner.runTask(BasicRepositoryConnector.java:510)
at org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:350)
... 28 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/MojoExecutionException
Failing task since return code of [C:\Maven_3.2.5\bin\mvn.bat --batch-mode -Djava.io.tmpdir=D:\Apps\Bamboo\temp\PDFPLUGINS-XAS4-JOB1 -e -Xclean package deploy -DskipTests=true] was 1 while expected 0
As you can see the username and password are correctly retrieved by maven (username=writer, password=***) but I get the 401 anyway.
The only difference that I could see between Maven 3.1.1 and 3.2.1 is that the first is using "WagonRepositoryConnector" and the second is using "BasicRepositoryConnector"
I searched for the differences between the two or how could I force Wagonrepositoryconnector but did no find relevant information.
Does somebody have an idea of what could prevent version 3.2.1 and greater to deploy the artifacts? it looks like the credentials are messed up with the newer versions of Maven.
EDIT 1
After further debug i was able to understand that the faulty component was "wagon-http" which is upgraded to v 2.6 in Maven 3.2.1.
Specifying the wagon-http to use in the pom.xml is the only workaround I could find for the moment :
in the pom.xml inside the build section i added :
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-http</artifactId>
<version>2.5</version>
</extension>
</extensions>
It's the last version working.
In the Wagon 2.6 release note there is "Upgrade Apache HttpClient based wagon provider to HttpClient 4.3". I suspect that the problem lies here so I tried a few things :
I disabled all the SSL security (even if there were no SSL error message but you never know it can be wrapped in a 401 unauthorized with no further explanation) but it still failed.
I disabled the authentication on my repository and I was able to upload the artifact
This last statement makes me think that the authentication is mishandled by the httpclient 4.3 (or maybe another component of wagon-http).
I don't understand what could cause this, if somebody has something to try I'll be glad to test it.

maven-dependency-plugin:2.8:copy - can't find artifact

I am trying to download an artifact from a Nexus server on Ubuntu 14.04, but maven can't find it:
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.8:copy (default-cli) on project standalone-pom: Unable to find artifact.
On my local OS X machine, it works just fine and downloads the expected artifacts:
mvn org.apache.maven.plugins:maven-dependency-plugin:2.8:copy -X -Dartifact=com.myserver.myapp:myapp-backend:LATEST -DoutputDirectory=./ -Dmdep.useBaseVersion=true
Which outputs the following
Apache Maven 3.0.5
Maven home: /usr/share/maven
Java version: 1.8.0_151, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-oracle/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.4.0-31-generic", arch: "amd64", family: "unix"
[INFO] Error stacktraces are turned on.
[DEBUG] Reading global settings from /usr/share/maven/conf/settings.xml
[DEBUG] Reading user settings from /root/.m2/settings.xml
[DEBUG] Using local repository at /root/.m2/repository
[DEBUG] Using manager EnhancedLocalRepositoryManager with priority 10 for /root/.m2/repository
[INFO] Scanning for projects...
[DEBUG] Extension realms for project org.apache.maven:standalone-pom:pom:1: (none)
[DEBUG] Looking up lifecyle mappings for packaging pom from ClassRealm[plexus.core, parent: null]
[DEBUG] Using mirror nexus (https://test.myserver.com:8443/repository/maven-public) for apache.snapshots (http://repository.apache.org/snapshots).
[DEBUG] === REACTOR BUILD PLAN ================================================
[DEBUG] Project: org.apache.maven:standalone-pom:pom:1
[DEBUG] Tasks: [org.apache.maven.plugins:maven-dependency-plugin:2.8:copy]
[DEBUG] Style: Aggregating
[DEBUG] =======================================================================
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[DEBUG] Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]
[DEBUG] Lifecycle clean -> [pre-clean, clean, post-clean]
[DEBUG] Lifecycle site -> [pre-site, site, post-site, site-deploy]
[DEBUG] === PROJECT BUILD PLAN ================================================
[DEBUG] Project: org.apache.maven:standalone-pom:1
[DEBUG] Dependencies (collect): []
[DEBUG] Dependencies (resolve): []
[DEBUG] Repositories (dependencies): [nexus (https://test.myserver.com:8443/repository/maven-public, releases)]
[DEBUG] Repositories (plugins) : [nexus (https://test.myserver.com:8443/repository/maven-public, releases)]
[DEBUG] -----------------------------------------------------------------------
[DEBUG] Goal: org.apache.maven.plugins:maven-dependency-plugin:2.8:copy (default-cli)
[DEBUG] Style: Regular
[DEBUG] Configuration: <?xml version="1.0" encoding="UTF-8"?>
<configuration>
<artifact>${artifact}</artifact>
<local default-value="${localRepository}"/>
<outputAbsoluteArtifactFilename default-value="false">${outputAbsoluteArtifactFilename}</outputAbsoluteArtifactFilename>
<outputDirectory default-value="${project.build.directory}/dependency">${outputDirectory}</outputDirectory>
<overWriteIfNewer default-value="true">${mdep.overIfNewer}</overWriteIfNewer>
<overWriteReleases default-value="false">${mdep.overWriteReleases}</overWriteReleases>
<overWriteSnapshots default-value="false">${mdep.overWriteSnapshots}</overWriteSnapshots>
<prependGroupId default-value="false">${mdep.prependGroupId}</prependGroupId>
<reactorProjects default-value="${reactorProjects}"/>
<remoteRepos default-value="${project.remoteArtifactRepositories}"/>
<silent default-value="false">${silent}</silent>
<skip default-value="false">${mdep.skip}</skip>
<stripClassifier default-value="false">${mdep.stripClassifier}</stripClassifier>
<stripVersion default-value="false">${mdep.stripVersion}</stripVersion>
<useBaseVersion default-value="false">${mdep.useBaseVersion}</useBaseVersion>
<project default-value="${project}"/>
</configuration>
[DEBUG] =======================================================================
[INFO]
[INFO] --- maven-dependency-plugin:2.8:copy (default-cli) # standalone-pom ---
[DEBUG] Created new class realm maven.api
[DEBUG] Importing foreign packages into class realm maven.api
... some imports ...
[DEBUG] org.apache.maven.plugins:maven-dependency-plugin:jar:2.8:
[DEBUG] org.apache.maven:maven-artifact:jar:2.0.9:compile
[DEBUG] org.apache.maven:maven-plugin-api:jar:2.0.9:compile
[DEBUG] org.apache.maven:maven-project:jar:2.0.9:compile
[DEBUG] org.apache.maven:maven-settings:jar:2.0.9:compile
[DEBUG] org.apache.maven:maven-profile:jar:2.0.9:compile
[DEBUG] org.apache.maven:maven-plugin-registry:jar:2.0.9:compile
[DEBUG] org.apache.maven:maven-model:jar:2.0.9:compile
[DEBUG] org.apache.maven:maven-core:jar:2.0.9:compile
[DEBUG] org.apache.maven:maven-plugin-parameter-documenter:jar:2.0.9:compile
[DEBUG] org.apache.maven:maven-error-diagnostics:jar:2.0.9:compile
[DEBUG] commons-cli:commons-cli:jar:1.0:compile
[DEBUG] org.apache.maven:maven-plugin-descriptor:jar:2.0.9:compile
[DEBUG] org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-4:compile
[DEBUG] org.apache.maven:maven-monitor:jar:2.0.9:compile
[DEBUG] org.apache.maven:maven-artifact-manager:jar:2.0.9:compile
[DEBUG] org.apache.maven:maven-repository-metadata:jar:2.0.9:compile
[DEBUG] org.apache.maven.reporting:maven-reporting-api:jar:3.0:compile
[DEBUG] org.apache.maven.reporting:maven-reporting-impl:jar:2.0.5:compile
[DEBUG] org.apache.maven.doxia:doxia-core:jar:1.0:compile
[DEBUG] org.apache.maven.shared:maven-doxia-tools:jar:1.0.2:compile
[DEBUG] commons-io:commons-io:jar:1.4:compile
[DEBUG] commons-validator:commons-validator:jar:1.2.0:compile
[DEBUG] commons-beanutils:commons-beanutils:jar:1.7.0:compile
[DEBUG] commons-digester:commons-digester:jar:1.6:compile
[DEBUG] commons-logging:commons-logging:jar:1.0.4:compile
[DEBUG] oro:oro:jar:2.0.8:compile
[DEBUG] xml-apis:xml-apis:jar:1.0.b2:compile
[DEBUG] org.apache.maven.doxia:doxia-sink-api:jar:1.0:compile
[DEBUG] org.apache.maven.doxia:doxia-site-renderer:jar:1.0:compile
[DEBUG] org.codehaus.plexus:plexus-i18n:jar:1.0-beta-7:compile
[DEBUG] org.codehaus.plexus:plexus-velocity:jar:1.1.7:compile
[DEBUG] org.apache.velocity:velocity:jar:1.5:compile
[DEBUG] org.apache.maven.doxia:doxia-decoration-model:jar:1.0:compile
[DEBUG] org.apache.maven.doxia:doxia-module-apt:jar:1.0:compile
[DEBUG] org.apache.maven.doxia:doxia-module-fml:jar:1.0:compile
[DEBUG] org.apache.maven.doxia:doxia-module-xdoc:jar:1.0:compile
[DEBUG] org.apache.maven.doxia:doxia-module-xhtml:jar:1.0:compile
[DEBUG] org.codehaus.plexus:plexus-archiver:jar:2.3:compile
[DEBUG] org.codehaus.plexus:plexus-utils:jar:3.0.9:compile
[DEBUG] org.apache.maven.shared:file-management:jar:1.2.1:compile
[DEBUG] org.apache.maven.shared:maven-shared-io:jar:1.1:compile
[DEBUG] org.apache.maven.wagon:wagon-provider-api:jar:1.0-alpha-6:compile
[DEBUG] org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile
[DEBUG] junit:junit:jar:3.8.1:compile
[DEBUG] org.codehaus.plexus:plexus-io:jar:2.0.6:compile
[DEBUG] org.apache.maven.shared:maven-dependency-analyzer:jar:1.4:compile
[DEBUG] asm:asm:jar:3.3.1:compile
[DEBUG] org.codehaus.plexus:plexus-component-annotations:jar:1.5.5:compile
[DEBUG] org.apache.maven.shared:maven-dependency-tree:jar:2.1:compile
[DEBUG] org.eclipse.aether:aether-util:jar:0.9.0.M2:compile
[DEBUG] org.apache.maven.shared:maven-common-artifact-filters:jar:1.4:compile
[DEBUG] org.apache.maven.shared:maven-invoker:jar:2.0.11:compile
[DEBUG] commons-lang:commons-lang:jar:2.6:compile
[DEBUG] commons-collections:commons-collections:jar:3.2.1:compile
[DEBUG] classworlds:classworlds:jar:1.1:compile
[DEBUG] Created new class realm plugin>org.apache.maven.plugins:maven-dependency-plugin:2.8
[DEBUG] Importing foreign packages into class realm plugin>org.apache.maven.plugins:maven-dependency-plugin:2.8
[DEBUG] Imported: < maven.api
[DEBUG] Populating class realm plugin>org.apache.maven.plugins:maven-dependency-plugin:2.8
[DEBUG] Included: org.apache.maven.plugins:maven-dependency-plugin:jar:2.8
[DEBUG] Included: commons-cli:commons-cli:jar:1.0
[DEBUG] Included: org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-4
[DEBUG] Included: org.apache.maven.reporting:maven-reporting-api:jar:3.0
[DEBUG] Included: org.apache.maven.reporting:maven-reporting-impl:jar:2.0.5
[DEBUG] Included: org.apache.maven.doxia:doxia-core:jar:1.0
[DEBUG] Included: org.apache.maven.shared:maven-doxia-tools:jar:1.0.2
[DEBUG] Included: commons-io:commons-io:jar:1.4
[DEBUG] Included: commons-validator:commons-validator:jar:1.2.0
[DEBUG] Included: commons-beanutils:commons-beanutils:jar:1.7.0
[DEBUG] Included: commons-digester:commons-digester:jar:1.6
[DEBUG] Included: commons-logging:commons-logging:jar:1.0.4
[DEBUG] Included: oro:oro:jar:2.0.8
[DEBUG] Included: xml-apis:xml-apis:jar:1.0.b2
[DEBUG] Included: org.apache.maven.doxia:doxia-sink-api:jar:1.0
[DEBUG] Included: org.apache.maven.doxia:doxia-site-renderer:jar:1.0
[DEBUG] Included: org.codehaus.plexus:plexus-i18n:jar:1.0-beta-7
[DEBUG] Included: org.codehaus.plexus:plexus-velocity:jar:1.1.7
[DEBUG] Included: org.apache.velocity:velocity:jar:1.5
[DEBUG] Included: org.apache.maven.doxia:doxia-decoration-model:jar:1.0
[DEBUG] Included: org.apache.maven.doxia:doxia-module-apt:jar:1.0
[DEBUG] Included: org.apache.maven.doxia:doxia-module-fml:jar:1.0
[DEBUG] Included: org.apache.maven.doxia:doxia-module-xdoc:jar:1.0
[DEBUG] Included: org.apache.maven.doxia:doxia-module-xhtml:jar:1.0
[DEBUG] Included: org.codehaus.plexus:plexus-archiver:jar:2.3
[DEBUG] Included: org.codehaus.plexus:plexus-utils:jar:3.0.9
[DEBUG] Included: org.apache.maven.shared:file-management:jar:1.2.1
[DEBUG] Included: org.apache.maven.shared:maven-shared-io:jar:1.1
[DEBUG] Included: junit:junit:jar:3.8.1
[DEBUG] Included: org.codehaus.plexus:plexus-io:jar:2.0.6
[DEBUG] Included: org.apache.maven.shared:maven-dependency-analyzer:jar:1.4
[DEBUG] Included: asm:asm:jar:3.3.1
[DEBUG] Included: org.codehaus.plexus:plexus-component-annotations:jar:1.5.5
[DEBUG] Included: org.apache.maven.shared:maven-dependency-tree:jar:2.1
[DEBUG] Included: org.eclipse.aether:aether-util:jar:0.9.0.M2
[DEBUG] Included: org.apache.maven.shared:maven-common-artifact-filters:jar:1.4
[DEBUG] Included: org.apache.maven.shared:maven-invoker:jar:2.0.11
[DEBUG] Included: commons-lang:commons-lang:jar:2.6
[DEBUG] Included: commons-collections:commons-collections:jar:3.2.1
[DEBUG] Excluded: org.apache.maven:maven-artifact:jar:2.0.9
[DEBUG] Excluded: org.apache.maven:maven-plugin-api:jar:2.0.9
[DEBUG] Excluded: org.apache.maven:maven-project:jar:2.0.9
[DEBUG] Excluded: org.apache.maven:maven-settings:jar:2.0.9
[DEBUG] Excluded: org.apache.maven:maven-profile:jar:2.0.9
[DEBUG] Excluded: org.apache.maven:maven-plugin-registry:jar:2.0.9
[DEBUG] Excluded: org.apache.maven:maven-model:jar:2.0.9
[DEBUG] Excluded: org.apache.maven:maven-core:jar:2.0.9
[DEBUG] Excluded: org.apache.maven:maven-plugin-parameter-documenter:jar:2.0.9
[DEBUG] Excluded: org.apache.maven:maven-error-diagnostics:jar:2.0.9
[DEBUG] Excluded: org.apache.maven:maven-plugin-descriptor:jar:2.0.9
[DEBUG] Excluded: org.apache.maven:maven-monitor:jar:2.0.9
[DEBUG] Excluded: org.apache.maven:maven-artifact-manager:jar:2.0.9
[DEBUG] Excluded: org.apache.maven:maven-repository-metadata:jar:2.0.9
[DEBUG] Excluded: org.apache.maven.wagon:wagon-provider-api:jar:1.0-alpha-6
[DEBUG] Excluded: org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1
[DEBUG] Excluded: classworlds:classworlds:jar:1.1
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-dependency-plugin:2.8:copy from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-dependency-plugin:2.8, parent: sun.misc.Launcher$AppClassLoader#5c647e05]
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-dependency-plugin:2.8:copy' with basic configurator -->
[DEBUG] (s) artifact = ch.myserver.myapp:myapp-backend:LATEST
[DEBUG] (s) local = id: local
url: file:///root/.m2/repository/
layout: none
[DEBUG] (f) outputAbsoluteArtifactFilename = false
[DEBUG] (s) outputDirectory = /home/nino
[DEBUG] (s) overWriteIfNewer = true
[DEBUG] (s) overWriteReleases = false
[DEBUG] (s) overWriteSnapshots = false
[DEBUG] (f) prependGroupId = false
[DEBUG] (f) reactorProjects = [MavenProject: org.apache.maven:standalone-pom:1 # ]
[DEBUG] (s) remoteRepos = [ id: nexus
url: https://test.myserver.com:8443/repository/maven-public
layout: default
snapshots: [enabled => false, update => daily]
releases: [enabled => true, update => daily]
]
[DEBUG] (f) silent = false
[DEBUG] (s) skip = false
[DEBUG] (s) stripClassifier = false
[DEBUG] (s) stripVersion = false
[DEBUG] (s) useBaseVersion = true
[DEBUG] (f) project = MavenProject: org.apache.maven:standalone-pom:1 #
[DEBUG] -- end configuration --
[INFO] Configured Artifact: ch.myserver.myapp:myapp-backend:LATEST:jar
[DEBUG] Could not find metadata ch.myserver.myapp:myapp-backend/maven-metadata.xml in local (/root/.m2/repository)
[DEBUG] Skipped remote update check for ch.myserver.myapp:myapp-backend/maven-metadata.xml, locally cached metadata up-to-date.
[DEBUG] Could not find metadata ch.myserver.myapp:myapp-backend:1.0-SNAPSHOT/maven-metadata.xml in local (/root/.m2/repository)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.090s
[INFO] Finished at: Wed Nov 15 10:01:44 CET 2017
[INFO] Final Memory: 9M/118M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.8:copy (default-cli) on project standalone-pom: Unable to find artifact. Could not find artifact ch.myserver.myapp:myapp-backend:jar:LATEST
[ERROR]
[ERROR] Try downloading the file manually from the project website.
[ERROR]
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=ch.myserver.myapp -DartifactId=myapp-backend -Dversion=LATEST -Dpackaging=jar -Dfile=/path/to/file
[ERROR]
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=ch.myserver.myapp -DartifactId=myapp-backend -Dversion=LATEST -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR]
[ERROR]
[ERROR] ch.myserver.myapp:myapp-backend:jar:LATEST
[ERROR]
[ERROR] from the specified remote repositories:
[ERROR] nexus (https://test.myserver.com:8443/repository/maven-public, releases=true, snapshots=false)
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.8:copy (default-cli) on project standalone-pom: Unable to find artifact.
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:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Unable to find artifact.
at org.apache.maven.plugin.dependency.fromConfiguration.AbstractFromConfigurationMojo.getArtifact(AbstractFromConfigurationMojo.java:265)
at org.apache.maven.plugin.dependency.fromConfiguration.AbstractFromConfigurationMojo.getProcessedArtifactItems(AbstractFromConfigurationMojo.java:171)
at org.apache.maven.plugin.dependency.fromConfiguration.CopyMojo.doExecute(CopyMojo.java:105)
at org.apache.maven.plugin.dependency.AbstractDependencyMojo.execute(AbstractDependencyMojo.java:167)
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.maven.artifact.resolver.ArtifactNotFoundException: Could not find artifact ch.myserver.myapp:myapp-backend:jar:LATEST
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=ch.myserver.myapp -DartifactId=myapp-backend -Dversion=LATEST -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=ch.myserver.myapp -DartifactId=myapp-backend -Dversion=LATEST -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
ch.myserver.myapp:myapp-backend:jar:LATEST
from the specified remote repositories:
nexus (https://test.myserver.com:8443/repository/maven-public, releases=true, snapshots=false)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:219)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:157)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:525)
at org.apache.maven.plugin.dependency.fromConfiguration.AbstractFromConfigurationMojo.getArtifact(AbstractFromConfigurationMojo.java:257)
... 24 more
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Could not find artifact ch.myserver.myapp:myapp-backend:jar:LATEST
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.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:193)
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:286)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:213)
... 27 more
Caused by: org.sonatype.aether.transfer.ArtifactNotFoundException: Could not find artifact ch.myserver.myapp:myapp-backend:jar:LATEST
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:528)
... 31 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/MojoExecutionException
My settings.xml in /root/.m2/:
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>snapshots</id>
<username>myusername</username>
<password>mypassword</password>
</server>
<server>
<id>releases</id>
<username>myusername</username>
<password>mypassword</password>
</server>
</servers>
<mirrors>
<mirror>
<id>nexus</id>
<url>https://test.myserver.com:8443/repository/maven-public</url>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>
</settings>
I also tried to specify the exact version instead of LATEST, but that does not work either.
Am I missing some files or configurations, or what may the problem be here?
I found a solution. I needed to pass -U:
-U,--update-snapshots Forces a check for missing
releases and updated snapshots on
remote repositories
So:
mvn org.apache.maven.plugins:maven-dependency-plugin:2.8:copy -X -U -Dartifact=com.myserver.myapp:myapp-backend:LATEST -DoutputDirectory=./ -Dmdep.useBaseVersion=true

mvn clean failure hold by windows process

How to know which windows processes are holding the folders while doing "mvn clean" results in failure ?
I suspect some unknown process are holding my "target" folder, which is stopping me to proceed further
Is there any way to find that unknown process ?
[DEBUG] Configuring mojo org.apache.maven.plugins:maven-clean-plugin:2.5:clean from plugin realm ClassRealm[plugin>org.apache.maven.plugins:maven-clean-plugin:2.5, parent: sun.misc.Launcher$AppClassLoader#2d4b1fda]
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-clean-plugin:2.5:clean' with basic configurator -->
[DEBUG] (f) directory = C:\RafiWork\TASK\French\Sprint2\pdm_sonartool\quality-manager\target
[DEBUG] (f) excludeDefaultDirectories = false
[DEBUG] (f) failOnError = true
[DEBUG] (f) followSymLinks = false
[DEBUG] (f) outputDirectory = C:\RafiWork\TASK\French\Sprint2\pdm_sonartool\quality-manager\target\classes
[DEBUG] (f) reportDirectory = C:\RafiWork\TASK\French\Sprint2\pdm_sonartool\quality-manager\target\site
[DEBUG] (f) retryOnError = true
[DEBUG] (f) skip = false
[DEBUG] (f) testOutputDirectory = C:\RafiWork\TASK\French\Sprint2\pdm_sonartool\quality-manager\target\test-classes
[DEBUG] -- end configuration --
[INFO] Deleting C:\RafiWork\TASK\French\Sprint2\pdm_sonartool\quality-manager\target
[INFO] Deleting directory C:\RafiWork\TASK\French\Sprint2\pdm_sonartool\quality-manager\target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 26.290 s
[INFO] Finished at: 2017-08-21T15:16:16+05:30
[INFO] Final Memory: 14M/124M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean) on project quality-manager: Failed to clean project: Failed to delete C:\RafiWork\TASK\French\Sprint2\pdm_sonartool\quality-manager\target -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:2.5:clean (default-clean) on project quality-manager: Failed to clean project: Failed to delete C:\RafiWork\TASK\French\Sprint2\pdm_sonartool\quality-manager\target
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:347)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:154)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:582)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:214)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:158)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: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.apache.maven.plugin.MojoExecutionException: Failed to clean project: Failed to delete C:\RafiWork\TASK\French\Sprint2\pdm_sonartool\quality-manager\target
at org.apache.maven.plugin.clean.CleanMojo.execute(CleanMojo.java:215)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: java.io.IOException: Failed to delete C:\RafiWork\TASK\French\Sprint2\pdm_sonartool\quality-manager\target
at org.apache.maven.plugin.clean.Cleaner.delete(Cleaner.java:249)
at org.apache.maven.plugin.clean.Cleaner.delete(Cleaner.java:191)
at org.apache.maven.plugin.clean.Cleaner.delete(Cleaner.java:117)
at org.apache.maven.plugin.clean.CleanMojo.execute(CleanMojo.java:193)
I tend to get this when I've left a debugger running or the project running on a local webserver. Sometimes it can go a bit funny and hang around even when you think you've stopped it.
When that happens I usually tend to just go to task manager and kill any java processes running on my machine and it usually fixes it.
Use Handle, from Mark Russinovitch, Sysinternals (now Microsoft):
https://learn.microsoft.com/en-us/sysinternals/downloads/handle
This will help you find the offender (it's often your own Java process, or Explorer.exe, or even your CMD.EXE from where you're running Maven).

Reduce 'configuring the compilation environment' time for Kotlin with Maven

During compilation using maven, when Kotlin is running it gets stuck on '[DEBUG] Configuring the compilation environment' for a good 20-30 seconds out of 40 seconds compilation time.
Is there a way to minimise this time?
[INFO] Kotlin Compiler version 1.0.6-release-127
[INFO] Compiling Kotlin sources from [/Users/jacksenkline/Desktop/api/src/main/java]
[DEBUG] Classpath: /Users/jacksenkline/Desktop/api/target/api-0.1.0-SNAPSHOT/WEB-INF/classes:/Users/jacksenkline/.m2/repository/com/google/appengine/appengine-api-1.0-sdk/1.9.48/appengine-api-1.0-sdk-1.9.48.jar:/Users/jacksenkline/.m2/repository/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar:/Users/jacksenkline/.m2/repository/jstl/jstl/1.2/jstl-1.2.jar:/Users/jacksenkline/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib/1.0.6/kotlin-stdlib-1.0.6.jar:/Users/jacksenkline/.m2/repository/org/jetbrains/kotlin/kotlin-runtime/1.0.6/kotlin-runtime-1.0.6.jar:/Users/jacksenkline/.m2/repository/org/json/json/20160810/json-20160810.jar:/Users/jacksenkline/.m2/repository/redis/clients/jedis/2.9.0/jedis-2.9.0.jar:/Users/jacksenkline/.m2/repository/org/apache/commons/commons-pool2/2.4.2/commons-pool2-2.4.2.jar:/Users/jacksenkline/.m2/repository/io/jsonwebtoken/jjwt/0.7.0/jjwt-0.7.0.jar:/Users/jacksenkline/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.8.2/jackson-databind-2.8.2.jar:/Users/jacksenkline/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.8.0/jackson-annotations-2.8.0.jar:/Users/jacksenkline/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.8.2/jackson-core-2.8.2.jar
[DEBUG] Classes directory is /Users/jacksenkline/Desktop/api/target/api-0.1.0-SNAPSHOT/WEB-INF/classes
[INFO] Module name is api
[DEBUG] Invoking compiler org.jetbrains.kotlin.cli.jvm.K2JVMCompiler#f48d6f2 with arguments:
[DEBUG] destination=/Users/jacksenkline/Desktop/api/target/api-0.1.0-SNAPSHOT/WEB-INF/classes
[DEBUG] classpath=/Users/jacksenkline/Desktop/api/target/api-0.1.0-SNAPSHOT/WEB-INF/classes:/Users/jacksenkline/.m2/repository/com/google/appengine/appengine-api-1.0-sdk/1.9.48/appengine-api-1.0-sdk-1.9.48.jar:/Users/jacksenkline/.m2/repository/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar:/Users/jacksenkline/.m2/repository/jstl/jstl/1.2/jstl-1.2.jar:/Users/jacksenkline/.m2/repository/org/jetbrains/kotlin/kotlin-stdlib/1.0.6/kotlin-stdlib-1.0.6.jar:/Users/jacksenkline/.m2/repository/org/jetbrains/kotlin/kotlin-runtime/1.0.6/kotlin-runtime-1.0.6.jar:/Users/jacksenkline/.m2/repository/org/json/json/20160810/json-20160810.jar:/Users/jacksenkline/.m2/repository/redis/clients/jedis/2.9.0/jedis-2.9.0.jar:/Users/jacksenkline/.m2/repository/org/apache/commons/commons-pool2/2.4.2/commons-pool2-2.4.2.jar:/Users/jacksenkline/.m2/repository/io/jsonwebtoken/jjwt/0.7.0/jjwt-0.7.0.jar:/Users/jacksenkline/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.8.2/jackson-databind-2.8.2.jar:/Users/jacksenkline/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.8.0/jackson-annotations-2.8.0.jar:/Users/jacksenkline/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.8.2/jackson-core-2.8.2.jar
[DEBUG] includeRuntime=false
[DEBUG] jdkHome=(null)
[DEBUG] noJdk=false
[DEBUG] noStdlib=true
[DEBUG] noReflect=false
[DEBUG] module=(null)
[DEBUG] script=false
[DEBUG] kotlinHome=(null)
[DEBUG] moduleName=api
[DEBUG] jvmTarget=(null)
[DEBUG] noCallAssertions=false
[DEBUG] noParamAssertions=false
[DEBUG] noOptimize=false
[DEBUG] reportPerf=false
[DEBUG] inheritMultifileParts=false
[DEBUG] allowKotlinPackage=false
[DEBUG] skipMetadataVersionCheck=false
[DEBUG] skipRuntimeVersionCheck=false
[DEBUG] declarationsOutputPath=(null)
[DEBUG] friendPaths=(null)
[DEBUG] PLUGIN_OPTION_FORMAT=plugin:<pluginId>:<optionName>=<value>
[DEBUG] languageVersion=(null)
[DEBUG] apiVersion=(null)
[DEBUG] suppressWarnings=false
[DEBUG] verbose=true
[DEBUG] version=false
[DEBUG] help=false
[DEBUG] extraHelp=false
[DEBUG] noInline=false
[DEBUG] repeat=(null)
[DEBUG] pluginClasspaths=(null)
[DEBUG] pluginOptions=(null)
[DEBUG] freeArgs=[/Users/jacksenkline/Desktop/api/src/main/java]
[DEBUG] unknownExtraFlags=[]
[DEBUG] End of arguments
[DEBUG] Using Kotlin home directory <no_path>
[DEBUG] Configuring the compilation environment
The message is misleading, it just happens to be the last message printed by the compiler before the actual compilation. So it's the compilation itself that takes the majority of time.

How to remove entry from the GWT SDK execution classpath

I am trying to upgrade my application from version 2.6.1 to 2.7 and I am getting follwoing exception executing goal org.codehaus.mojo:gwt-maven-plugin:2.7.0:compile (default) on my project:
[INFO] Compiling module cern.edms.ui.Application
[INFO] [ERROR] Unexpected internal compiler error
[INFO] java.lang.IllegalArgumentException
[INFO] at org.objectweb.asm.ClassVisitor.<init>(Unknown Source)
[INFO] at org.objectweb.asm.ClassVisitor.<init>(Unknown Source)
[INFO] at com.google.gwt.dev.javac.BytecodeSignatureMaker$CompileDependencyVisitor.<init>(BytecodeSignatureMaker.java:59)
[INFO] at com.google.gwt.dev.javac.BytecodeSignatureMaker.visitCompileDependenciesInBytecode(BytecodeSignatureMaker.java:227)
I found information that it could be because of the wrong version of the ASM in my classpath (Strange error during running GWT 2.7 in DevMode), therefore I've check it. And indeed in my classpath there is two version of ASM:4.2 and 5.0.3. It is because one of the dependency has dependency on cglib which has dependency on ASM 4.2. GWT has dependency on ASM 5.0.3.
Here is my full classpath:
[DEBUG] GWT SDK execution classpath :
[DEBUG] C:\dev\Workspace\EDMS-APP\20151015_java7_gwt27\trunk\edms-ui\target\edms-ui-6.1.0-SNAPSHOT\WEB-INF\classes
[DEBUG] C:\dev\Workspace\EDMS-APP\20151015_java7_gwt27\trunk\edms-ui\src\main\java
[DEBUG] C:\dev\Workspace\EDMS-APP\20151015_java7_gwt27\trunk\edms-ui\target\generated-sources\gwt
[DEBUG] C:\dev\Workspace\EDMS-APP\20151015_java7_gwt27\trunk\edms-ui\target\generated-sources\gwt\**
[DEBUG] C:\dev\Workspace\EDMS-APP\20151015_java7_gwt27\trunk\edms-procedures\target\edms-procedures-6.1.0-SNAPSHOT.jar
[DEBUG] C:\Users\kpater\.m2\repository\com\oracle\ojdbc6\11.2.0.3.0\ojdbc6-11.2.0.3.0.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\springframework\spring-context\4.0.9.RELEASE\spring-context-4.0.9.RELEASE.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\springframework\spring-expression\4.0.9.RELEASE\spring-expression-4.0.9.RELEASE.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\springframework\spring-core\4.0.9.RELEASE\spring-core-4.0.9.RELEASE.jar
[DEBUG] C:\Users\kpater\.m2\repository\commons-logging\commons-logging\1.1.3\commons-logging-1.1.3.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\springframework\spring-jdbc\4.0.9.RELEASE\spring-jdbc-4.0.9.RELEASE.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\springframework\spring-tx\4.0.9.RELEASE\spring-tx-4.0.9.RELEASE.jar
[DEBUG] C:\Users\kpater\.m2\repository\com\sun\mail\javax.mail\1.5.4\javax.mail-1.5.4.jar
[DEBUG] C:\Users\kpater\.m2\repository\javax\activation\activation\1.1\activation-1.1.jar
[DEBUG] C:\Users\kpater\.m2\repository\commons-dbcp\commons-dbcp\1.4\commons-dbcp-1.4.jar
[DEBUG] C:\Users\kpater\.m2\repository\commons-pool\commons-pool\1.5.4\commons-pool-1.5.4.jar
[DEBUG] C:\Users\kpater\.m2\repository\commons-lang\commons-lang\2.6\commons-lang-2.6.jar
[DEBUG] C:\Users\kpater\.m2\repository\javax\validation\validation-api\1.0.0.GA\validation-api-1.0.0.GA.jar
[DEBUG] C:\dev\Workspace\EDMS-APP\20151015_java7_gwt27\trunk\edms-shared\target\edms-shared.jar
[DEBUG] C:\dev\Workspace\EDMS-APP\20151015_java7_gwt27\trunk\edms-search\target\edms-search.jar
[DEBUG] C:\Users\kpater\.m2\repository\cglib\cglib\3.1\cglib-3.1.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\ow2\asm\asm\4.2\asm-4.2.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\springframework\ws\spring-ws-core\2.1.4.RELEASE\spring-ws-core-2.1.4.RELEASE.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\springframework\ws\spring-xml\2.1.4.RELEASE\spring-xml-2.1.4.RELEASE.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\springframework\spring-oxm\3.2.4.RELEASE\spring-oxm-3.2.4.RELEASE.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\springframework\spring-webmvc\3.2.4.RELEASE\spring-webmvc-3.2.4.RELEASE.jar
[DEBUG] C:\Users\kpater\.m2\repository\wsdl4j\wsdl4j\1.6.1\wsdl4j-1.6.1.jar
[DEBUG] C:\Users\kpater\.m2\repository\javax\xml\stream\stax-api\1.0-2\stax-api-1.0-2.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\apache\httpcomponents\httpclient\4.3.1\httpclient-4.3.1.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\apache\httpcomponents\httpcore\4.3\httpcore-4.3.jar
[DEBUG] C:\Users\kpater\.m2\repository\commons-codec\commons-codec\1.6\commons-codec-1.6.jar
[DEBUG] C:\Users\kpater\.m2\repository\commons-io\commons-io\1.4\commons-io-1.4.jar
[DEBUG] C:\Users\kpater\.m2\repository\weblogic\wls-api\12.1.1\wls-api-12.1.1.jar
[DEBUG] C:\Users\kpater\.m2\repository\ch\cern\sso\wlsAttributeNameMapper\1.9\wlsAttributeNameMapper-1.9.jar
[DEBUG] C:\Users\kpater\.m2\repository\com\google\gwt\gwt-user\2.7.0\gwt-user-2.7.0.jar
[DEBUG] C:\Users\kpater\.m2\repository\javax\validation\validation-api\1.0.0.GA\validation-api-1.0.0.GA-sources.jar
[DEBUG] C:\Users\kpater\.m2\repository\com\google\web\bindery\requestfactory-server\2.7.0\requestfactory-server-2.7.0.jar
[DEBUG] C:\Users\kpater\.m2\repository\com\extjs\gxt\2.3.1a-gwt22\gxt-2.3.1a-gwt22.jar
[DEBUG] C:\Users\kpater\.m2\repository\com\sencha\gxt\gxt\3.1.4\gxt-3.1.4.jar
[DEBUG] C:\Users\kpater\.m2\repository\com\googlecode\mvp4g\mvp4g\1.4.0\mvp4g-1.4.0.jar
[DEBUG] C:\Users\kpater\.m2\repository\com\google\gwt\inject\gin\1.5.0\gin-1.5.0.jar
[DEBUG] C:\Users\kpater\.m2\repository\com\google\inject\guice\3.0-rc2\guice-3.0-rc2.jar
[DEBUG] C:\Users\kpater\.m2\repository\javax\inject\javax.inject\1\javax.inject-1.jar
[DEBUG] C:\Users\kpater\.m2\repository\com\google\inject\extensions\guice-assistedinject\3.0-rc2\guice-assistedinject-3.0-rc2.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\springframework\spring-web\4.0.9.RELEASE\spring-web-4.0.9.RELEASE.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\springframework\spring-beans\4.0.9.RELEASE\spring-beans-4.0.9.RELEASE.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\springframework\spring-aop\4.0.9.RELEASE\spring-aop-4.0.9.RELEASE.jar
[DEBUG] C:\Users\kpater\.m2\repository\aopalliance\aopalliance\1.0\aopalliance-1.0.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\aspectj\aspectjrt\1.8.2\aspectjrt-1.8.2.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\aspectj\aspectjweaver\1.8.2\aspectjweaver-1.8.2.jar
[DEBUG] C:\Users\kpater\.m2\repository\javax\persistence\persistence-api\1.0\persistence-api-1.0.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\springframework\spring-aspects\4.0.9.RELEASE\spring-aspects-4.0.9.RELEASE.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\hibernate\hibernate-validator\4.1.0.Final\hibernate-validator-4.1.0.Final.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\hibernate\hibernate-validator\4.1.0.Final\hibernate-validator-4.1.0.Final-sources.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\slf4j\slf4j-log4j12\1.6.1\slf4j-log4j12-1.6.1.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\slf4j\slf4j-api\1.6.1\slf4j-api-1.6.1.jar
[DEBUG] C:\Users\kpater\.m2\repository\log4j\log4j\1.2.17\log4j-1.2.17.jar
[DEBUG] C:\Users\kpater\.m2\repository\com\google\guava\guava\14.0.1\guava-14.0.1.jar
[DEBUG] C:\Users\kpater\.m2\repository\com\google\gwt\gwtmockito\gwtmockito\1.1.5\gwtmockito-1.1.5.jar
[DEBUG] C:\Users\kpater\.m2\repository\com\google\gwt\gwt-dev\2.7.0\gwt-dev-2.7.0.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\ow2\asm\asm-util\5.0.3\asm-util-5.0.3.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\ow2\asm\asm-tree\5.0.3\asm-tree-5.0.3.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\ow2\asm\asm-commons\5.0.3\asm-commons-5.0.3.jar
[DEBUG] C:\Users\kpater\.m2\repository\org\javassist\javassist\3.17.1-GA\javassist-3.17.1-GA.jar
How can I exclude ASM in version 4.2 from the classpath?
Thank you for your help!
Ideally you'd just split your project into separate modules for client and server code so you avoid classpath conflicts like this one. You can draw inspiration from those archetypes: https://github.com/tbroyer/gwt-maven-archetypes
However, given that ASM 4+ guarantees backward compatibility, you could also just use ASM 5 instead of ASM 4:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-parent</artifactId>
<version>5.0.3</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
I've finally managed to build the project by excluding the ASM in cglib dependency. Here is my code:
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>3.1</version>
<exclusions>
<exclusion>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
</exclusion>
</exclusions>
</dependency>
Assuming gwt-maven-plugin documentation, you can set the runClasspathExclude property to exclude jars from the classPath when running dev mode (and only in DEV mode) :
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<configuration>
<runClasspathExcludes>
<runClasspathExclude>jetty-webapp-9.2.4.v20141103.jar</runClasspathExclude>
<runClasspathExclude>jetty-xml-9.2.4.v20141103.jar</runClasspathExclude>
<runClasspathExclude>jetty-util-9.2.4.v20141103.jar</runClasspathExclude>
<runClasspathExclude>jetty-servlet-9.2.4.v20141103.jar</runClasspathExclude>
<runClasspathExclude>jetty-security-9.2.4.v20141103.jar</runClasspathExclude>
</runClasspathExcludes>
</configuration>
</plugin>
Note that this configuration is used by the "run" goal only : mvn gwt:run

Resources