• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Two jars created when using maven-assembly-plugin

 
Saloon Keeper
Posts: 2619
329
Android Eclipse IDE Angular Framework TypeScript MySQL Database Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!


[WARNING] Replacing pre-existing project main-artifact file: D:\PlatformManager\acme-agent\target\acme-agent-0.0.1-SNAPSHOT.jar
with assembly file: D:\PlatformManager\acme-agent\target\AcmeAgent.jar

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?

pom.xml
Console:
 
Ron McLeod
Saloon Keeper
Posts: 2619
329
Android Eclipse IDE Angular Framework TypeScript MySQL Database Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As expected - original artifact also retained using the maven-shade-plugin plug-in.
 
Ron McLeod
Saloon Keeper
Posts: 2619
329
Android Eclipse IDE Angular Framework TypeScript MySQL Database Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

This is what I ended-up doing:
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!