You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by "Brian E. Fox" <br...@reply.infinity.nu> on 2008/01/10 00:11:10 UTC

clean doesn't process additionalFileSets consistently

I had a chat on #maven with someone trying to delete a folder external
to his source tree. This works fine when running the child directly, but
in a reactor build it doesn't work. I peeked at the code and was
surprised to find this:

  try
                {
                    getLog().info( "Deleting " + fileset );

                    if ( !project.isExecutionRoot() )
                    {
                        String projectBasedir = StringUtils.replace(
project.getBasedir().getAbsolutePath(),
 
"\\", "/" );
                        String filesetDir = StringUtils.replace(
fileset.getDirectory(), "\\", "/" );

                        if ( filesetDir.indexOf( projectBasedir ) == -1
)
                        {
                            fileset.setDirectory( projectBasedir + "/" +
filesetDir );
                        }
                    }

                    fileSetManager.delete( fileset, failOnError );
                }


First issue is the log lies...it doesn't delete what it says it is.
Second, why do we manipulate the path at all (let alone only in a
reactor build)? It seems to me like this whole chunk should go away.

--Brian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: clean doesn't process additionalFileSets consistently

Posted by Benjamin Bentmann <be...@udo.edu>.
Hi,


Heinrich Nirschl wrote:
> 
> Maybe the intention was to base relative file names at basedir? This
> should however be done correctly of course.
> 

I recently filled in a JIRA issue with a patch for this (
http://jira.codehaus.org/browse/MCLEAN-31 MCLEAN-31 ). You are invited to
review it and vote.


Benjamin Bentmann
-- 
View this message in context: http://www.nabble.com/clean-doesn%27t-process-additionalFileSets-consistently-tp14724042s177p14752001.html
Sent from the Maven Developers mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: clean doesn't process additionalFileSets consistently

Posted by Heinrich Nirschl <he...@gmail.com>.
On Jan 10, 2008 12:11 AM, Brian E. Fox <br...@reply.infinity.nu> wrote:
> I had a chat on #maven with someone trying to delete a folder external
> to his source tree. This works fine when running the child directly, but
> in a reactor build it doesn't work. I peeked at the code and was
> surprised to find this:
>
>   try
>                 {
>                     getLog().info( "Deleting " + fileset );
>
>                     if ( !project.isExecutionRoot() )
>                     {
>                         String projectBasedir = StringUtils.replace(
> project.getBasedir().getAbsolutePath(),
>
> "\\", "/" );
>                         String filesetDir = StringUtils.replace(
> fileset.getDirectory(), "\\", "/" );
>
>                         if ( filesetDir.indexOf( projectBasedir ) == -1
> )
>                         {
>                             fileset.setDirectory( projectBasedir + "/" +
> filesetDir );
>                         }
>                     }
>
>                     fileSetManager.delete( fileset, failOnError );
>                 }
>
>
> First issue is the log lies...it doesn't delete what it says it is.
> Second, why do we manipulate the path at all (let alone only in a
> reactor build)? It seems to me like this whole chunk should go away.
>
> --Brian

Maybe the intention was to base relative file names at basedir? This
should however be done correctly of course.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org