You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Marat Abrarov (Jira)" <ji...@apache.org> on 2023/03/03 16:38:00 UTC

[jira] [Comment Edited] (MASSEMBLY-845) MASSEMBLY-817 makes some usecases very inconvenient

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

Marat Abrarov edited comment on MASSEMBLY-845 at 3/3/23 4:37 PM:
-----------------------------------------------------------------

Hi [~khmarbaise], [~rfscholte-getthere] and [~afloom],

Here is my use-case of Maven Assembly Plugin, which relies on {{finalName}} parameter: [https://github.com/mabrarov/docker-compose-init-container/blob/master/app-image/pom.xml].

I use Maven Assembly Plugin to create multiple archives (with required structure, directory and file permissions, directory and file timestamps, line endings), which are later (within the same maven module) used in Dockerfile [{{ADD}}|https://docs.docker.com/engine/reference/builder/#add] or [{{COPY}}|https://docs.docker.com/engine/reference/builder/#copy] instructions to place directories / files in the built (using [docker-maven-plugin|https://github.com/fabric8io/docker-maven-plugin] and generated Dockerfile) container image.

I also use Maven Assembly Plugin with {{finalName}} parameter to place all packaged archives and Dockerfile (where I fill placeholders using filtering) in a single directory which is used as Docker build context.

This way my builds on Windows host (using remote Docker engine which can be running in a local VM with Linux) and on Linux hosts (using remote or local Docker engine) are identical, OS independent (comparing to {{docker build}} command) and reproducible.

Taking into account that Maven Assembly Plugin still supports [{{outputDirectory}}|https://maven.apache.org/plugins/maven-assembly-plugin/single-mojo.html#outputDirectory] parameter (which can replace {{finalName}} parameter for my use case, but it will complicate maven project and Dockerfile), I find deprecation of {{finalName}} parameter (MASSEMBLY-817) meaningless.

Even integration tests of Maven Assembly Plugin (e.g. [https://github.com/apache/maven-assembly-plugin/blob/master/src/it/projects/mojo-tests/single-twice-in-one-project-hierarchy/pom.xml]) still use {{finalName}} parameter.

I vote to make {{finalName}} back editable, or at least consider it editable if {{attach}} is {{{}false{}}}.

FYI [~ctubbsii] (from [comment|https://issues.apache.org/jira/browse/MASSEMBLY-843?focusedCommentId=17696156&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-17696156] in MASSEMBLY-843).

Thank you.


was (Author: abrarovm):
Hi [~khmarbaise], [~rfscholte-getthere] and [~afloom],

Here is my use-case of Maven Assembly Plugin, which relies on {{finalName}} parameter: [https://github.com/mabrarov/docker-compose-init-container/blob/master/app-image/pom.xml].

I use Maven Assembly Plugin to create multiple archives (with required structure, directory and file permissions, directory and file timestamps, line endings), which are later (within the same maven module) used in Dockerfile [{{ADD}}|https://docs.docker.com/engine/reference/builder/#add] or [{{COPY}}|https://docs.docker.com/engine/reference/builder/#copy] instructions to place directories / files in the built (using [docker-maven-plugin|https://github.com/fabric8io/docker-maven-plugin] and generated Dockerfile) container image.

I also use Maven Assembly Plugin with {{finalName}} parameter to place all packaged archives and Dockerfile (where I fill placeholders using filtering) in a single directory which is used as Docker build context.

This way my builds on Windows host (using remote Docker engine which can be running in a local VM with Linux) and on Linux hosts (using remote or local Docker engine) are identical, OS independent (comparing to {{docker build}} command) and reproducible.

Taking into account that Maven Assembly Plugin still supports [{{outputDirectory}}|https://maven.apache.org/plugins/maven-assembly-plugin/single-mojo.html#outputDirectory] parameter (which can replace {{finalName}} parameter for my use case, but it will complicate maven project and Dockerfile), I find deprecation of {{finalName}} parameter (MASSEMBLY-817) meaningless.

Even integration tests of Maven Assembly Plugin (e.g. [https://github.com/apache/maven-assembly-plugin/blob/master/src/it/projects/mojo-tests/single-twice-in-one-project-hierarchy/pom.xml]) still use {{finalName}} parameter.

I vote to make {{finalName}} back editable, or at least consider it editable if {{attach}} is {{{}false{}}}.

Thank you.

> MASSEMBLY-817 makes some usecases very inconvenient
> ---------------------------------------------------
>
>                 Key: MASSEMBLY-845
>                 URL: https://issues.apache.org/jira/browse/MASSEMBLY-845
>             Project: Maven Assembly Plugin
>          Issue Type: Bug
>    Affects Versions: 3.0.0
>            Reporter: Ulf Dreyer
>            Priority: Major
>
> The "improvement" done in MASSEMBLY-817 makes some usecases very inconvenient:
> We need to create an archive with one stable name (independent of e.g. version) so we don't have to propagate these information to a bunch of scripts.
> The general solution (i.e. Stack-overflow) refers exactly to the finalName:
> [http://stackoverflow.com/questions/20697144/can-not-set-the-final-jar-name-with-maven-assembly-plugin]
> *Please change finalName back to a settable property.*
> It being settable does not hurt anyone satisfied with the default naming convention but makes some usecases vastly simpler (otherwise you have to rename the artifact using yet another plugin or propagate version info possibly through a chain of scripts)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)