maven nexus-staging-maven-plugin exception-connect timed out

不知道是國內的網絡的問題仍是別的緣由,在deploy一個maven的artifact到oss server的時候老是報錯:java

Failed to execute goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.7:deploy (injected-nexus-deploy) on project becauseQA-utils: Remote staging failed: Failed to deploy artifacts: Could not transfer artifact com.github.becauseQA:becauseQA-utils:jar:sources:1.0.1 from/to nexus (https://oss.sonatype.org:443/service/local/staging/deployByRepositoryId/comgithubbecauseqa-1023): connect timed out -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.sonatype.plugins:nexus-staging-maven-plugin:1.6.7:deploy (injected-nexus-deploy) on project becauseQA-utils: Remote staging failed: Failed to deploy artifacts: Could not transfer artifact com.github.becauseQA:becauseQA-utils:jar:sources:1.0.1 from/to nexus (https://oss.sonatype.org:443/service/local/staging/deployByRepositoryId/comgithubbecauseqa-1023): connect timed out
	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: Remote staging failed: Failed to deploy artifacts: Could not transfer artifact com.github.becauseQA:becauseQA-utils:jar:sources:1.0.1 from/to nexus (https://oss.sonatype.org:443/service/local/staging/deployByRepositoryId/comgithubbecauseqa-1023): connect timed out
	at org.sonatype.nexus.maven.staging.deploy.DeployMojo.execute(DeployMojo.java:216)
	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: Remote staging failed: Failed to deploy artifacts: Could not transfer artifact com.github.becauseQA:becauseQA-utils:jar:sources:1.0.1 from/to nexus (https://oss.sonatype.org:443/service/local/staging/deployByRepositoryId/comgithubbecauseqa-1023): connect timed out
	at org.sonatype.nexus.maven.staging.deploy.strategy.StagingDeployStrategy.finalizeDeploy(StagingDeployStrategy.java:155)
	at org.sonatype.nexus.maven.staging.deploy.DeployMojo.execute(DeployMojo.java:213)
	... 22 more
Caused by: org.apache.maven.artifact.deployer.ArtifactDeploymentException: Failed to deploy artifacts: Could not transfer artifact com.github.becauseQA:becauseQA-utils:jar:sources:1.0.1 from/to nexus (https://oss.sonatype.org:443/service/local/staging/deployByRepositoryId/comgithubbecauseqa-1023): connect timed out
	at org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:143)
	at org.sonatype.nexus.maven.staging.deploy.strategy.AbstractDeployStrategy.deployUp(AbstractDeployStrategy.java:213)
	at org.sonatype.nexus.maven.staging.deploy.strategy.StagingDeployStrategy.finalizeDeploy(StagingDeployStrategy.java:125)
	... 23 more
Caused by: org.eclipse.aether.deployment.DeploymentException: Failed to deploy artifacts: Could not transfer artifact com.github.becauseQA:becauseQA-utils:jar:sources:1.0.1 from/to nexus (https://oss.sonatype.org:443/service/local/staging/deployByRepositoryId/comgithubbecauseqa-1023): connect timed out
	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.github.becauseQA:becauseQA-utils:jar:sources:1.0.1 from/to nexus (https://oss.sonatype.org:443/service/local/staging/deployByRepositoryId/comgithubbecauseqa-1023): connect timed out
	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.SocketTimeoutException: connect timed out
	at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
	at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)
	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
	at java.net.Socket.connect(Socket.java:589)
	at com.squareup.okhttp.internal.Platform.connectSocket(Platform.java:100)
	at com.squareup.okhttp.Connection.connectSocket(Connection.java:196)
	at com.squareup.okhttp.Connection.connect(Connection.java:172)
	at com.squareup.okhttp.Connection.connectAndSetOwner(Connection.java:367)
	at com.squareup.okhttp.OkHttpClient$1.connectAndSetOwner(OkHttpClient.java:128)
	at com.squareup.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:328)
	at com.squareup.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:245)
	at com.squareup.okhttp.Call.getResponse(Call.java:267)
	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
[DEBUG] Connection manager is shutting down

反覆嘗試了屢次仍是報錯,實在沒有辦法了,我只能經過代理上網而後手動進行發佈,操做步驟以下:git

  1. 進入sonatype管理網站,https://oss.sonatype.org/#stagingRepositories ,前提是你記得註冊他們的帳號,具體如何操做,請google之。
  2. 在左邊的導航欄中點擊 「Staging Upload」,進入以下頁面:

image

3.  最重要的一步就是這裏了,這裏咱們上傳的全部的文件目錄必定要是你使用maven 插件nexus-staging-maven-plugin 生成的staging目錄,例如個人工程師becauseQA,那麼目錄就是: becauseQA-utils\target\nexus-staging\staging\104a5d5a8fd342\com\github\becauseQAgithub

3.1 Upload Mode選擇 「Artifact with a Pom」,點擊「Select POM to Upload」 進入上面的staging目錄選擇對應的pom文件;apache

3.2 點擊「Select Artifact(s) for Upload」 按鈕仍是進入剛纔的staging目錄,選擇對應的jar文件點擊「Add Artifacts」按鈕,重複該步驟上傳該目錄下全部的jar文件包括doc和source文件,還有一些用gpg生成的asc文件,例如這裏對應的全部須要上傳的文件清單以下:網絡

image

完成全部的設置後,點擊「Upload Artifacts」按鈕等待片刻上傳便可成功。eclipse

 

實在是沒有辦法,國內的網絡被blocked的太多了,只能嘗試代理上網下手工方式進行發佈了。socket

 

另附對應的nexus-staging-maven-plugin插件的配置信息maven

<plugin>
						<groupId>org.sonatype.plugins</groupId>
						<artifactId>nexus-staging-maven-plugin</artifactId>
						<version>${nexus-staging-maven-plugin.version}</version>
						<extensions>true</extensions>

						<configuration>
							<serverId>nexus</serverId>
							<nexusUrl>https://oss.sonatype.org/</nexusUrl>
							<autoReleaseAfterClose>false</autoReleaseAfterClose>
							<sslAllowAll>true</sslAllowAll>
							<stagingProgressPauseDurationSeconds>20</stagingProgressPauseDurationSeconds>
							<stagingProgressTimeoutMinutes>20</stagingProgressTimeoutMinutes>
							<detectBuildFailures>true</detectBuildFailures>
						</configuration>
					</plugin>
相關文章
相關標籤/搜索