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 3285364
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:15:32+00:00 2026-05-17T20:15:32+00:00

I have just translated an ant project into maven however since maven does not

  • 0

I have just translated an ant project into maven however since maven does not really deal with deployment I introduce some antrun into the build. However when I try to execute it the plugin skips my tasks. for exemple when I run mvn clean antrun:run I get the following message: No ant target defined – SKIPPED. the same happends to the second phase in which I am trying to override the deployment phase to do an actual deploy rather to upload to a repository.

Please find below an extract of my pom.xml (type:pom):

            <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <version>1.6</version>
            <executions>
                <execution>
                    <id>clean</id>
                    <configuration>
                        <task>
                            <echo>Cleaning deployed website</echo>
                        </task>
                        <tasks>
                            <delete dir="${deployRoot}/mydir/${env}"/>
                        </tasks>
                    </configuration>
                    <phase>clean</phase>
                    <goals>
                        <goal>run</goal>
                    </goals>
                </execution>
                <execution>
                    <id>deployment</id>
                    <configuration>
                        <task>
                            <echo>Deploying website</echo>
                        </task>
                        <tasks>
                            <echo>Copying website artifact to deployment </echo>
                            <mkdir dir="${deployRoot}/mydir/${env}" />
                            <unzip
                                src="${project.basedir}/target/${env}.${project.version}.zip"
                                dest="${deployRoot}/mydir/${env}" />
                            <chmod perm="ugo+rx">
                                <fileset dir="${deployRoot}/mydir/${env}/web-exploded/bin">
                                    <include name="**/*.sh" />
                                    <include name="**/*.bat" />
                                </fileset>
                            </chmod>
                        </tasks>
                    </configuration>
                    <phase>deploy</phase>
                    <goals>
                        <goal>run</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
  • 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-05-17T20:15:33+00:00Added an answer on May 17, 2026 at 8:15 pm

    In your pom.xml, you define two types of executions:

    • One is linked to the clean phase
    • One is linked to the deploy phase. Note, by the way, that for Maven, deploy does not mean deploy my (web-)application on a server but deploy the artifact on a remote repository. Please read the deploy plugin information for more details.

    So if you run the command mvn deploy, when the Maven lifecycle reaches the deploy phase, it will run the plugin execution (the second one in your pom.xml).

    However, in your case, you are not running the default Maven lifecycle, as your command is mvn antrun:run (I am not considering the clean goal here as it does not matter for the problem). This can be translated in Maven to run the antrun plugin, with the goal run. The problem with that is that you do not define any configuration (which contains the Ant tasks) for a direct call to your Ant plugin.

    So two solutions:

    • Bind the second execution to the install phase, and then run the mvn clean install instead of mvn antrun:run. Note that in this case, you will run the whole Maven lifecycle (i.e. compilation, tests, packaging).
    • Create a configuration of this plugin that is not related to any execution. In XML point of view, simply add (or move) the second <configuration> block to be a child of the <plugin> definition.

    If you choose the second solution, you will have a pom.xml like this one:

           <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <version>1.6</version>
            <!-- For cleaning -->
            <executions>
                <execution>
                    <id>clean</id>
                    <configuration>
                        <task>
                            <echo>Cleaning deployed website</echo>
                        </task>
                        <tasks>
                            <delete dir="${deployRoot}/mydir/${env}"/>
                        </tasks>
                    </configuration>
                    <phase>clean</phase>
                    <goals>
                        <goal>run</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <tasks>
                    <echo>Copying website artifact to deployment </echo>
                    ...
                </tasks>
            </configuration>
        </plugin>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just begun working on a project which uses Mercurial as a version
I have a weird issue with this, the messages to be translated do not
We have a large flash site which is translated into 11 languages. We have
My web-application project (not web-site project) is translated to 15 different languages using the
I have translated a project in CyanogenMod (the Email app) to Hebrew by adding
I am working on an iPhone project which I have translated to two languages
I have a file that I read in into R and is translated to
I have just started reading Modern C++ Design Generic programming and Design Patterns Applied
I have just discovered a variable name that is misspelled. If it were hidden
I have just created a report in Report Manager using a Stored Procedure which

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.