Throw maven exception
3 answers
It depends on what you mean by "using the jar locally".
If you mean that you don't want the jar to be included in any packages, you can set the scope to a dependency provided
. This scope is only available in the compilation and test class, and is not transitive. Dependency on this area will not be included in the war / ears.
<dependency>
<groupId>some.groupid</groupId>
<artifactId>my-dependency</artifactId>
<version>1.0.0</version>
<scope>provided</scope>
</dependency>
If you mean that you do not want the jar to be added to a distribution built with a build plugin, you can customize the build to exclude a specific dependency.
+3
source to share