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

不知道是国内的网络的问题还是别的原因,在deploy一个maven的artifact到oss server的时候总是报错:

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

反复尝试了多次还是报错,实在没有办法了,我只能通过代理上网然后手动进行发布,操作步骤如下:

  1. 进入sonatype管理网站,https://oss.sonatype.org/#stagingRepositories ,前提是你记得注册他们的账号,具体如何操作,请google之。
  2. 在左边的导航栏中点击 “Staging Upload”,进入如下页面:

3.  最重要的一步就是这里了,这里我们上传的所有的文件目录一定要是你使用maven 插件nexus-staging-maven-plugin 生成的staging目录,例如我的工程师becauseQA,那么目录就是: becauseQA-utils\target\nexus-staging\staging\104a5d5a8fd342\com\github\becauseQA

3.1 Upload Mode选择 “Artifact with a Pom”,点击“Select POM to Upload” 进入上面的staging目录选择对应的pom文件;

3.2 点击“Select Artifact(s) for Upload” 按钮还是进入刚才的staging目录,选择对应的jar文件点击“Add Artifacts”按钮,重复该步骤上传该目录下所有的jar文件包括doc和source文件,还有一些用gpg生成的asc文件,例如这里对应的所有需要上传的文件清单如下:

完成所有的设置后,点击“Upload Artifacts”按钮等待片刻上传即可成功。

实在是没有办法,国内的网络被blocked的太多了,只能尝试代理上网下手工方式进行发布了。

另附对应的nexus-staging-maven-plugin插件的配置信息

<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>
时间: 2024-10-09 22:06:31

maven nexus-staging-maven-plugin exception-connect timed out的相关文章

剑指架构师系列-持续集成之Maven+Nexus+Jenkins+git+Spring boot

1.Nexus与Maven 先说一下这个Maven是什么呢?大家都知道,Java社区发展的非常强大,封装各种功能的Jar包满天飞,那么如何才能方便的引入我们项目,为我所用呢?答案就是Maven,只需要粘贴个Jar包的地址,Maven就会自动到网上查找引入到你的项目中.不过首先你的下载个Maven,然后指定一下 当下来的包包(jar)放到哪里. 我的版本是apache-maven-3.2.1,找到conf里面的配置文件 settings.xml,瞅瞅有没有 <localRepository>E:

Maven学习二:使用Nexus搭建Maven私服及相关配置

处于安全等原因的考虑,一些企业内部网络是不允许访问外部网络的,但是项目内部搭建的项目又是Maven架构,这样就需要企业在内部网络中搭建自己的Maven仓库服务,再者一些大型企业或者内部模块化组件化划分的比较清楚的企业开发的一些独立组件就需要使用Maven自建仓库来存放独立组件了. 使用Nexus搭建Maven私服主要有一下步骤: 1.首先需要准备好Java环境和Maven环境环境 2.到Nexus官方网站下载最新版本的Nexus https://www.sonatype.com/download

nexus 搭建 maven 私服

nexus 搭建 maven 私服 本机环境 Win 8 JDK 7 Maven 3.2 Nexus 2.11 版本选择 http://www.sonatype.org/nexus/archivednexus 2.6 及 2.6+ 版本要求 jdk 1.7 或 1.7+ 版本(jdk 1.6 请选择 nexus 2.5 及 以下版本).根据你现有的环境来选择合适的版本.这里选择 nexus-2.11.0 (如果无法打开下载, 可将新标签页地址栏中的地址复制到迅雷等下载工具中进行下载).下载得到

Sonatype Nexus 搭建Maven 私服

1. 为什么使用Nexus 如果没有私服,我们所需的所有构件都需要通过maven的中央仓库和第三方的Maven仓库下载到本地,而一个团队中的所有人都重复的从maven仓库下载构件无疑加大了仓库的负载和浪费了外网带宽,如果网速慢的话,还会影响项目的进程.很多情况下项目的开发都是在内网进行的,连接不到maven仓库怎么办呢?开发的公共构件怎么让其它项目使用?这个时候我们不得不为自己的团队搭建属于自己的maven私服,这样既节省了网络带宽也会加速项目搭建的进程,当然前提条件就是你的私服中拥有项目所需的

使用nexus搭建maven私服

使用nexus搭建maven私服 国内访问maven仓库速度渣渣,公司访问外网速度不快,即使用阿里云镜像效果也不佳.在局域网内搭建Maven私服,除了能从私服加速下载jar包,还能将内部通用模块发布在私服上供其他同事使用.对内部项目部署很有帮助. 安装和启动nexus 下载nexus-2.14.2-01-bundle.tar.gz https://www.sonatype.com/download-oss-sonatype # 添加用户 adduser nexus passwd nexus su

nexus搭建maven私服及私服jar包上传和下载

nexus搭建maven私服及私服jar包上传和下载 标签: nexus管理maven库snapshot 2017-06-28 13:02 844人阅读 评论(0) 收藏 举报 分类: Maven(1) 版权声明:本文为博主原创文章,未经博主允许不得转载. 一.nexus搭建maven私服及相关介绍 1.下载nexus-2.12.0-01-bundle.zip(版本随意) 2.以管理员身份运行cmd,cd进入解压文件的bin目录,执行nexus.bat install 若未以管理员身份运行则安装

Maven出现错误No plugin found for prefix &#39;jetty&#39; in the current project and in the plugin groups的问题解决

只需在maven的setting.xml文件上加入如下节点: <pluginGroups> <pluginGroup>org.mortbay.jetty</pluginGroup> </pluginGroups> setting.xml文件放在maven运行文件夹的conf文件夹下. 如果不想像上面增加额外的节点,可以通过以下的命令启动: mvn org.mortbay.jetty:maven-jetty-plugin:run Maven出现错误No plu

备忘:maven 错误信息: Plugin execution not covered by lifecycle configuration

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">  <modelVers

解决nexus下载maven索引的问题

解决nexus下载maven索引的问题 (2011-10-12 17:48:46) 转载▼ 标签: it 分类: java 转自 http://www.colorfuldays.org/program/fix_update_index_onnexus/ 下载这个文件http://repo1.maven.org/maven2/.index/nexus-maven-repository-index.zip真困难啊,本地幸亏有apache 在上个周五在公司的一台服务器上用nexus搭建了maven r

ssh启动报错:org.dom4j.DocumentException: Connection timed out: connect Nested exception: Connection timed out: connect

ssh项目启动报错: org.dom4j.DocumentException: Connection timed out: connect Nested exception: Connection timed out: connect 一开始以为是数据库连接的事,后来发现是hibernate在实体对象映射数据库表的时候出的错 解决: 查看hibernate.jar包里的hibernate-mapping-3.0.dtd里的 <!DOCTYPE hibernate-mapping PUBLIC &qu