Uploading a File via SCP with Maven fails

橙三吉。 提交于 2019-12-02 23:37:43

Your current configuration follows the example given in the Usage page and is correct. However, in this example the configuration element is declared inside an execution and thus only applies to this particular execution.

So when you call mvn wagon:upload-single on the command line, the configuration isn't "used" and there is indeed no url parameter configured.

If you want to call the plugin from the command line, either pass the parameters on the command line using -Durl=foo and so on or add a "global" configuration element:

<build>
  <extensions>
    <extension>
      <groupId>org.apache.maven.wagon</groupId>
      <artifactId>wagon-ssh</artifactId>
      <version>1.0-beta-6</version>
    </extension>
  </extensions>  

  <plugins>   
    <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>wagon-maven-plugin</artifactId>
      <version>1.0-beta-3</version>
      <configuration>
        <fromFile>${project.build.directory}/${project.build.finalName}.ear</fromFile> 
        <url>scp://servername/</url>
        <toDir>.</toDir>
      </configuration>
      ...
    </plugin>
    ...
  </plugins>
  ...
</build>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!