In my Maven project, I am using the maven-assembly-plugin bound to the package phase to create a distribution archive (zip) of the project. When I call mvn clean install to build & install the project, this archive gets installed into my local repository (.m2) as well. How can I exclude it from the installation? Or more generally, how can I exclude certain files/maven products from installation? I tried to relocate the assembly output out of the target directory but that wasn't the solution.
Asked
Active
Viewed 784 times
1 Answers
0
You can set the attach
property of the maven-assembly-plugin to false
, see the docs.
That way the file is generated but not attached to the project, excluding it from operations like install
and deploy
.
That being said, I don't recommend this as it can lead to unexpected behavior down the line.

kewne
- 2,208
- 15
- 11
-
This is exaclty what I was looking for. I have read the docs but somehow misunderstood the _attach_ property. Thank you! – Jan Švajcr Jun 22 '17 at 10:58