[ https://jira.codehaus.org/browse/MWAR-305?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=335380#comment-335380 ]
Grzegorz Grzybek commented on MWAR-305: --------------------------------------- Hello - any news on this issue? > Filtering doesn't work as expected after switching from > maven-filtering:1.0-beta-2 to maven-filtering:1.1 > ---------------------------------------------------------------------------------------------------------- > > Key: MWAR-305 > URL: https://jira.codehaus.org/browse/MWAR-305 > Project: Maven WAR Plugin > Issue Type: Bug > Reporter: Grzegorz Grzybek > Priority: Critical > > {{maven-filtering:1.0-beta-3}} introduced a setting > {{org.apache.maven.shared.filtering.AbstractMavenFilteringRequest.injectProjectBuildFilters}} > defaulted to {{false}}. > While constructing {{defaultFilterWrappers}} in > {{org.apache.maven.plugin.war.AbstractWarMojo.buildWebapp(MavenProject, > File)}} the {{MavenResourcesExecution}} is constructed. > In {{maven-filtering:1.0-beta-2}} there's unconditional call: > {code:java} > loadProperties( filterProperties, mavenProject.getBuild().getFilters(), > baseProps ); > {code} > In {{maven-filtering:1.1}}+ there's conditional call: > {code:java} > if ( request.isInjectProjectBuildFilters() ) > { > List<String> buildFilters = new ArrayList( > request.getMavenProject().getBuild().getFilters() ); > buildFilters.removeAll( request.getFileFilters() ); > loadProperties( filterProperties, buildFilters, baseProps ); > } > {code} > So my filters declared (as always) in: > {code:xml} > <build> > <filters> > <filter>../src/config/env/envX/config.properties</filter> > </filters> > </build> > {code} > are *not taken into account* forcing me to set (configuration duplicate) > [maven-war-plugin's > filter|http://maven.apache.org/plugins/maven-war-plugin/war-mojo.html#filters] > property. > Please change (in > {{org.apache.maven.plugin.war.AbstractWarMojo.buildWebapp()}}) the line: > {code:xml} > mavenResourcesExecution.setFilters( filters ); > {code} > to > {code:xml} > mavenResourcesExecution.setFilters( filters == null ? > project.getBuild().getFilters() : filters ); > {code} > regards > Grzegorz Grzybek -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira