[
https://issues.apache.org/jira/browse/MASSEMBLY-773?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Robert Scholte updated MASSEMBLY-773:
-------------------------------------
Assignee: Kristian Rosenvold
> MetaInfServicesHandler catalog is not cleared between invocations in
> multimodule projects
> -----------------------------------------------------------------------------------------
>
> Key: MASSEMBLY-773
> URL: https://issues.apache.org/jira/browse/MASSEMBLY-773
> Project: Maven Assembly Plugin
> Issue Type: Bug
> Affects Versions: 2.5.2, 2.5.5
> Reporter: Nick Dimiduk
> Assignee: Kristian Rosenvold
> Fix For: 3.0.0
>
>
> I have a multi-module project (Apache Phoenix) that is using the assembly
> plugin to build two unrelated uberjars.
> {noformat}
> [INFO] Apache Phoenix ..................................... SUCCESS [ 3.705
> s]
> [INFO] Phoenix Core ....................................... SUCCESS [01:30
> min]
> [INFO] Phoenix - Flume .................................... SUCCESS [ 2.832
> s]
> [INFO] Phoenix - Pig ...................................... SUCCESS [ 2.579
> s]
> [INFO] Phoenix Query Server Client ........................ SUCCESS [ 0.906
> s]
> [INFO] Phoenix Query Server ............................... SUCCESS [ 33.841
> s]
> [INFO] Phoenix - Pherf .................................... SUCCESS [ 14.286
> s]
> [INFO] Phoenix - Spark .................................... SUCCESS [ 33.687
> s]
> [INFO] Phoenix Assembly ................................... SUCCESS [01:29
> min]{noformat}
> The first uberjar is built by the {{Assembly}} module and consists of classes
> from {{Core}}, {{Flume}}, {{Pig}}, {{Spark}}, and sundry dependencies. The
> second is built in the {{Query Server}} module and consists of {{Core}},
> {{Query Server}}, and {{Query Server Client}} modules. Both {{Core}} and
> {{Query Server Client}} modules provide a
> {{META-INF/services/java.sql.Driver}} file. As you can see above, the {{Query
> Server}} module is assembled first, and then the {{Assembly}} module.
> Initially I added the {{metaInf-services}} {{containerDescriptorHandler}} to
> the {{Assembly}} module (PHOENIX-1995) and everything worked as expected.
> Later, I added it also to the {{Query Server}} module (PHOENIX-2013). After
> that, I noticed that the resulting {{java.sql.Driver}} file packaged by
> {{Assembly}} contains entries for this file from {{Query Server}}.
> After much mucking about with dependencies, excludes, etc, I decided to
> {{mvnDebug}} the build. With a breakpoint in
> {{AbstractLineAggregatingHandler#addToArchive}}, sure enough, I see all the
> {{catalog}} entries from the first assembly invocation in the second
> invocation. I also see that the instance of {{MetaInfServicesHandler}} and
> it's {{catalog}} instance are identical between module invocations.
> Breakpoints at {{AbstractLineAggregatingHandler#getCatalog}} and
> {{AbstractLineAggregatingHandler#setCatalog}} are never hit, indicating that
> nothing external is tinkering with the {{catalog}} or its contents.
> I think the instance of {{MetaInfServicesHandler}} should be either reset or
> re-instantiated between module invocations.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)