You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Barrie Treloar (JIRA)" <ji...@codehaus.org> on 2008/07/07 06:37:26 UTC

[jira] Commented: (MCLEAN-33) Cannot Supress Default clean while still cleaning

    [ http://jira.codehaus.org/browse/MCLEAN-33?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=140871#action_140871 ] 

Barrie Treloar commented on MCLEAN-33:
--------------------------------------

A workaround is to use the antrun plugin.

Something like this (I have not tested this properly)

{code:xml}
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
        <executions>
          <execution>
            <id>gensrc</id>
            <phase>clean</phase>
            <goals>
              <goal>run</goal>
            </goals>
            <configuration>
              <tasks>
                <delete>
                  <fileset dir="generated-sources" includes="**/*" />
                </delete>
              </tasks>
            </configuration>
          </execution>
        </executions>
      </plugin>
{code}

> Cannot Supress Default clean while still cleaning
> -------------------------------------------------
>
>                 Key: MCLEAN-33
>                 URL: http://jira.codehaus.org/browse/MCLEAN-33
>             Project: Maven 2.x Clean Plugin
>          Issue Type: New Feature
>    Affects Versions: 2.1.1
>            Reporter: Joshua Pollak
>            Priority: Minor
>
> We would like to configure clean in our parent pom to remove the log files in logs in all our child modules. We've done that like this:
>             <plugin>
>                 <artifactId>maven-clean-plugin</artifactId>
>                 <version>2.1.1</version>
>                 <configuration>
>                     <filesets>
>                         <fileset>
>                             <directory>${basedir}/logs</directory>
>                             <followSymlinks>false</followSymlinks>
>                             <excludes>
>                                 <exclude>**/.svn</exclude>
>                             </excludes>
>                         </fileset>
>                     </filesets>
>                 </configuration>
>             </plugin>
> The problem is that when we want to clean an extra directory out of a module, say for example, generated-sources:
>             <plugin>
>                 <artifactId>maven-clean-plugin</artifactId>
>                 <version>2.1.1</version>
>                 <executions>
>                     <execution>
>                         <id>gensrc</id>
>                         <phase>clean</phase>
>                         <goals>
>                             <goal>clean</goal>
>                         </goals>
>                         <configuration>
>                             <filesets>
>                                 <fileset>
>                                     <directory>generated-sources</directory>
>                                     <followSymlinks>false</followSymlinks>
>                                 </fileset>
>                             </filesets>
>                         </configuration>
>                     </execution>
>                 </executions>
>             </plugin>
> We then see the following when we run "mvn clean":
> FO] Building Generated Sources
> [INFO]    task-segment: [clean]
> [INFO] ------------------------------------------------------------------------
> [INFO] [clean:clean]
> [INFO] Deleting directory /Users/jpollak/src/software/projects/mhs/trunk/mhs-gensrc/target
> [INFO] Deleting directory /Users/jpollak/src/software/projects/mhs/trunk/mhs-gensrc/target/classes
> [INFO] Deleting directory /Users/jpollak/src/software/projects/mhs/trunk/mhs-gensrc/target/test-classes
> [INFO] Deleting directory /Users/jpollak/src/software/projects/mhs/trunk/mhs-gensrc/target/site
> [INFO] Deleting file-set: /Users/jpollak/src/software/projects/mhs/trunk/mhs-gensrc/logs (included: [], excluded: [**/.svn])
> [INFO] [clean:clean {execution: gensrc}]
> [INFO] Deleting directory /Users/jpollak/src/software/projects/mhs/trunk/mhs-gensrc/target
> [INFO] Deleting directory /Users/jpollak/src/software/projects/mhs/trunk/mhs-gensrc/target/classes
> [INFO] Deleting directory /Users/jpollak/src/software/projects/mhs/trunk/mhs-gensrc/target/test-classes
> [INFO] Deleting directory /Users/jpollak/src/software/projects/mhs/trunk/mhs-gensrc/target/site
> [INFO] Deleting file-set: generated-sources (included: [], excluded: [**/.svn])
> [INFO] ------------------------------------------------------------------------
> It would be nice to suppress cleaning target a second time.

-- 
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