unexpected end of stream exception when deploying to nexus - maven

I need to deploy a snapshot jar to a remote nexus repository (Nexus OSS 3.7.1-02).
The server and repositories details are added in settings.xml and distributionManagement added in pom.xml.
The deployment works fine on a nexus repository on localhost. But on the remote repository, only the pom, md5 and sha1 are deployed and the jar deployment fails with the error "unexpected end of stream". Appreciate any help to solve this.
nexus repository screenshot
The full stacktrace is as below:
Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project api-core: Failed to deploy artifacts: Could not transfer artifact com.proj.api:api-core:jar:0.0.1-20180103.144552-1 from/to proj-repository (http://<nexus_url>/nexus/repository/proj-snapshots): unexpected end of stream -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project api-core: Failed to deploy artifacts: Could not transfer artifact com.proj.api:api-core:jar:0.0.1-20180103.144552-1 from/to proj-repository (http://<nexus_url>/nexus/repository/proj-snapshots): unexpected end of stream
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
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.plugin.MojoExecutionException: Failed to deploy artifacts: Could not transfer artifact com.proj.api:api-core:jar:0.0.1-20180103.144552-1 from/to proj-repository (http://<nexus_url>/nexus/repository/proj-snapshots): unexpected end of stream
at org.apache.maven.plugin.deploy.DeployMojo.deployProject(DeployMojo.java:284)
at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:169)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 20 more
Caused by: org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to deploy artifacts: Could not transfer artifact com.proj.api:api-core:jar:0.0.1-20180103.144552-1 from/to proj-repository (http://<nexus_url>/nexus/repository/proj-snapshots): unexpected end of stream
at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:143)
at org.apache.maven.plugin.deploy.AbstractDeployMojo.deploy(AbstractDeployMojo.java:171)
at org.apache.maven.plugin.deploy.DeployMojo.deployProject(DeployMojo.java:250)
... 23 more
Caused by: org.eclipse.aether.deployment.DeploymentException: Failed to deploy artifacts: Could not transfer artifact com.proj.api:api-core:jar:0.0.1-20180103.144552-1 from/to proj-repository (http://<nexus_url>/nexus/repository/proj-snapshots): unexpected end of stream
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)
... 25 more
Caused by: org.eclipse.aether.transfer.ArtifactTransferException: Could not transfer artifact com.proj.api:api-core:jar:0.0.1-20180103.144552-1 from/to proj-repository (http://<nexus_url>/nexus/repository/proj-snapshots): unexpected end of stream
at io.takari.aether.connector.AetherRepositoryConnector$2.wrap(AetherRepositoryConnector.java:895)
at io.takari.aether.connector.AetherRepositoryConnector$2.wrap(AetherRepositoryConnector.java:1)
at io.takari.aether.connector.AetherRepositoryConnector$PutTask.flush(AetherRepositoryConnector.java:743)
at io.takari.aether.connector.AetherRepositoryConnector.put(AetherRepositoryConnector.java:345)
at org.eclipse.aether.internal.impl.DefaultDeployer.deploy(DefaultDeployer.java:311)
... 28 more
Caused by: java.net.ProtocolException: unexpected end of stream
at com.squareup.okhttp.internal.http.HttpConnection$FixedLengthSink.close(HttpConnection.java:314)
at okio.RealBufferedSink.close(RealBufferedSink.java:241)
at okio.RealBufferedSink$1.close(RealBufferedSink.java:209)
at com.google.common.io.Closer.close(Closer.java:214)
at io.takari.aether.connector.AetherRepositoryConnector$FileSource.copyTo(AetherRepositoryConnector.java:147)
at io.takari.aether.okhttp.OkHttpAetherClient$2.writeTo(OkHttpAetherClient.java:141)
at com.squareup.okhttp.internal.http.HttpEngine$NetworkInterceptorChain.proceed(HttpEngine.java:887)
at com.squareup.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:749)
at com.squareup.okhttp.Call.getResponse(Call.java:268)
at com.squareup.okhttp.Call$ApplicationInterceptorChain.proceed(Call.java:224)
at com.squareup.okhttp.Call.getResponseWithInterceptorChain(Call.java:195)
at com.squareup.okhttp.Call.execute(Call.java:79)
at io.takari.aether.okhttp.OkHttpAetherClient.execute(OkHttpAetherClient.java:167)
at io.takari.aether.okhttp.OkHttpAetherClient.put(OkHttpAetherClient.java:161)
at io.takari.aether.connector.AetherRepositoryConnector$PutTask.run(AetherRepositoryConnector.java:715)
at io.takari.aether.connector.AetherRepositoryConnector.put(AetherRepositoryConnector.java:332)
... 29 more

Thankyou khmarbaise for the pointers.
Turned out the nexus had a proxy in front which was limiting the size of jars that could be uploaded.
This is a spring boot applicaiton creating a fat jar. Hence it was failing.
Obviously, I didnt face the issue when i was running a locally hosted nexus and was unable to decipher this from the exception stack trace.
The issue is resovled now, after changing the size limits in the proxy.

Related

Maven job build on Jenkins giving error "Failed to execute default deploy goal"

I am trying to run a Maven job on jenkins and move the artifacts to Jfrog artifactory. The build fails with the below error.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project MyAppMaster: Execution default-deploy of goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy failed. NullPointerException -> [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 MyAppMaster: Execution default-deploy of goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy failed.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
at org.jvnet.hudson.maven3.launcher.Maven35Launcher.main(Maven35Launcher.java:130)
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 jenkins.maven3.agent.Maven35Main.launch(Maven35Main.java:176)
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 hudson.maven.Maven3Builder.call(Maven3Builder.java:139)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:70)
at hudson.remoting.UserRequest.perform(UserRequest.java:212)
at hudson.remoting.UserRequest.perform(UserRequest.java:54)
at hudson.remoting.Request$2.run(Request.java:369)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-deploy of goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy failed.
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 31 more
Caused by: java.lang.NullPointerException
at org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:178)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
... 32 more
I have mofified the 'server' and 'repository' tags in pom.xml and the artifacts are also successfully pushed to artifactory. But the build fails with this error.
Can someone please guide me what might be going wrong ? There was no build failure before Jfrog artifactory integration.
Goal:
-pl "MyApp-portlet" -am clean install -U deploy -e
With jfrog, you do not have to mention deploy in goals. Making an entry into distributionManagement tag in pom.xml is enough.
I removed deploy and the job built successfully and artifacts moved as expected.
Goal Options (Jenkins): -pl "MyApp-portlet" -am clean install -U

setup a Maven Wrapper for my project with io.takari

I want to setup the Maven Wrapper (The Maven Wrapper is an easy way to ensure a user of your Maven build has everything necessary to run your Maven build) for my project.
I will use the Takari Maven Plugin with its provided wrapper goal.
I execute the following command:
mvn -N io.takari:maven:wrapper
But I got this error
[ERROR] Failed to execute goal io.takari:maven:0.4.1:wrapper (default-cli) on project standalone-pom: Error installing the maven-wrapper archive. Cannot determine the type of archive C:\Users\carbonell\.m2\repository\io\takari\maven-wrapper\0.2.1\maven-wrapper-0.2.1.tar.gz. Input is not in the .gz for
mat -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.takari:maven:0.4.1:wrapper (default-cli) on project standalone-pom: Error installing the maven-wrapper archive.
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: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.apache.maven.plugin.MojoExecutionException: Error installing the maven-wrapper archive.
at io.takari.maven.plugins.WrapperMojo.execute(WrapperMojo.java:67)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 20 more
Caused by: java.lang.RuntimeException: Cannot determine the type of archive C:\Users\carbonell\.m2\repository\io\takari\maven-wrapper\0.2.1\maven-wrapper-0.2.1.tar.gz.
at io.tesla.proviso.archive.tar.TarGzArchiveSource.<init>(TarGzArchiveSource.java:29)
at io.tesla.proviso.archive.tar.TarGzArchiveHandler.getArchiveSource(TarGzArchiveHandler.java:44)
at io.tesla.proviso.archive.UnArchiver.unarchive(UnArchiver.java:54)
at io.tesla.proviso.archive.UnArchiver.unarchive(UnArchiver.java:44)
at io.takari.maven.plugins.WrapperMojo.execute(WrapperMojo.java:60)
... 22 more
Caused by: java.io.IOException: Input is not in the .gz format
at org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream.init(GzipCompressorInputStream.java:164)
at org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream.<init>(GzipCompressorInputStream.java:137)
at org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream.<init>(GzipCompressorInputStream.java:102)
at io.tesla.proviso.archive.tar.TarGzArchiveHandler.getInputStream(TarGzArchiveHandler.java:34)
at io.tesla.proviso.archive.tar.TarGzArchiveSource.<init>(TarGzArchiveSource.java:27)
... 26 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/MojoExecutionException
Answering this for posterity.
I got this on my second attempt to run this goal.
The first attempt failed with "Unsupported or unrecognized SSL message" because Maven couldn't get through my company proxy. I don't know why or how it was bypassing our internal repository configured in settings.xml. This left me with an empty gzip file at the location specified in that error message.
The second attempt produced the same error you received because the gzip file was empty.
I had to cheat a little and configure Maven via MAVEN_OPTS to use the proxy in order to download all of the necessary artifacts.

sonar maven goal with sonarqube jenkins plugin - ERROR SCM provider was set to "git" but no SCM provider found for this key

I've followed these instructions: http://docs.sonarqube.org/display/PLUG/Triggering+SonarQube+on+Jenkins+Job#TriggeringSonarQubeonJenkinsJob-TriggeringaProjectAnalysiswithMaven
SonarQube: 5.1.1,
Jenkins SonarQube Plugin: 2.2.1
my maven goals for the base project are
clean compiler:compile
When I build my project I get this error from the sonar post build task:
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project onu-main: SCM provider was set to "git" but no SCM provider found for this key. No SCM provider installed -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project onu-main: SCM provider was set to "git" but no SCM provider found for this key. No SCM provider installed
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: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.apache.maven.plugin.MojoExecutionException: SCM provider was set to "git" but no SCM provider found for this key. No SCM provider installed
at org.codehaus.mojo.sonar.bootstrap.ExceptionHandling.handle(ExceptionHandling.java:41)
at org.codehaus.mojo.sonar.bootstrap.RunnerBootstraper.execute(RunnerBootstraper.java:139)
at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:132)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
Call Sonar with maven parameter: -Dsonar.scm.disabled=true
You can install the Git-plugin on your SonarQube-Server or remove the developerConnection-tag from your POMs, both will fix the issue (tested with SQ 5.1.1)

"Peer Not Authenticated" in maven when trying to run a job in JENKINS

When I try running a maven job in Jenkins, the build is not successful.
The error message in the console displays the following :
[INFO] ------------------------------------------------------------------------
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven- resources-plugin/2.5/maven-resources-plugin-2.5.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.640s
[INFO] Finished at: Tue Aug 20 11:21:36 EST 2013
[INFO] Final Memory: 6M/16M
[INFO] ------------------------------------------------------------------------
mavenExecutionResult exceptions not empty
message : Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5
cause : Failed to read artifact descriptor for org.apache.maven.plugins:maven- resources-plugin:jar:2.5
Stack trace :
org.apache.maven.plugin.PluginResolutionException: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:129)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getPluginDescriptor(DefaultMavenPluginManager.java:142)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getMojoDescriptor(DefaultMavenPluginManager.java:261)
at org.apache.maven.plugin.DefaultBuildPluginManager.getMojoDescriptor(DefaultBuildPluginManager.java:185)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecution(DefaultLifecycleExecutionPlanCalculator.java:152)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.setupMojoExecutions(DefaultLifecycleExecutionPlanCalculator.java:139)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.java:116)
at org.apache.maven.lifecycle.internal.DefaultLifecycleExecutionPlanCalculator.calculateExecutionPlan(DefaultLifecycleExecutionPlanCalculator.java:129)
at org.apache.maven.lifecycle.internal.BuilderCommon.resolveBuildPlan(BuilderCommon.java:92)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
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.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:79)
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.launchStandard(Launcher.java:329)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239)
at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:158)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:100)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:66)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:326)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: org.sonatype.aether.resolution.ArtifactDescriptorException: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:296)
at org.apache.maven.repository.internal.DefaultArtifactDescriptorReader.readArtifactDescriptor(DefaultArtifactDescriptorReader.java:186)
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.readArtifactDescriptor(DefaultRepositorySystem.java:279)
at org.apache.maven.plugin.internal.DefaultPluginDependenciesResolver.resolve(DefaultPluginDependenciesResolver.java:115)
... 33 more
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.5 from/to central (http://repo.maven.apache.org/maven2): peer not authenticated
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.apache.maven.repository.internal.DefaultArtifactDescriptorReader.loadPom(DefaultArtifactDescriptorReader.java:281)
... 36 more
Caused by: org.sonatype.aether.transfer.ArtifactTransferException: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.5 from/to central (http://repo.maven.apache.org/maven2): peer not authenticated
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:951)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(WagonRepositoryConnector.java:941)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.run(WagonRepositoryConnector.java:669)
at org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:60)
... 3 more
Caused by: org.apache.maven.wagon.TransferFailedException: peer not authenticated
at org.apache.maven.wagon.shared.http4.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:892)
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: javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
at sun.security.ssl.SSLSessionImpl.getPeerCertificates(SSLSessionImpl.java:397)
at org.apache.maven.wagon.providers.http.httpclient.conn.ssl.AbstractVerifier.verify(AbstractVerifier.java:126)
at org.apache.maven.wagon.providers.http.httpclient.conn.ssl.SSLSocketFactory.createLayeredSocket(SSLSocketFactory.java:628)
at org.apache.maven.wagon.shared.http4.ConfigurableSSLSocketFactoryDecorator.createLayeredSocket(ConfigurableSSLSocketFactoryDecorator.java:57)
at org.apache.maven.wagon.providers.http.httpclient.impl.conn.DefaultClientConnectionOperator.updateSecureConnection(DefaultClientConnectionOperator.java:232)
at org.apache.maven.wagon.providers.http.httpclient.impl.conn.ManagedClientConnectionImpl.layerProtocol(ManagedClientConnectionImpl.java:401)
at org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultRequestDirector.establishRoute(DefaultRequestDirector.java:842)
at org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:649)
at org.apache.maven.wagon.providers.http.httpclient.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:480)
at org.apache.maven.wagon.providers.http.httpclient.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
at org.apache.maven.wagon.providers.http.httpclient.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
at org.apache.maven.wagon.shared.http4.AbstractHttpClientWagon.execute(AbstractHttpClientWagon.java:746)
at org.apache.maven.wagon.shared.http4.AbstractHttpClientWagon.fillInputData(AbstractHttpClientWagon.java:886)
... 8 more
channel stopped
Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook
Picked up _JAVA_OPTIONS: -Xrunjvmhook - Xbootclasspath/a:C:\PROGRA~1\HP\QUICKT~1\bin\JAVA_S~1\classes;C:\PROGRA~1\HP\QUICKT~1\bin\J AVA_S~1\classes\jasmine.jar
Finished: FAILURE
I'm able to get to know the root cause of the error is some authentication issue("peer not authenticated"). But not able to get it resolved as I am not aware what authetication I need to key in and where to key in.
Additional details : I am using Maven 3.0.3 and JDK 1.7
Thanks in advance for your time in helping me resolving the issue. Let me know if you need any additional info.
Thanks
When using SSL to connect to maven repositories you'll need to make sure that the certificates for the repository are trusted by the JVM running maven. Refer to the Guide to Remote repository access through authenticated HTTPS.
Also, as mentioned by rec in an answer to maven release -> peer not authenticated, with newer versions of maven you can disable the certificate validation of the maven http wagon temporarily to confirm if the certificate is indeed the source of the problem:
-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true
Solution 4 “Peer Not Authenticated” while adding maven "jitpack.io" in app's gradle.build.
Simple solution is install java 8 if you have lower version.
We tried with Oracle java8 and it works. :)
Note : Tried a lot of solutions those are on stackoverflow.com but none of them work for me.
Assuming you have set Java Home - JAVA_HOME env variable and using it to run maven;
Pre-req is that you have exported the .cer certificate (via browser ex)
cd %JAVA_HOME%\jre\lib\security
%JAVA_HOME%\jre\bin\keytool -v -alias mavensrvNewCer -import -file d:\pathtoexportedcertificate.cer -keystore trust.jks
set MAVEN_OPTS=-Xmx512m -Djavax.net.ssl.trustStore=%JAVA_HOME%/jre/lib/security/trust.jks -Djavax.net.ssl.trustStorePassword=changeit -Djavax.net.ssl.keyStore=%JAVA_HOME%/jre/lib/security/trust.jks -Djavax.net.ssl.keyStoreType=jks -Djavax.net.ssl.keyStorePassword=changeit
mvn install

How do I fix a "Unexpected end of ZLIB input stream" with the Maven shade plugin?

When running the Maven Shade plugin, I get the following error. How can I debug this?
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:2.0:shade (make-shade) on project csprocessor-client: Error creating shaded jar: Unexpected end of ZLIB input stream -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:2.0:shade (make-shade) on project csprocessor-client: Error creating shaded jar: Unexpected end of ZLIB input stream
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:319)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:534)
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:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
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: Error creating shaded jar: Unexpected end of ZLIB input stream
at org.apache.maven.plugins.shade.mojo.ShadeMojo.execute(ShadeMojo.java:551)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:107)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: java.io.EOFException: Unexpected end of ZLIB input stream
at java.util.zip.ZipFile$ZipFileInflaterInputStream.fill(ZipFile.java:411)
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
at java.io.FilterInputStream.read(FilterInputStream.java:107)
at org.codehaus.plexus.util.IOUtil.copy(IOUtil.java:188)
at org.codehaus.plexus.util.IOUtil.copy(IOUtil.java:174)
at org.apache.maven.plugins.shade.DefaultShader.addRemappedClass(DefaultShader.java:259)
at org.apache.maven.plugins.shade.DefaultShader.shade(DefaultShader.java:151)
at org.apache.maven.plugins.shade.mojo.ShadeMojo.execute(ShadeMojo.java:484)
... 21 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
It turns out that with the m2eclipse plugin, you can actually debug a maven plugin as it is executing. To do this you need to what code you want to step into, which you can do by setting the Debug Output option in the Maven Run Configuration. You'll also need to set the Resolve Workspace artifacts option.
With these two options I could click the file location listed in the error (ZipFile.java:411 in this case), set a break point, and use Debug As > Maven Build to run the Maven build in debug mode. Once the breakpoint was hit I could tell which file was causing the error, and repackage it using the JAR command. Even though the JAR file in question could be opened with a GUI archive tool, once repackaged with the JAR command I could successfully run the Maven Shade plgin.
FYI, if this was caused by a JAR that was corrupted during download, a quick way of forcing a re-download is to run mvn dependency:purge-local-repository in the shading project. This removes all dependencies (direct and transitive) of the project from the local Maven repository and downloads them anew.

Resources