Brett Porter wrote on Thursday, April 14, 2005 4:29 PM:
[snip]
> Yes, you could have maven.xml with:
> 
> <ant:delete>
>   <ant:includes name="**/target/**" />
> </ant:delete>

I use this one (was sent by someone elso to the list before), that don't delete 
arbitrarily named "target" directories in your sources:


    <goal name='multiproject:clean'>
        <maven:reactor
            basedir='${maven.multiproject.basedir}'
            banner='Gathering project list'
            includes='${maven.multiproject.includes}'
            excludes='${maven.multiproject.excludes}'
            postProcessing='true'
            ignoreFailures='${maven.multiproject.ignoreFailures}'
            collectionVar='reactorProjects'
            collectOnly='true' />
        <j:forEach var='reactorProject' items='${reactorProjects}'>
            <j:set 
var='_clean_dir'>${reactorProject.context.getVariable('maven.build.dest')}</j:set>
            <ant:delete dir='${_clean_dir}' failonerror='false' />
            <j:set 
var='_clean_dir'>${reactorProject.context.getVariable('maven.build.dir')}</j:set>
            <ant:delete dir='${_clean_dir}' failonerror='false' />
            <j:set 
var='_basedir'>${reactorProject.context.getVariable('basedir')}</j:set>
            <ant:delete file='${_basedir}/velocity.log' quiet='true' 
failonerror='false' />
            <ant:delete file='${_basedir}/velocity.log.1' quiet='true' 
failonerror='false' />
            <ant:delete file='${_basedir}/jcoverage.ser' quiet='true' 
failonerror='false' />
        </j:forEach>
    </goal>

    <postGoal name='multiproject:clean'>
        <attainGoal name='clean'/>
    </postGoal>

    <postGoal name='clean'>
        <ant:delete file='${basedir}/jcoverage.ser' quiet='true' 
failonerror='false' />
        <ant:delete file='${basedir}/velocity.log' quiet='true' 
failonerror='false' />
        <ant:delete file='${basedir}/velocity.log.1' quiet='true' 
failonerror='false' />
    </postGoal>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to