Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java自动化部署插件 #186

Open
v5tech opened this issue Nov 8, 2018 · 0 comments
Open

java自动化部署插件 #186

v5tech opened this issue Nov 8, 2018 · 0 comments

Comments

@v5tech
Copy link
Owner

v5tech commented Nov 8, 2018

在maven的pom.xml中添加如下配置:

<extensions>
	<extension>
		<groupId>org.apache.maven.wagon</groupId>
		<artifactId>wagon-ssh</artifactId>
		<version>2.8</version>
	</extension>
</extensions>

<build>
	<plugins>
		<plugin>
			<groupId>org.codehaus.mojo</groupId>
			<artifactId>wagon-maven-plugin</artifactId>
			<version>1.0</version>
			<executions>
				<execution>
					<id>upload-deploy</id>
					<phase>package</phase>
					<goals>
						<goal>upload-single</goal>
						<goal>sshexec</goal>
					</goals>
					<configuration>
						<fromFile>target/joyplus-manage-2.0.jar</fromFile>
						<url>scp://root:***@106.214.240.250/opt</url>
						<commands>
							<command><![CDATA[ chmod +x /opt/joyplus-manage-2.0.jar ]]></command>
							<command><![CDATA[ sh /opt/upgrade-joyplus-manager.sh ]]></command>
						</commands>
						<displayCommandOutputs>true</displayCommandOutputs>
					</configuration>
				</execution>
			</executions>
		</plugin>
	</plugins>
</build>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant