[
https://issues.apache.org/jira/browse/MASSEMBLY-803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17790818#comment-17790818
]
Vladimir I edited comment on MASSEMBLY-803 at 11/28/23 11:32 PM:
-----------------------------------------------------------------
I've tried to play around with {{outputFileNameMapping}} but I couldn't get
much progress with it. Maybe you could explain what is supposed to be written
there?
Like in the case above the original file named as
{{apache-tomcat-9.0.82/bin/bootstrap.jar}} and I want to add it to assembly as
{{bin/bootstrap.jar}}.
The only possible way so far is to use \{{dependencies:unpack-dependencies /
fileMappers }} but it doesn't seem natural for solving a simple task.
Also as stated https://issues.apache.org/jira/browse/MASSEMBLY-312 this
attribute shouldn't be used with {{{}unpack=true{}}}.
https://issues.apache.org/jira/browse/MASSEMBLY-45 seems about the same as well.
was (Author: bade7n):
I've tried to play around with {{outputFileNameMapping}} but I couldn't get
much progress with it. Maybe you could explain what is supposed to be written
there?
Like in the case above original file named as
{{apache-tomcat-9.0.82/bin/bootstrap.jar}} I want to add it to assembly as
{{bin/bootstrap.jar}} as simple as that. I haven't found a way to
strip/rename/map folders.
The only possible way so far is to use \{{dependencies:unpack-dependencies /
fileMappers }} but it doesn't seem natural for solving a simple task.
Also as stated https://issues.apache.org/jira/browse/MASSEMBLY-312 this
attribute shouldn't be used with {{{}unpack=true{}}}.
https://issues.apache.org/jira/browse/MASSEMBLY-45 seems about the same as well.
> Add file name mapping option when extracting dependencies
> ---------------------------------------------------------
>
> Key: MASSEMBLY-803
> URL: https://issues.apache.org/jira/browse/MASSEMBLY-803
> Project: Maven Assembly Plugin
> Issue Type: Improvement
> Components: dependencySet, moduleSet
> Reporter: Plamen Totev
> Priority: Minor
>
> Hi,
> Currently when using {{dependencySets}} with {{unpack}} set to {{true}},
> there is no way to set the output file names mapping. As plexus-io supports
> file names mapping, I think it will be relatively easy to add such option.
> Consider the following scenario. You want to distribute tomcat as part of
> your product. You could add something like that;
> {code:xml}
> <dependencySets>
> <dependencySet>
> <includes>
> <include>org.apache.tomcat:tomcat:8.0.33:zip</include>
> </includes>
> <unpack>true</unpack>
> </dependencySet>
> </dependencySets>
> {code}
> So far so good. But the zip archive contains {{apache-tomcat-8.0.33}} as root
> folder.What if I want to distribute it under {{tomcat}}? There is no
> way(AFAIK) to just extract sub folder of the archive. Of course there is
> {{<excludes>}} tag but the matched files will be still under
> {{apache-tomcat-8.0.33/...}}
> The use of {{FileMapper}} for example may strip the root folder (the
> {{RegExpFileMapper}} seems like a perfect candidate).
> What do you think about such feature?
> p.s. Not quite sure where is the proper place to discuss such improvements
> requests - here or in the mailing list. So excuse me if this is not the
> proper place.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)