When in apache maven you have multiple dependencies with the same artifact id but different group id 

<dependency>
 <artifactId>any</artifactId>
 <groupId>groupId1</groupId>
 <version>1.1</version>
</dependency>
<dependency>
 <artifactId>any</artifactId>
 <groupId>groupId2</groupId>
 <version>1.2</version>
</dependency>
<dependency>
 <artifactId>any</artifactId>
 <groupId>groupId3</groupId>
 <version>1.3</version>
</dependency>

Apache maven war plugin is able to detect this case and will automatically add the groupId to resolve filename conflicts. If it would not do that the last one name any.jar would win

So it'll look like this in WEB-INF/lib

-rw------- 1 user grp  135851 Aug 24 12:21 grp1-any-1.1.jar 
-rw------- 1 user grp 1406696 Sep 18 11:51 grp2-any-1.2.jar 
-rw------- 1 user grp   88873 Aug 19 13:58 grp3-any-1.3.jar 

 In Maven Assembly this will not occur, and the last file name will be the only one available. There is at least two way to solve this issue:

  1. Use unique groupid and artifactid name: something you can do across your module code, it can be done if these dependencies are real 3rd party librairies
  2. Use the outputFileNameMapping in assembly 
<outputFileNameMapping>${artifact.groupId}-${artifact.artifactId}-${artifact.baseVersion}${dashClassifier?}.${artifact.extension}</outputFileNameMapping> 

Another use case for outputFileNameMapping is when you want to remove the timestamp from filename but keep the version in assembly dependencySet

${artifact.artifactId}-${artifact.baseVersion}.${artifact.extension}

 

 

comments powered by Disqus

You might like also

systematization of knowledge within major blockchain protocols or consensus
Alexis Gauba presented a systematization of knowledge within major blockchain protocols or consensus, addresses the common challenges, economic model and solutions and provides a formal structure within which to compare them in this keynote presentation at Hyperledger Global Forum. …
8 Days ago
Stablecoins: Crypto's Holy Grail or Fools’ Errand? by Dr Garrick Hileman
I was attending the interesting LECTURE "Stablecoins: Crypto's Holy Grail or Fools’ Errand?" by Dr Garrick Hileman - Head of reseach at Blockchain - London School of Economics - United Kingdom at hashtagETH hashtagZurich and here is a copy of the slides Introducing: 2019 State of Stablecoins The 2019 report builds on its predecessor to provide an updated and expanded look at the current state of the stablecoin market - a space where we expect to see significant innovation in …
8 Days ago
The State of Stablecoins 2019: Hype vs. Reality in the Race for Stable, Global, Digital Money
The report, entitled “The State of Stablecoins 2019: Hype vs. Reality in the Race for Stable, Global, Digital Money” is based on information collected from 40 crypto and stablecoin firms. The report’s lead author is George Samman, a blockchain and cryptocurrency advisor. According to the document, Samman “was commissioned to research the stablecoin landscape and then independently report his findings for the broader industry to learn from.” https://bit.ly/2TWc1ao      …
8 Days ago
ICO STATISTICS FOR 2018 AND OUTLOOK FOR 2019
The last 6 months of ICO have been imported and can be browse at https://ico.tokens-economy.com/statistics. I display there historical ICO data for all cryptocurrencies friendly countries for each month of the year. What you can get out of all these charts: You can see the number of ICO per months over 13 major countries (Cayman-Islands, UK, USA, Cyprus, Estonia, France, Germany, Liechtenstein, Malta, Russia, Singapore, Slovenia, Switzerland), Each country has its own color, how often that color appear on the map represents the …
8 Days ago
MAJOR BLOCKCHAIN CONSENSUS ALGORITHMS AS AN INFOGRAPHICS
Consensus algorithms enable network participants to agree on the contents of a blockchain in a distributed and trust-less manner. I’ve listed in the past few months all of them at tokens-economy.gitbook.io/consensus/ and thought it will be cool also to produce an Infographics The PNG (4528 x 2894 px, 2.5MB) can be downloaded here and the PDF version (280kb) with clickable consensus links here …
8 Days ago
No Thumbnail was found
Usually, a percentage of the tokens is sold to ICO participants and a percentage kept for the company’s needs. The token distribution and allocation of the token is usually a chapter in the future company whitepaper. A pie chart displays how and to whom tokens will be allocated. But how much tokens are allocated (amount) and what are they used for? how much token should I spend for advisor? is 15% of all tokens too much for founder? How many …
200 Days ago
No Thumbnail was found
introduction This is my attempt to list all possible blockchain consensus out there, I welcome pull request of the blockchain community! let's make it the main reference for blockchain consensus. Visit also Tokens-Economy.com to keep track of new developments in the distributed ledger technology space. Blockchain Consensus? At the core of the Blockchain disruption is a consensus algorithm: Consensus algorithms enable network participants to agree on the contents of a blockchain in a distributed and trust-less manner. “Consensus decision-making is a group …
211 Days ago
Initial Coin Offering security checklist
Blockchain technology and cryptocurrencies have revolutionized the way companies raise capital but at the same time are bringing their own sets of challenges. To ensure that your startup will go through that (ad)venture in a safe manner, you should always adhere to best security practices, for your company AND your investors.  This mind map will present you in a visual way lots of valuable information like: A compilation of the most dangerous threats to the ICO industry and how to mitigate, …
232 Days ago
Initial Coin Offering in most relevant countries
 This new rendering will allow you to better compare countries The rendering being dynamic you can also pass some parameters like https://ico.tokens-economy.com/statistics/collage.html?width=800&height=800 The default size is width=450&height=450 Filter by year ico end. e.g all ico ended in 2017 https://ico.tokens-economy.com/statistics/collage.html?year=2017  Filter by category and year https://ico.tokens-economy.com/statistics/collage.html?category=Cryptocurrency  And more ICO with no raised amount is also displayed now. ICO webpage has been added Text in bubble scale now properly and are always centered     …
246 Days ago
2751 coins, 47 Consensus and 82 cryptographic algorithms
The innovation speed in Blockchain landscape is just breathtaking and being able to (or to be honest trying to...) follow all these rapid changes is a chance for all software engineers. At the core of the Blockchain disruption are consensus algorithm: Consensus algorithms enable network participants to agree on the contents of a blockchain in a distributed and trust-less manner. And the consensus algorithm plays a crucial role in maintaining the safety and efficiency of blockchain. Using the right algorithm may bring a significant increase to the …
254 Days ago