You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Karl-Heinz Marbaise (JIRA)" <ji...@codehaus.org> on 2014/06/10 10:06:11 UTC

[jira] (MWAR-305) Filtering doesn't work as expected after switching from maven-filtering:1.0-beta-2 to maven-filtering:1.1

    [ https://jira.codehaus.org/browse/MWAR-305?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=347772#comment-347772 ] 

Karl-Heinz Marbaise commented on MWAR-305:
------------------------------------------

Can someone recheck with the current source. I can provide a SNAPSHOT of 2.5 within this week for testing.

> 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 was sent by Atlassian JIRA
(v6.1.6#6162)