maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Otavio Biasutti (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MASSEMBLY-920) ContainerDescriptorHandler for MetaInf-Services breaks folder structure
Date Wed, 31 Jul 2019 13:11:00 GMT

    [ https://issues.apache.org/jira/browse/MASSEMBLY-920?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16897162#comment-16897162
] 

Otavio Biasutti commented on MASSEMBLY-920:
-------------------------------------------

Hi [~michael-o],

this attachment should reproduce it.

Cheer
Otávio

> ContainerDescriptorHandler for MetaInf-Services breaks folder structure
> -----------------------------------------------------------------------
>
>                 Key: MASSEMBLY-920
>                 URL: https://issues.apache.org/jira/browse/MASSEMBLY-920
>             Project: Maven Assembly Plugin
>          Issue Type: Bug
>    Affects Versions: 3.1.1
>            Reporter: Otavio Biasutti
>            Priority: Major
>         Attachments: massembly-920.zip
>
>
> I have my own jar-with-dependecies assembly and I need to use the MetaInf-Services ContainerDescriptorHandler
to aggregate all services and avoid overriding.
> The plugin does not respect the folder structure inside META-INF/services.
> Camel is a good example of dependecy that can be used to reproduce the problem. It defines
its services in a nested folder structure, as in:
> {quote}
> META-INF/services/org/apache/camel/TypeConverter
> {quote}
> What really happens is that the folder structure is indeed created but the TypeConverter
file is moved to the root of the services, i.e. *META-INF/services*
> I had to patch the code and define a custom ContainerDescriptorHandler to fix the problem.
> The fix is straightforward. I simply inherited the provided implementation of MetaInfServiceHandler
and coded an overriden version of the following method like this:
> {code}
>     @Override
>     protected String getOutputPathPrefix(final FileInfo fileInfo) {
>         return Paths.get(fileInfo.getName()).getParent().toString() + "/";
>     }
> {code}
> All services were properly aggreggated after that.
> This may be the best fix for several related bugs I found online, like this one here:
https://stackoverflow.com/questions/37304195/camel-restlet-not-working-in-jar
> Cheer
> Otávio



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Mime
View raw message