I am using the maven-assembly-plugin plug-in to create an executable fat-jar. It does work, and AcmeAgent.jar is created and runs as expected. However acme-agent-0.0.1-SNAPSHOT.jar is also created, and in addition, the following two warnings are displayed:
[WARNING] Configuration option 'appendAssemblyId' is set to false.
Instead of attaching the assembly file: D:\PlatformManager\acme-agent\target\AcmeAgent.jar, it will become the file for main project artifact.
NOTE: If multiple descriptors or descriptor-formats are provided for this project, the value of this file will be non-deterministic!
I understand that I am seeing two artifacts because one is created due to the packaging being configured as jar, and the other from the plug-in. If I change the packaging to be pom, only a single jar is created, and the warnings go away. Is this the right approach, or should I be resolving this another way?
Any suggestions on how to remove the original artifact after the assembly?
Looking at this more, I think I was wrong trying to work-around the behaviour of the Maven and the plug-ins by wanting to remove the original jar and replace it with my fat-jar. A better solution is to create a distribution directory and output the fat-jar and related resources there, leaving the jar built from my code (without the dependencies) alone.