我想通過scp在ec2 ubuntu實例上使用maven-wagon-plugin複製一些puppet文件。我已將我的私鑰文件的路徑添加到我的settings.xml文件中,並在我的pom.xml文件中定義了該插件的用法(請參見下文)。如何通過maven-wagon-ssh/scp在ec2實例上安裝文件?
我可以用膩子連接到機器上。此外,旅行車似乎能夠esatblish的連接,因爲它告訴我:
The authenticity of host 'ec2-....compute-1.amazonaws.com' can't be established.
RSA key fingerprint is 79:..:c7.
Are you sure you want to continue connecting? (yes/no): yes
然而,該插件告訴我,我的身份驗證是錯誤的:
[ERROR] Failed to execute goal org.codehaus.mojo:wagon-maven-plugin:1.0-beta-
4:upload (upload-puppet-module) on project ...:
Unable to create a Wagon instance for scp://ec2-...compute-1.amazonaws.com/:
Cannot connect. Reason: Auth fail -> [Help 1]
我的settings.xml看起來是這樣的:
...
<server>
<id>ec2-node</id>
<username>ubuntu</username>
<privateKey>.../path/to/privatekey.ppk</privateKey>
</server>
...
我的pom.xml看起來是這樣的:
<build>
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>2.4</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>wagon-maven-plugin</artifactId>
<version>1.0-beta-4</version>
<executions>
<execution>
<id>upload-puppet-module</id>
<phase>pre-integration-test</phase>
<goals>
<goal>upload</goal>
</goals>
<configuration>
<id>ec2-node</id>
<fromDir>${basedir}/src/main/resources/puppet-module</fromDir>
<includes>*</includes>
<url>scp://ec2-...compute-1.amazonaws.com/</url>
<toDir>/etc/puppet/modules/</toDir>
<filePermissions>664</filePermissions>
<directoryPermissions>775</directoryPermissions>
</configuration>
</execution>
</executions>
任何建議我可以做的,使其工作?
在此先感謝!
欲瞭解更快的幫助文章簡短的自包含正確示例。 –
我已經使用此[示例](http://mojo.codehaus.org/wagon-maven-plugin/usage.html) –