Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
None
-
None
-
None
Description
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:
loadProperties( filterProperties, mavenProject.getBuild().getFilters(), baseProps );
In maven-filtering:1.1+ there's conditional call:
if ( request.isInjectProjectBuildFilters() ) { List<String> buildFilters = new ArrayList( request.getMavenProject().getBuild().getFilters() ); buildFilters.removeAll( request.getFileFilters() ); loadProperties( filterProperties, buildFilters, baseProps ); }
So my filters declared (as always) in:
<build> <filters> <filter>../src/config/env/envX/config.properties</filter> </filters> </build>
are not taken into account forcing me to set (configuration duplicate) maven-war-plugin's filter property.
Please change (in org.apache.maven.plugin.war.AbstractWarMojo.buildWebapp()) the line:
mavenResourcesExecution.setFilters( filters );
to
mavenResourcesExecution.setFilters( filters == null ? project.getBuild().getFilters() : filters );
regards
Grzegorz Grzybek