Clear local maven repository on clean goal via maven-antrun-plugin


/ Published in: XML
Save to your folder(s)

Using this configuration in pom.xml 'clean' should be only one task in mvn command line (for ex. mvn clean compile now breaks a build on dependency problem, but mvn clean && mvn compile works fine).


Copy this code and paste it in your HTML
  1. <build>
  2. <plugins>
  3. <plugin>
  4. <artifactId>maven-antrun-plugin</artifactId>
  5. <executions>
  6. <execution>
  7. <id>clear-repo</id>
  8. <phase>pre-clean</phase>
  9. <goals>
  10. <goal>run</goal>
  11. </goals>
  12. <configuration>
  13. <tasks>
  14. <delete dir="${settings.localRepository}"/>
  15. </tasks>
  16. </configuration>
  17. </execution>
  18. </executions>
  19. </plugin>
  20. </plugins>
  21. </build>

URL: mvn_antrun_clear_repo

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.