I am trying to use "maven-clean-plugin" to delete additional files situated in /my/path folder.
<plugin>
   <artifactId>maven-clean-plugin</artifactId>
   <executions>
       <execution>
           <id>clean-on-cleaning</id>
           <phase>clean</phase>
           <goals>
               <goal>clean</goal>
           </goals>
           <configuration>                      
               <filesets>
                   <fileset>
                       <directory>target/dart</directory>
                   </fileset>
                   <fileset>
                       <directory>src/main/dart/.pub</directory>
                   </fileset>
                   <fileset>
                       <directory>src/main/dart/build</directory>
                   </fileset>
                   <fileset>
                       <directory>${env.APPDATA}/Pub/Cache</directory>
                   </fileset>
                   <fileset>
                       <directory>src/main/dart/packages</directory>    
                       <followSymlinks>false</followSymlinks>
                   </fileset>
               </filesets>
           </configuration>
       </execution>
   </executions>
"src/main/dart/packages" contains links. And one of the links points to "src/main/dart/lib" folder. I have set:
<followSymlinks>false</followSymlinks> 
So it shouldn't delete files in lib directory. But unfortunately it does. Where the problem could be?
Environment configuration:
Judging by your configuration, you are using the version of the maven-clean-plugin that is coming from the default binding of the clean lifecycle. This is version 2.5 for Maven 3.3.3.
For this version, there is a bug that the maven-clean-plugin does not respect the followSymLinks attribute on Windows: it is MCLEAN-58:
Maven Clean Plugin ignores followSymLinks parameter on Windows
This has been fixed in version 2.6.1 according to this bug report, for users having Java >= 7, which is your case.
Therefore, you just need to update the version of the maven-clean-plugin you are using to 2.6.1. The current version is 3.0.0 so you might as well update to that one:
<plugin>
   <artifactId>maven-clean-plugin</artifactId>
   <version>3.0.0</version>
   <!-- rest of configuration -->
</plugin>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With