#4 org.codehaus.mojo/exec-maven-plugin 를 이용한 lftp & sftp 명령 실행 (파일 업로드)
star
Tasks
lftp 설치#
- 맥
brew install lftp
- 우분투
sudo apt install lftp
pom.xml에 추가#
${sftpUserPass}
은 userid 및 password 보호를 위해 settings.xml properties에 선언
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<inherited>false</inherited>
<executions>
<execution>
<id>sftp-to-remote</id>
<phase>install</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>lftp</executable>
<arguments>
<argument>sftp://${sftpUserPass}@localhost:18822</argument>
<argument>-e</argument>
<argument>cd /app/tomcat/webapps/test/WEB-INF/lib; put ${project.basedir}/target/test-lib.jar; bye</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
settings.xml#
<profile>
<id>dev</id>
<activation>
<jdk>1.8</jdk>
</activation>
<properties>
<sftpUserPass>king:test%21%40345</sftpUserPass>
...
Comment 0
Add a comment
Comment 0