java - Maven wagon error when trying to copy artifact -


i trying use maven wagon plugin copy artifacts server.

i have set follows:

<build> <extensions>     <extension>        <groupid>org.apache.maven.wagon</groupid>        <artifactid>wagon-ssh</artifactid>        <version>${maven.wagon.version}</version>  </extension> </extensions>     <plugins>         <plugin>                <groupid>org.apache.maven.wagon</groupid>                <artifactid>wagon-maven-plugin</artifactid>                <version>${maven.wagon.version}</version>               <!--  <dependencies>                     <dependency>                         <groupid>org.apache.maven.wagon</groupid>                         <artifactid>wagon-ssh</artifactid>                         <version>${maven.wagon.version}</version>                     </dependency>                </dependencies> -->                <configuration>                     <serverid>appui</serverid>                     <fromfile>${project.build.directory}</fromfile>                     <includes>${project.build.finalname}.war</includes>                     <url>scp://localhost:2221/</url>                                          <todir>/opt/jboss/jboss-as-7.1.1.final/standalone/deployments</todir>                </configuration>                <executions>                  <execution>                     <id>upload-war-to-server</id>                    <phase>upload</phase>                    <goals>                      <goal>upload-single</goal>                    </goals>                    <configuration>                         <serverid>appui</serverid>                         <fromfile>${project.build.directory}</fromfile>                         <includes>${project.build.finalname}.war</includes>                         <url>scp://localhost:2221/opt/jboss/jboss-as-7.1.1.final/standalone/deployments</url>                                  </configuration>                  </execution>                </executions>         </plugin> 

however, when run this, following error:

[error] failed execute goal org.codehaus.mojo:wagon-maven-plugin:1.0:upload-single (default-cli) on project app.ui: parameters 'fromfile', 'url' goal org.codehaus.mojo:wagon-maven-plugin:1.0:upload-single missing or invalid -> [help 1] org.apache.maven.lifecycle.lifecycleexecutionexception: failed execute goal org.codehaus.mojo:wagon-maven-plugin:1.0:upload-single (default-cli) on project app.ui: parameters 'fromfile', 'url' goal org.codehaus.mojo:wagon-maven-plugin:1.0:upload-single missing or invalid     @ org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:221)     @ org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:153)     @ org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:145)     @ org.apache.maven.lifecycle.internal.lifecyclemodulebuilder.buildproject(lifecyclemodulebuilder.java:84)     @ org.apache.maven.lifecycle.internal.lifecyclemodulebuilder.buildproject(lifecyclemodulebuilder.java:59)     @ org.apache.maven.lifecycle.internal.lifecyclestarter.singlethreadedbuild(lifecyclestarter.java:183)     @ org.apache.maven.lifecycle.internal.lifecyclestarter.execute(lifecyclestarter.java:161)     @ org.apache.maven.defaultmaven.doexecute(defaultmaven.java:320)     @ org.apache.maven.defaultmaven.execute(defaultmaven.java:156)     @ org.apache.maven.cli.mavencli.execute(mavencli.java:537)     @ org.apache.maven.cli.mavencli.domain(mavencli.java:196)     @ org.apache.maven.cli.mavencli.main(mavencli.java:141)     @ sun.reflect.nativemethodaccessorimpl.invoke0(native method)     @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:57)     @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43)     @ java.lang.reflect.method.invoke(method.java:606)     @ org.codehaus.plexus.classworlds.launcher.launcher.launchenhanced(launcher.java:289)     @ org.codehaus.plexus.classworlds.launcher.launcher.launch(launcher.java:229)     @ org.codehaus.plexus.classworlds.launcher.launcher.mainwithexitcode(launcher.java:415)     @ org.codehaus.plexus.classworlds.launcher.launcher.main(launcher.java:356) caused by: org.apache.maven.plugin.pluginparameterexception: parameters 'fromfile', 'url' goal org.codehaus.mojo:wagon-maven-plugin:1.0:upload-single missing or invalid     @ org.apache.maven.plugin.internal.defaultmavenpluginmanager.populatepluginfields(defaultmavenpluginmanager.java:576)     @ org.apache.maven.plugin.internal.defaultmavenpluginmanager.getconfiguredmojo(defaultmavenpluginmanager.java:529)     @ org.apache.maven.plugin.defaultbuildpluginmanager.executemojo(defaultbuildpluginmanager.java:92)     @ org.apache.maven.lifecycle.internal.mojoexecutor.execute(mojoexecutor.java:209)     ... 19 more [error]  [error] re-run maven using -x switch enable full debug logging. [error]  [error] more information errors , possible solutions, please read following articles: [error] [help 1] http://cwiki.apache.org/confluence/display/maven/pluginparameterexception 

i have searched github see how others use maven wagon, , cannot see wrong how using it.

your configuration of wagon-maven-plugin incorrect: <fromfile> need reference file , not directory. also, there no <includes> tag, per documentation.

if reference generated maven artifact (${project.build.finalname}.war), need make sure upload-single goal executed after package phase (deploy, example, appropriate). in configuration, have bound upload-single goal phase "upload", not exist.

this final configuration :

<plugin>     <groupid>org.apache.maven.wagon</groupid>     <artifactid>wagon-maven-plugin</artifactid>     <version>${maven.wagon.version}</version>     <executions>         <execution>             <id>upload-war-to-server</id>             <phase>deploy</phase>             <goals>                 <goal>upload-single</goal>             </goals>             <configuration>                 <serverid>appui</serverid>                 <fromfile>${project.build.directory}/${project.build.finalname}.war</fromfile>                 <url>scp://localhost:2221/opt/jboss/jboss-as-7.1.1.final/standalone/deployments</url>                         </configuration>         </execution>     </executions> </plugin> 

Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -