1
回答
jenkin构建完成无法将文件发送到远程服务器
利用AWS快速构建适用于生产的无服务器应用程序,免费试用12个月>>>   
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.529 s
[INFO] Finished at: 2017-08-31T17:08:03+08:00
[INFO] Final Memory: 28M/245M
[INFO] ------------------------------------------------------------------------
[JENKINS] Archiving /Applications/jenkins-2.60.3-0/apps/jenkins/jenkins_home/workspace/estate-platform/cloud-config-server/pom.xml to com.kerry/cloud-config-server/0.0.1-SNAPSHOT/cloud-config-server-0.0.1-SNAPSHOT.pom
[JENKINS] Archiving /Applications/jenkins-2.60.3-0/apps/jenkins/jenkins_home/workspace/estate-platform/cloud-config-server/target/cloud-config-server-0.0.1-SNAPSHOT.jar to com.kerry/cloud-config-server/0.0.1-SNAPSHOT/cloud-config-server-0.0.1-SNAPSHOT.jar
channel stopped
SSH: Connecting from host [MacBook-Pro.local]
SSH: Connecting with configuration [test-server] ...
SSH: EXEC: STDOUT/STDERR from command [chmod 777 /data/test/cloud_conifg_server/nohup  ./start.sh &] ...
SSH: EXEC: completed after 204 ms
SSH: Disconnecting configuration [test-server] ...
SSH: Transferred 0 file(s)

 

<无标签>
举报
奔跑的小菜鸟
发帖于3个月前 1回/21阅

maven可以直接使用ssh发布war包,你查查wagon-maven-plugin 插件。

<build>
	<finalName>dashboard</finalName>
		<plugin>
			<groupId>org.codehaus.mojo</groupId>
			<artifactId>wagon-maven-plugin</artifactId>
			<version>1.0</version>
			<configuration>
				<fromFile>target/dashboard.war</fromFile>
				<url>scp://root@192.168.111.110/opt/system/apache-tomcat-8.0.30/webapps</url>
			</configuration>
		</plugin>
	</plugins>
	<extensions>
		<extension>
			<groupId>org.apache.maven.wagon</groupId>
			<artifactId>wagon-ssh</artifactId>
			<version>2.8</version>
		</extension>
	</extensions>
</build>

如果你的机器配置了服务器的公钥,可以直接使用,如果没有,需要settings.xml 中配置server

发布时执行下面的目标:

mvn clean package wagon:upload-single

在jenkins配置好了环境可以直接用。

顶部