[ https://jira.codehaus.org/browse/MWAR-305?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Karl-Heinz Marbaise closed MWAR-305. ------------------------------------ Resolution: Fixed Fix Version/s: 2.5 Assignee: Karl-Heinz Marbaise Cool Thanks for your feedback and help. So i close 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 > Assignee: Karl-Heinz Marbaise > Priority: Critical > Fix For: 2.5 > > > {{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 was sent by Atlassian JIRA (v6.1.6#6162)