java - Maven resource filtering not working from 'resources' folder -
i having trouble maven's resource filtering. directory structure is:
src |-main |-filters |-java |-resources |-webapp
the pom contains following:
<build> <filters> <filter>src/main/filters/${environment}/filter.properties</filter> </filters> <resources> <resource> <directory>src/main/resources</directory> <filtering>true</filtering> </resource> </resources> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-war-plugin</artifactid> <version>2.6</version> <configuration> <filteringdeploymentdescriptors>true</filteringdeploymentdescriptors> <failonmissingwebxml>false</failonmissingwebxml> </configuration> </plugin> ... </build>
i using netbeans 'copy static resources on save' copy resources if filtering
set false
. forcing me build each time change file in resources
folder rather saving changed file.
running mvn resources:resources
gives following output:
[info] scanning projects... [info] [info] ------------------------------------------------------------------------ [info] building core 1.0 [info] ------------------------------------------------------------------------ [info] [info] --- maven-resources-plugin:2.6:resources (default-cli) @ core --- [info] using 'utf-8' encoding copy filtered resources. [info] copying 77 resources [info] copying 31 resources [info] ------------------------------------------------------------------------ [info] build success [info] ------------------------------------------------------------------------ [info] total time: 0.618 s [info] finished at: 2015-07-22t21:24:32+01:00 [info] final memory: 9m/155m [info] ------------------------------------------------------------------------
but when in target folder modified struts.xml
file not updated. have never used mvn resources:resources
before maybe have wrong idea it. should not copy files src/main/resources
target/[folder]/web-inf/classes
?
does have solution?
should not copy files src/main/resources target/[folder]/web-inf/classes
no, should copy files target/classes
. maven-war-plugin responsible copying content of folder web-inf/classes
(during package phase). instead run mvn package
.
Comments
Post a Comment