0

while executing mvn clean install -DskipTests I want to exclude a file com.java.test.Test.java from build path(as it has some error). How to do that?

  • Does this answer your question? [Maven - exclude folder from build](https://stackoverflow.com/questions/25262794/maven-exclude-folder-from-build) – atarasenko Aug 18 '20 at 23:26

1 Answers1

0

You can use the <exclude> tag in your pom.xml to exclude files in Maven. For more information see https://maven.apache.org/plugins/maven-resources-plugin/examples/include-exclude.html


Another way is adding the class to an exclusion pattern as an argument like:
mvn clean install -Dtest="*,!Test"

For more information see Skip single test with maven with command line options

Felix Schildmann
  • 574
  • 1
  • 7
  • 22