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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:11:38+00:00 2026-05-13T20:11:38+00:00

I use the antrun plugin to delete and move some property files depending on

  • 0

I use the antrun plugin to delete and move some property files depending on the profile that is used:

<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
    <execution>
        <phase>compile</phase>
        <goals>
            <goal>run</goal>
        </goals>
        <configuration>
            <tasks>
                <delete>
                    <fileset dir="${project.build.outputDirectory}/com/.../props">
                        <exclude name="pm-web-${profile.id}.xml" />
                    </fileset>
                </delete>
                <move file="${project.build.outputDirectory}/com/.../props/pm-web-${profile.id}.xml"
                    tofile="${project.build.outputDirectory}/com/.../props/pm-web.xml" />
            </tasks>
        </configuration>
    </execution>
</executions>

When I check the target/classes folder I can see that the ‘unwanted’ property files have been correctly deleted and that the move task was also correctly executed. However, when I look at the built war-file I see that the deleted files are still in there (the moved file is ok int the war).

I don’t understand how this might be possible; I assume the war plugin basically jars up the target folder? Since the files have correctly been deleted from the target folder I would expect them not to be in the war as well.

To complicate things (sorry) I’ve noticed that the delete sometimes works partialy, meaning: sometimes some folders (not all) have been ‘deleted from the war’.

I’ve tried changing the goal of the task (no luck) but I assume that most of the goals occur before building the war anyhow.

thanks for any help,
Stijn

  • 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-13T20:11:39+00:00Added an answer on May 13, 2026 at 8:11 pm

    The war mojo builds the webapp in ${project.build.directory}/${project.build.finalName} directory before to create the .war archive. Maybe your properties files were in there prior to adding the antrun stuff. In that case, deleting the properties file from target/classes didn’t remove them from ${project.build.directory}/${project.build.finalName} and the files still ended up in the final .war. But maybe I’m guessing too much and I’m totally wrong. See if you can reproduce the problem now that you cleaned up everything.

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

Sidebar

Related Questions

We use maven for our large-ish product. All of our artifacts are deployed to
I'm learning how to use maven for my standalone java apps but I don't
in my pom I've added the exec-maven-plugin to call a java class which will
I'm using Spring 2.5.6 and building my project with Maven 2.2.1. We use PropertyPlaceholderConfigurer
I wonder what is the Maven way in my situation. My application has a
We use MySQL in production, and Derby for unit tests. Our pom.xml copies Derby
Refer original post here for a reference to the original issue. What plugin should
I want to use sonar for analysis but i can't get any data in
What would be the mechanism to deploy rar artifacts if they are not present

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.