You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Dennis Lundberg (JIRA)" <ji...@codehaus.org> on 2011/02/20 13:54:22 UTC

[jira] Commented: (MASSEMBLY-528) FileSet does not support filtering (again)

    [ http://jira.codehaus.org/browse/MASSEMBLY-528?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=256931#action_256931 ] 

Dennis Lundberg commented on MASSEMBLY-528:
-------------------------------------------

Thanks for the sample project Marc!

Background on versions

Assembly plugin 2.2-beta-5 uses maven-filtering 1.0-beta-2,
Assembly Plugin 2.2 uses maven-filtering 1.0-beta-4.

The problem

When filtering more than one file, only the first file is filtered. This is highlighted by the sample project. Look at the file target\MASSEMBLY-528-1.0-SNAPSHOT_without-assembly-filter\filtered.properties after the build. It has not had the value for ${filter.build} injected.

The cause

In [r809265|http://svn.apache.org/viewvc?view=revision&revision=809265] the following change was made to the file DefaultMavenFileFilter in maven-filtering.
r806294
{code}
            loadProperties( filterProperties, mavenProject.getBuild().getFilters(), baseProps );
{code}
r809265
{code}
            if ( request.isInjectProjectBuildFilters() )
            {
                List buildFilters = request.getMavenProject().getBuild().getFilters();
                buildFilters.removeAll( request.getFileFilters() );
                
                loadProperties( filterProperties, buildFilters, baseProps );
            }
{code}

What happens here is that filters are removed from the MavenProject. So after this code has been called the first time, to actual Maven Project has changed! My tests so far indicate that in a project where only build/filters are used they all gets nuked by this, resulting in only the first file being filtered.

Solution

Making sure that we work on a copy of the project's filters like this:
{code}
                List buildFilters = new ArrayList(request.getMavenProject().getBuild().getFilters());
{code}

Comments and feedback are most welcome.

I have integration tests in the works for the Assembly Plugin.

> FileSet does not support filtering (again)
> ------------------------------------------
>
>                 Key: MASSEMBLY-528
>                 URL: http://jira.codehaus.org/browse/MASSEMBLY-528
>             Project: Maven 2.x Assembly Plugin
>          Issue Type: Bug
>    Affects Versions: 2.2
>            Reporter: Maik Richey
>            Assignee: John Casey
>            Priority: Critical
>             Fix For: 2.2.1
>
>         Attachments: MASSEMBLY-528_sample.zip
>
>
> After switching to version 2.2 of the Assembly Plugin filtering for FileSets does not work again as in versions prior to 2.2-beta-3.
> Can anybody confirm this issue?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira