Posted By

alces on 09/05/13


Tagged

ant maven mvn pre-clean maven-antrun-plugin


Versions (?)

Clear local maven repository via maven-antrun-plugin at pre-clean phase


 / Published in: XML
 

URL: mvn_antrun_preclean_clear_repo

By default "mvn clean" cleans only target, for clear local repository run: mvn clean -Dskip.repo.clean=false

  1. <project>
  2. <!--
  3.  
  4. At least GAV are required here
  5.  
  6. -->
  7. <properties>
  8. <skip.repo.clean>true</skip.repo.clean>
  9. </properties>
  10. <build>
  11. <plugins>
  12. <plugin>
  13. <artifactId>maven-antrun-plugin</artifactId>
  14. <version>1.7</version>
  15. <executions>
  16. <execution>
  17. <id>clear-repo</id>
  18. <phase>pre-clean</phase>
  19. <goals>
  20. <goal>run</goal>
  21. </goals>
  22. <configuration>
  23. <skip>${skip.repo.clean}</skip>
  24. <target>
  25. <echo>Purging ${settings.localRepository}...</echo>
  26. <delete>
  27. <fileset dir="${settings.localRepository}">
  28. <include name="**/*.jar"/>
  29. <include name="**/*.pom"/>
  30. <include name="**/*.sha1"/>
  31. </fileset>
  32. </delete>
  33. </target>
  34. </configuration>
  35. </execution>
  36. </executions>
  37. </plugin>
  38. </plugins>
  39. </build>
  40. </project>

Report this snippet  

You need to login to post a comment.