Uploading a File via SCP with Maven fails

后端 未结 1 2057
一生所求
一生所求 2021-02-05 23:05

I try to upload an ear created by maven to an application server using scp.

When I tried to run

mvn wagon:upload-single

But I get the

相关标签:
1条回答
  • 2021-02-05 23:46

    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>
    
    0 讨论(0)
提交回复
热议问题