Sharadha
Sharadha

Reputation: 31

Maven Doesnot Overwrite files in target folder

I am using maven for build, downloading war from artifactory and in src/main/webapp/WEB-INF/ folder customized one of the file but in target//WEB_INF/ the file is not overwriting with the customized file in the final war. I used true in maven resources plugin. EG:

<plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-resources-plugin</artifactId>
            <version>2.4</version>
            <executions>
                <execution>
                    <id>copy-app</id>
                    <!-- <phase>process-resources</phase> -->
                    <phase>validate</phase>
                    <goals>
                        <goal>copy-resources</goal>
                    </goals>
                    <configuration>
                      <overwrite>true</overwrite>
                      <outputDirectory>${project.artifactId}-${project.version}/WEB-INF</outputDirectory>
                        <resources>
                            <resource>
                                <directory>src/main/webapp/WEB_INF</directory>
                                <includes>
                                <include>app.xml</include></includes>
                                <filtering>true</filtering>
                            </resource>
                        </resources>
                    </configuration>
                </execution>
            </executions>
        </plugin>

Upvotes: 1

Views: 958

Answers (1)

sanjeevRm
sanjeevRm

Reputation: 1606

First run mvn clean which will remove target, and then run mvn install should create artifact with latest changes.

if mvn clean is not removing target folder, check if there are any access issues

Upvotes: 1

Related Questions