Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8565821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:30:59+00:00 2026-06-11T17:30:59+00:00

I am using wagon-maven-plugin to scp my WAR file to the server. It works

  • 0

I am using wagon-maven-plugin to scp my WAR file to the server. It works fine. My next step is to perform some commands on the server (mkdir, etc). Is there a plugin that helps me do that? Is there a way to work it out using wagon-maven-plugin?

I am relatively new to mvn. Any help would be appreciated.

Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T17:31:00+00:00Added an answer on June 11, 2026 at 5:31 pm

    I was able to run ssh commands with exec-maven-plugin. It is a powerful maven plugin to do all sorts of hack and also run commands. For anyone interested in the solution

    <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>exec-maven-plugin</artifactId>
      <version>1.2.1</version>
      <executions>
        <execution>
          <phase>install</phase>
          <goals>
            <goal>exec</goal>
          </goals>
        </execution>
      </executions>
      <configuration>
        <executable>sh</executable>
        <arguments>
          <!-- Shell script location -->
          <argument>runscript.sh</argument>
          <!-- arg #1 -->
          <argument>${file_1}</argument>
        </arguments>
      </configuration>
    </plugin>
    

    Another solution I found was to run maven-antrun-plugin. I would not recommend it since it runs ANT tasks and there are a lot of dependencies to it. But its handy if you would need to run ant tasks via maven.

    <plugin>
      <inherited>false</inherited>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-antrun-plugin</artifactId>
      <version>1.6</version>
      <configuration>
        <target>
          <loadproperties srcFile="deploy.properties" />
          <ftp action="send" server="server"
               remotedir="/a/b" userid="usr"
               password="pw" depends="no"
               verbose="yes" binary="yes">
            <fileset dir="modules/my-module/target">
              <include name="file.zip" />
            </fileset>
          </ftp>
    
          <!-- calls deploy script -->
          <sshexec host="host" trust="yes"
                   username="usr" password="pw"
                   command="sh /my/script.sh" />
    
          <!-- SSH -->
          <taskdef name="sshexec"
                   classname="org.apache.tools.ant.taskdefs.optional.ssh.SSHExec"
                   classpathref="maven.plugin.classpath" />
          <taskdef name="ftp"
                   classname="org.apache.tools.ant.taskdefs.optional.net.FTP"
                   classpathref="maven.plugin.classpath" />
        </target>
      </configuration>
      ...
      <dependencies>
        <dependency>
          <groupId>commons-net</groupId>
          <artifactId>commons-net</artifactId>
          <version>1.4.1</version>
        </dependency>
        <dependency>
          <groupId>ant</groupId>
          <artifactId>ant-commons-net</artifactId>
          <version>1.6.5</version>
        </dependency>
        <dependency>
          <groupId>ant</groupId>
          <artifactId>ant-jsch</artifactId>
          <version>1.6.5</version>
        </dependency>
        <dependency>
          <groupId>jsch</groupId>
          <artifactId>jsch</artifactId>
          <version>0.1.29</version>
        </dependency>
      </dependencies>
    </plugin>
    

    Hope that helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to copy the resources to a server using scp with wagon
I try to upload an ear created by maven to an application server using
I'm trying to migrate from a Nexus maven repo to using https://github.com/jcaddel/maven-s3-wagon . Getting
Using the C# Facebook SDK 5.0.3 everything works fine whit the client.Get(/me). But when
Using SQL Server 2008 R2 we are looking for a way to select the
Using ASIHTTPRequest, I downloaded a zip file containing a folder with several audio files.
Using Microsoft SQL Server 2005, is there any way to see when a table
I get Auth fail error when running mvn -X site:deploy . org.apache.maven.wagon.authentication.AuthenticationException: Cannot connect.
I am using SourceForge for some Open Source projects and I want to automate
I have been using Maven for several months to build using Artifactory for the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.