You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Barrie Treloar <ba...@gmail.com> on 2007/08/10 07:38:54 UTC

maven-clean-plugin: does true work for you?

With mvn 2.0.7 and maven-clean-plugin:2.1.1

In my parent plugin
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-clean-plugin</artifactId>
          <inherited>true</inherited>
          <configuration>
            <filesets>
              <fileset>
                <directory>logs</directory>
                <followSymlinks>false</followSymlinks>
              </fileset>
            </filesets>
          </configuration>
        </plugin>

In my module plugin

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <inherited>true</inherited>
        <configuration>
          <filesets>
            <fileset>
              <directory>lib</directory>
              <followSymlinks>false</followSymlinks>
            </fileset>
          </filesets>
        </configuration>
      </plugin>

But mvn help:effective-pom produces:
      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <version>2.1.1</version>
        <inherited>true</inherited>
        <configuration>
          <filesets>
            <fileset>
              <directory>lib</directory>
              <followSymlinks>false</followSymlinks>
            </fileset>
          </filesets>
        </configuration>
      </plugin>

And running mvn clean only deletes the lib directory (the log
directory is ignored)

Am I configuring this wrong?

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


Re: maven-clean-plugin: does true work for you?

Posted by Barrie Treloar <ba...@gmail.com>.
It would help if I thought first before typing :)

      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <configuration>
          <filesets combine.children="append">
            <fileset>
              <directory>logs</directory>
              <followSymlinks>false</followSymlinks>
            </fileset>
          </filesets>
        </configuration>
      </plugin>

Works a treat:

      <plugin>
        <artifactId>maven-clean-plugin</artifactId>
        <version>2.1.1</version>
        <configuration>
          <filesets combine.children="append">
            <fileset>
              <directory>logs</directory>
              <followSymlinks>false</followSymlinks>
            </fileset>
            <fileset>
              <directory>logs</directory>
              <followSymlinks>false</followSymlinks>
            </fileset>
          </filesets>
        </configuration>
      </plugin>

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


Re: maven-clean-plugin: does true work for you?

Posted by Barrie Treloar <ba...@gmail.com>.
On 8/13/07, Max Bowsher <ma...@ukf.net> wrote:
> Barrie Treloar wrote:
> > On 8/10/07, Max Bowsher <ma...@ukf.net> wrote:
> >> Try <configuration combine.children="append"> - not tested, but I think
> >> that'll do what you want.
> >
> > Is this an undocumented feature as it is not listed in the
> > http://maven.apache.org/ref/current/maven-model/maven.html
>
> It's not actually a Maven feature at all. It's a feature of the
> underlying XML manipulation class that Maven uses - Plexus Xpp3Dom.

mvn help:effective-pom

        <artifactId>maven-clean-plugin</artifactId>
        <version>2.1.1</version>
        <configuration combine.children="append">
          <filesets>
            <fileset>
              <directory>lib</directory>
              <followSymlinks>false</followSymlinks>
            </fileset>
          </filesets>
          <filesets>
            <fileset>
              <directory>logs</directory>
              <followSymlinks>false</followSymlinks>
            </fileset>
          </filesets>
        </configuration>

Result of mvn clean:
[INFO] Deleting file-set: logs (included: [], excluded: [])

Looks like its not possible to do what I want and I will have to
duplicate details.

Thanks anyway

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


Re: maven-clean-plugin: does true work for you?

Posted by Max Bowsher <ma...@ukf.net>.
Barrie Treloar wrote:
> On 8/10/07, Max Bowsher <ma...@ukf.net> wrote:
>> Try <configuration combine.children="append"> - not tested, but I think
>> that'll do what you want.
> 
> Is this an undocumented feature as it is not listed in the
> http://maven.apache.org/ref/current/maven-model/maven.html

It's not actually a Maven feature at all. It's a feature of the
underlying XML manipulation class that Maven uses - Plexus Xpp3Dom.

Max.


Re: maven-clean-plugin: does true work for you?

Posted by Barrie Treloar <ba...@gmail.com>.
On 8/10/07, Max Bowsher <ma...@ukf.net> wrote:
> First, <inherited>true</inherited> is the default!

Ahh, I hadn't thought that through since I rely on this in other areas anyway.

> Second, the default behaviour is for <configuration>s to be *merged* -
> hence configuration.filesets.fileset.directory=logs in the parent is
> overridden by configuration.filesets.fileset.directory=lib in the child.

I was wondering about that too.

> Try <configuration combine.children="append"> - not tested, but I think
> that'll do what you want.

Is this an undocumented feature as it is not listed in the
http://maven.apache.org/ref/current/maven-model/maven.html

Thanks for answering.

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


Re: maven-clean-plugin: does true work for you?

Posted by Max Bowsher <ma...@ukf.net>.
Barrie Treloar wrote:
> With mvn 2.0.7 and maven-clean-plugin:2.1.1
> 
> In my parent plugin
>   <build>
>     <pluginManagement>
>       <plugins>
>         <plugin>
>           <artifactId>maven-clean-plugin</artifactId>
>           <inherited>true</inherited>
>           <configuration>
>             <filesets>
>               <fileset>
>                 <directory>logs</directory>
>                 <followSymlinks>false</followSymlinks>
>               </fileset>
>             </filesets>
>           </configuration>
>         </plugin>
> 
> In my module plugin
> 
>   <build>
>     <plugins>
>       <plugin>
>         <artifactId>maven-clean-plugin</artifactId>
>         <inherited>true</inherited>
>         <configuration>
>           <filesets>
>             <fileset>
>               <directory>lib</directory>
>               <followSymlinks>false</followSymlinks>
>             </fileset>
>           </filesets>
>         </configuration>
>       </plugin>
> 
> But mvn help:effective-pom produces:
>       <plugin>
>         <artifactId>maven-clean-plugin</artifactId>
>         <version>2.1.1</version>
>         <inherited>true</inherited>
>         <configuration>
>           <filesets>
>             <fileset>
>               <directory>lib</directory>
>               <followSymlinks>false</followSymlinks>
>             </fileset>
>           </filesets>
>         </configuration>
>       </plugin>
> 
> And running mvn clean only deletes the lib directory (the log
> directory is ignored)
> 
> Am I configuring this wrong?

First, <inherited>true</inherited> is the default!

Second, the default behaviour is for <configuration>s to be *merged* -
hence configuration.filesets.fileset.directory=logs in the parent is
overridden by configuration.filesets.fileset.directory=lib in the child.

Try <configuration combine.children="append"> - not tested, but I think
that'll do what you want.

Max.