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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:57:39+00:00 2026-06-12T05:57:39+00:00

When deploying a webapp I need to update some variables in UI resources, unzip

  • 0

When deploying a webapp I need to update some variables in UI resources, unzip some assets and concat some files, currently this is achieved via an ant task. I’m trying to run this task in the maven build process using something like this…

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-antrun-plugin</artifactId>
    <version>1.6</version>
    <executions>
        <execution>
            <id>deploy-ui</id>
            <phase>prepare-package</phase>
            <inherited>false</inherited>
            <configuration>
                <target>
                    <property name="buildDir" value="${project.build.directory}/${project.build.finalName}" />
                    <ant antfile="build.xml" target="static-assets" />
                </target>
            </configuration>
            <goals>
                <goal>run</goal>
            </goals>
        </execution>
    </executions>
</plugin>

The above fails because the files have not yet been copied into target directory. If I set the phase to “package” the ant task runs fine and all the files are created/amended, but it’s no help as the .war has already been built before the ant target is run.

Basically, I need to run my ant target near the end of the prepare-package phase.

Having looked though the Lifecycle Reference I can’t workout how to expose the more granular Goals to the antrun plugin.

Any ideas?

  • 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-12T05:57:41+00:00Added an answer on June 12, 2026 at 5:57 am

    Since I did not get any answer on my comment I guess that you want to stay using maven-antrun-plugin.

    From what I’ve learned and experienced, if two plugins are to be executed on the same phase, then they will be executed in the order they are declared in pom.xml.

    For this to work you will have to add the maven-war-plugin in the <plugins/> list after the maven-antrun-plugin.

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <version>1.6</version>
        <executions>
            <execution>
                <id>deploy-ui</id>
                <phase>package</phase>
                <inherited>false</inherited>
                <configuration>
                    <target>
                        <property name="buildDir" value="${project.build.directory}/${project.build.finalName}" />
                        <ant antfile="build.xml" target="static-assets" />
                    </target>
                </configuration>
                <goals>
                    <goal>run</goal>
                </goals>
            </execution>
        </executions>
    </plugin>
    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-war-plugin</artifactId>
        <version>2.3</version>
        <executions>
            <execution>
                <!-- First step is to disable the default-war build step. -->
                <id>default-war</id>
                <phase>none</phase>
            </execution>
            <execution>
                <!-- Second step is to create an exploded war. Done in prepare-package -->
                <id>war-exploded</id>
                <phase>prepare-package</phase>
                <goals>
                    <goal>exploded</goal>
                </goals>
            </execution>
            <execution>
                <!-- Last step is to make sure that the war is built in the package phase -->
                <id>custom-war</id>
                <phase>package</phase>
                <goals>
                    <goal>war</goal>
                </goals>
            </execution>
        </executions>
    </plugin>
    

    Added some more executions so that the default-war is first disabled, then the war is exploded and lastly the war is packaged.

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

Sidebar

Related Questions

What are the benefits of embedding jetty vs deploying your webapp(s) in jetty? If
While deploying a dwr web app, i'm continuously getting this error. I dont know
After deploying WCF server (svc) on my Server, I have got this message when
This is a bit of a noob question but what do I need to
The environment is WAS 6.1 on Linux, deploying a webapp that uses classes from
This is the structure of my project (exactly these five files): /p1 pom.xml /src
What bundles do I need to install? At least, this would have to be
I'm deploying a webapp (WebApp.war, say) using the Maven Glassfish Plugin. Rather than it
I am considering using AppEngine for deploying a webapp which I am developing. As
I am working on a webapp project and we are considering deploying it on

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.