maven-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MSHADE-304) Include specific files or directories for transformation - IncludeResourceTransformer?
Date Thu, 22 Nov 2018 10:12:00 GMT

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

Alex commented on MSHADE-304:
-----------------------------

Thanks for the fast response and your suggestion [~rfscholte]! 
I didn't think about that possible solution. I just tested a small stub code for my own "Hk2LocatorResourceTransformer"
and so far i can call up my own implementation, details i will implement later.

> Include specific files or directories for transformation -  IncludeResourceTransformer?
> ---------------------------------------------------------------------------------------
>
>                 Key: MSHADE-304
>                 URL: https://issues.apache.org/jira/browse/MSHADE-304
>             Project: Maven Shade Plugin
>          Issue Type: Improvement
>    Affects Versions: 3.2.1
>            Reporter: Alex
>            Priority: Minor
>              Labels: Transform, hk2, relocation, resources
>         Attachments: default
>
>
> *Background*
>  I am working at a project with the DI framework HK2.
> With HK2 it is possible to use _hk2-metadata-generator_ to generate a file ("META-INF/hk2-locator/default")
containing all annotated @Service classes (and @ConfiguredBy annotations)  for the auto-discovery
feature in HK2.
> For the configuration part (@ConfiguredBy) of HK2 i am using maven dependency hk2-configuration-integration
(org.glassfish.hk2).
> See for more details also:
>  [https://javaee.github.io/hk2/configuration.html]
>  [https://javaee.github.io/hk2/inhabitant-generator.html]
> Example @ConfiguredBy annotation: [https://github.com/eclipse-ee4j/glassfish-hk2/tree/master/examples/configuration] 
>  
> *Issue/Improvement*
> With maven-shade i was able to configure relocation for specific dependencies which might
be conflicting when used in other projects, which is a really cool feature i have to say!
> Only one manual step is now necessary for me (scripted at the moment) to adapt the generated
file "META-INF/hk2-locator/default" and update the JAR to have a proper working JAR. 
>  See also attached example file [^default] (note the org.glassfish.hk2 scope defined
there, which would require transformation/renaming i.e. org.shaded.glassfish..).
>  
> Maybe i am missing something which already exists with maven shade plugin, but i was
not able to include a custom file to the transformation/relocation process, like in my described
situation.
> I also tried to use "IncludeResourceTransformer" but when looking at the code no transformation
is done there, it is just used for copying artifacts as far as i can tell? The name is a bit
misleading, isn't it?
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message