[jira] [Commented] (MNG-7204) Maven might pick up the wrong configuration when the plugin happens to include relocation information
[ https://issues.apache.org/jira/browse/MNG-7204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17487730#comment-17487730 ] S L commented on MNG-7204: -- Thanks for the investigation and determining the root cause! Sorry notifications from maven had been redirected to my spam folder :( If you had mentioned me great, if not it's fine too :) I really don't mind. Whatever you prefer to be honest. Thanks for the fix! > Maven might pick up the wrong configuration when the plugin happens to > include relocation information > - > > Key: MNG-7204 > URL: https://issues.apache.org/jira/browse/MNG-7204 > Project: Maven > Issue Type: Bug >Affects Versions: 3.6.1, 3.8.1 >Reporter: S L >Assignee: Michael Osipov >Priority: Critical > Attachments: MNG-7204.zip, screenshot-1.png > > > h1. Issue Description > The relocation process is outlined in > [here|https://maven.apache.org/guides/mini/guide-relocation.html] and IMHO > boils down to adding the relocation information into the > distributionManagement. > For the sake of experimenting assume we want to relocate a plugin from > {code:java} > com.example.plugins > test-plugin > {code} > to > {code:java} > com.test.plugins > test-plugin-enhanced > {code} > To visualize the issue the plugin needs one configuration parameter (let's > call it helloString). Based on the relocation guide my understanding is that > we need two publications. One under the old coordinates and one under the new > coordinates. > When invoking the plugin with the old coordinates it will **not** pickup our > configuration supplied. Consider: > {code:java} > com.example.plugins > test-plugin > 0.0.1 > > from Maven! > > {code} > h1. Issue Reproducer > Attached I have an example that consists of essentially two parts. On a high > level my understanding is that the the publication under the "old" > coordinates can have a jar ("01_project_old_coordinates_with_jar"), but > doesn't need to have one which would then essentially be a relocation pom > ("01_project_old_coordinates_without_jar"). > The project publication with jar allows to see the expected by running > {code:java} > cd 01_project_old_coordinates_with_jar > mvn clean install > mvn clean package -Pdemo > {code} > which outputs {{Hello from Maven!}} (since this is the setting configured in > the pom). > When the relocation is done ("02_project_new_coordinates") and a new version > under the new coordinates is published (but one still points to the old > configuration) the configuration will not be picked up. > {code:java} > cd 02_project_new_coordinates > # install the SAME version under new coordinates > mvn clean install > # run the demo again which still points to the OLD config > mvn clean package -Pdemo > {code} > which output {{Hello World!}}. World is the default encoded in the Mojo, but > **not** what was provided to the plugin config! > This issue can also be observed when the publication under the old > coordinates is just a relocation pom. > h1. Reproducible under > {code:java} > $ mvn --version > Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; > 2019-04-04T21:00:29+02:00) > Maven home: /usr/share/maven-3.6.1 > Java version: 11.0.11, vendor: Oracle Corporation, runtime: > /usr/lib/jvm/java-11-oracle > Default locale: en_US, platform encoding: UTF-8 > OS name: "linux", version: "5.4.0-77-generic", arch: "amd64", family: "unix" > {code} > {code:java} > $ mvn --version > Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d) > Maven home: /usr/share/maven-3.8.1 > Java version: 11.0.11, vendor: Oracle Corporation, runtime: > /usr/lib/jvm/java-11-oracle > Default locale: en_US, platform encoding: UTF-8 > OS name: "linux", version: "5.4.0-77-generic", arch: "amd64", family: "unix" > {code} > Potentially many other versions. -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (MNG-7204) Maven might pick up the wrong configuration when the plugin happens to include relocation information
[ https://issues.apache.org/jira/browse/MNG-7204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17465241#comment-17465241 ] Michael Osipov commented on MNG-7204: - [~TheSnoozer], I have reused your example in the IT, do you want to be mentioned in the IT commit? > Maven might pick up the wrong configuration when the plugin happens to > include relocation information > - > > Key: MNG-7204 > URL: https://issues.apache.org/jira/browse/MNG-7204 > Project: Maven > Issue Type: Bug >Affects Versions: 3.6.1, 3.8.1 >Reporter: S L >Assignee: Michael Osipov >Priority: Critical > Attachments: MNG-7204.zip, screenshot-1.png > > > h1. Issue Description > The relocation process is outlined in > [here|https://maven.apache.org/guides/mini/guide-relocation.html] and IMHO > boils down to adding the relocation information into the > distributionManagement. > For the sake of experimenting assume we want to relocate a plugin from > {code:java} > com.example.plugins > test-plugin > {code} > to > {code:java} > com.test.plugins > test-plugin-enhanced > {code} > To visualize the issue the plugin needs one configuration parameter (let's > call it helloString). Based on the relocation guide my understanding is that > we need two publications. One under the old coordinates and one under the new > coordinates. > When invoking the plugin with the old coordinates it will **not** pickup our > configuration supplied. Consider: > {code:java} > com.example.plugins > test-plugin > 0.0.1 > > from Maven! > > {code} > h1. Issue Reproducer > Attached I have an example that consists of essentially two parts. On a high > level my understanding is that the the publication under the "old" > coordinates can have a jar ("01_project_old_coordinates_with_jar"), but > doesn't need to have one which would then essentially be a relocation pom > ("01_project_old_coordinates_without_jar"). > The project publication with jar allows to see the expected by running > {code:java} > cd 01_project_old_coordinates_with_jar > mvn clean install > mvn clean package -Pdemo > {code} > which outputs {{Hello from Maven!}} (since this is the setting configured in > the pom). > When the relocation is done ("02_project_new_coordinates") and a new version > under the new coordinates is published (but one still points to the old > configuration) the configuration will not be picked up. > {code:java} > cd 02_project_new_coordinates > # install the SAME version under new coordinates > mvn clean install > # run the demo again which still points to the OLD config > mvn clean package -Pdemo > {code} > which output {{Hello World!}}. World is the default encoded in the Mojo, but > **not** what was provided to the plugin config! > This issue can also be observed when the publication under the old > coordinates is just a relocation pom. > h1. Reproducible under > {code:java} > $ mvn --version > Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; > 2019-04-04T21:00:29+02:00) > Maven home: /usr/share/maven-3.6.1 > Java version: 11.0.11, vendor: Oracle Corporation, runtime: > /usr/lib/jvm/java-11-oracle > Default locale: en_US, platform encoding: UTF-8 > OS name: "linux", version: "5.4.0-77-generic", arch: "amd64", family: "unix" > {code} > {code:java} > $ mvn --version > Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d) > Maven home: /usr/share/maven-3.8.1 > Java version: 11.0.11, vendor: Oracle Corporation, runtime: > /usr/lib/jvm/java-11-oracle > Default locale: en_US, platform encoding: UTF-8 > OS name: "linux", version: "5.4.0-77-generic", arch: "amd64", family: "unix" > {code} > Potentially many other versions. -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (MNG-7204) Maven might pick up the wrong configuration when the plugin happens to include relocation information
[ https://issues.apache.org/jira/browse/MNG-7204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17465229#comment-17465229 ] Michael Osipov commented on MNG-7204: - Digging a bit deeper: The code as such existed eversince, more than 12 years now. I do not really understand why it is necessary to find the plugin in the current project when it is available from {{mojoExecution}}, but on needs a two stage approach: the one done above and one from {{MojoExectuion#getPlugin()}} which is the original element from the POM and not the relocated one. > Maven might pick up the wrong configuration when the plugin happens to > include relocation information > - > > Key: MNG-7204 > URL: https://issues.apache.org/jira/browse/MNG-7204 > Project: Maven > Issue Type: Bug >Affects Versions: 3.6.1, 3.8.1 >Reporter: S L >Assignee: Michael Osipov >Priority: Critical > Attachments: MNG-7204.zip, screenshot-1.png > > > h1. Issue Description > The relocation process is outlined in > [here|https://maven.apache.org/guides/mini/guide-relocation.html] and IMHO > boils down to adding the relocation information into the > distributionManagement. > For the sake of experimenting assume we want to relocate a plugin from > {code:java} > com.example.plugins > test-plugin > {code} > to > {code:java} > com.test.plugins > test-plugin-enhanced > {code} > To visualize the issue the plugin needs one configuration parameter (let's > call it helloString). Based on the relocation guide my understanding is that > we need two publications. One under the old coordinates and one under the new > coordinates. > When invoking the plugin with the old coordinates it will **not** pickup our > configuration supplied. Consider: > {code:java} > com.example.plugins > test-plugin > 0.0.1 > > from Maven! > > {code} > h1. Issue Reproducer > Attached I have an example that consists of essentially two parts. On a high > level my understanding is that the the publication under the "old" > coordinates can have a jar ("01_project_old_coordinates_with_jar"), but > doesn't need to have one which would then essentially be a relocation pom > ("01_project_old_coordinates_without_jar"). > The project publication with jar allows to see the expected by running > {code:java} > cd 01_project_old_coordinates_with_jar > mvn clean install > mvn clean package -Pdemo > {code} > which outputs {{Hello from Maven!}} (since this is the setting configured in > the pom). > When the relocation is done ("02_project_new_coordinates") and a new version > under the new coordinates is published (but one still points to the old > configuration) the configuration will not be picked up. > {code:java} > cd 02_project_new_coordinates > # install the SAME version under new coordinates > mvn clean install > # run the demo again which still points to the OLD config > mvn clean package -Pdemo > {code} > which output {{Hello World!}}. World is the default encoded in the Mojo, but > **not** what was provided to the plugin config! > This issue can also be observed when the publication under the old > coordinates is just a relocation pom. > h1. Reproducible under > {code:java} > $ mvn --version > Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; > 2019-04-04T21:00:29+02:00) > Maven home: /usr/share/maven-3.6.1 > Java version: 11.0.11, vendor: Oracle Corporation, runtime: > /usr/lib/jvm/java-11-oracle > Default locale: en_US, platform encoding: UTF-8 > OS name: "linux", version: "5.4.0-77-generic", arch: "amd64", family: "unix" > {code} > {code:java} > $ mvn --version > Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d) > Maven home: /usr/share/maven-3.8.1 > Java version: 11.0.11, vendor: Oracle Corporation, runtime: > /usr/lib/jvm/java-11-oracle > Default locale: en_US, platform encoding: UTF-8 > OS name: "linux", version: "5.4.0-77-generic", arch: "amd64", family: "unix" > {code} > Potentially many other versions. -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (MNG-7204) Maven might pick up the wrong configuration when the plugin happens to include relocation information
[ https://issues.apache.org/jira/browse/MNG-7204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17465115#comment-17465115 ] Michael Osipov commented on MNG-7204: - I think I have a solution for the problem which uncovers a dynamically replaced vs statically configured issue. Will share soon. > Maven might pick up the wrong configuration when the plugin happens to > include relocation information > - > > Key: MNG-7204 > URL: https://issues.apache.org/jira/browse/MNG-7204 > Project: Maven > Issue Type: Bug >Affects Versions: 3.6.1, 3.8.1 >Reporter: S L >Priority: Critical > Attachments: MNG-7204.zip, screenshot-1.png > > > h1. Issue Description > The relocation process is outlined in > [here|https://maven.apache.org/guides/mini/guide-relocation.html] and IMHO > boils down to adding the relocation information into the > distributionManagement. > For the sake of experimenting assume we want to relocate a plugin from > {code:java} > com.example.plugins > test-plugin > {code} > to > {code:java} > com.test.plugins > test-plugin-enhanced > {code} > To visualize the issue the plugin needs one configuration parameter (let's > call it helloString). Based on the relocation guide my understanding is that > we need two publications. One under the old coordinates and one under the new > coordinates. > When invoking the plugin with the old coordinates it will **not** pickup our > configuration supplied. Consider: > {code:java} > com.example.plugins > test-plugin > 0.0.1 > > from Maven! > > {code} > h1. Issue Reproducer > Attached I have an example that consists of essentially two parts. On a high > level my understanding is that the the publication under the "old" > coordinates can have a jar ("01_project_old_coordinates_with_jar"), but > doesn't need to have one which would then essentially be a relocation pom > ("01_project_old_coordinates_without_jar"). > The project publication with jar allows to see the expected by running > {code:java} > cd 01_project_old_coordinates_with_jar > mvn clean install > mvn clean package -Pdemo > {code} > which outputs {{Hello from Maven!}} (since this is the setting configured in > the pom). > When the relocation is done ("02_project_new_coordinates") and a new version > under the new coordinates is published (but one still points to the old > configuration) the configuration will not be picked up. > {code:java} > cd 02_project_new_coordinates > # install the SAME version under new coordinates > mvn clean install > # run the demo again which still points to the OLD config > mvn clean package -Pdemo > {code} > which output {{Hello World!}}. World is the default encoded in the Mojo, but > **not** what was provided to the plugin config! > This issue can also be observed when the publication under the old > coordinates is just a relocation pom. > h1. Reproducible under > {code:java} > $ mvn --version > Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; > 2019-04-04T21:00:29+02:00) > Maven home: /usr/share/maven-3.6.1 > Java version: 11.0.11, vendor: Oracle Corporation, runtime: > /usr/lib/jvm/java-11-oracle > Default locale: en_US, platform encoding: UTF-8 > OS name: "linux", version: "5.4.0-77-generic", arch: "amd64", family: "unix" > {code} > {code:java} > $ mvn --version > Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d) > Maven home: /usr/share/maven-3.8.1 > Java version: 11.0.11, vendor: Oracle Corporation, runtime: > /usr/lib/jvm/java-11-oracle > Default locale: en_US, platform encoding: UTF-8 > OS name: "linux", version: "5.4.0-77-generic", arch: "amd64", family: "unix" > {code} > Potentially many other versions. -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (MNG-7204) Maven might pick up the wrong configuration when the plugin happens to include relocation information
[ https://issues.apache.org/jira/browse/MNG-7204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17465084#comment-17465084 ] Michael Osipov commented on MNG-7204: - Digging a bit deeper: The code as such existed eversince, more than 12 years now. I do not really understand why it is necessary to find the plugin in the current project when it is available from {{mojoExecution}}, but on needs a two stage approach: the one done above and one from {{MojoExectuion#getPlugin()}} which is the original element from the POM and not the relocated one. > Maven might pick up the wrong configuration when the plugin happens to > include relocation information > - > > Key: MNG-7204 > URL: https://issues.apache.org/jira/browse/MNG-7204 > Project: Maven > Issue Type: Bug >Affects Versions: 3.6.1, 3.8.1 >Reporter: S L >Priority: Critical > Attachments: MNG-7204.zip, screenshot-1.png > > > h1. Issue Description > The relocation process is outlined in > [here|https://maven.apache.org/guides/mini/guide-relocation.html] and IMHO > boils down to adding the relocation information into the > distributionManagement. > For the sake of experimenting assume we want to relocate a plugin from > {code:java} > com.example.plugins > test-plugin > {code} > to > {code:java} > com.test.plugins > test-plugin-enhanced > {code} > To visualize the issue the plugin needs one configuration parameter (let's > call it helloString). Based on the relocation guide my understanding is that > we need two publications. One under the old coordinates and one under the new > coordinates. > When invoking the plugin with the old coordinates it will **not** pickup our > configuration supplied. Consider: > {code:java} > com.example.plugins > test-plugin > 0.0.1 > > from Maven! > > {code} > h1. Issue Reproducer > Attached I have an example that consists of essentially two parts. On a high > level my understanding is that the the publication under the "old" > coordinates can have a jar ("01_project_old_coordinates_with_jar"), but > doesn't need to have one which would then essentially be a relocation pom > ("01_project_old_coordinates_without_jar"). > The project publication with jar allows to see the expected by running > {code:java} > cd 01_project_old_coordinates_with_jar > mvn clean install > mvn clean package -Pdemo > {code} > which outputs {{Hello from Maven!}} (since this is the setting configured in > the pom). > When the relocation is done ("02_project_new_coordinates") and a new version > under the new coordinates is published (but one still points to the old > configuration) the configuration will not be picked up. > {code:java} > cd 02_project_new_coordinates > # install the SAME version under new coordinates > mvn clean install > # run the demo again which still points to the OLD config > mvn clean package -Pdemo > {code} > which output {{Hello World!}}. World is the default encoded in the Mojo, but > **not** what was provided to the plugin config! > This issue can also be observed when the publication under the old > coordinates is just a relocation pom. > h1. Reproducible under > {code:java} > $ mvn --version > Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; > 2019-04-04T21:00:29+02:00) > Maven home: /usr/share/maven-3.6.1 > Java version: 11.0.11, vendor: Oracle Corporation, runtime: > /usr/lib/jvm/java-11-oracle > Default locale: en_US, platform encoding: UTF-8 > OS name: "linux", version: "5.4.0-77-generic", arch: "amd64", family: "unix" > {code} > {code:java} > $ mvn --version > Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d) > Maven home: /usr/share/maven-3.8.1 > Java version: 11.0.11, vendor: Oracle Corporation, runtime: > /usr/lib/jvm/java-11-oracle > Default locale: en_US, platform encoding: UTF-8 > OS name: "linux", version: "5.4.0-77-generic", arch: "amd64", family: "unix" > {code} > Potentially many other versions. -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (MNG-7204) Maven might pick up the wrong configuration when the plugin happens to include relocation information
[ https://issues.apache.org/jira/browse/MNG-7204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17465082#comment-17465082 ] Michael Osipov commented on MNG-7204: - Analyzed, I quite convinced now that this is a dup of MNG-5561. Now, as far as I can see the bug is here: !screenshot-1.png! {{mojoExecution contains the *new* GA, but the project contains the plugin under the *old* GA, same for plugin management. Therefore, the subsequent block is never executed and you run a virgin/vanilla plugin. > Maven might pick up the wrong configuration when the plugin happens to > include relocation information > - > > Key: MNG-7204 > URL: https://issues.apache.org/jira/browse/MNG-7204 > Project: Maven > Issue Type: Bug >Affects Versions: 3.6.1, 3.8.1 >Reporter: S L >Priority: Critical > Attachments: MNG-7204.zip, screenshot-1.png > > > h1. Issue Description > The relocation process is outlined in > [here|https://maven.apache.org/guides/mini/guide-relocation.html] and IMHO > boils down to adding the relocation information into the > distributionManagement. > For the sake of experimenting assume we want to relocate a plugin from > {code:java} > com.example.plugins > test-plugin > {code} > to > {code:java} > com.test.plugins > test-plugin-enhanced > {code} > To visualize the issue the plugin needs one configuration parameter (let's > call it helloString). Based on the relocation guide my understanding is that > we need two publications. One under the old coordinates and one under the new > coordinates. > When invoking the plugin with the old coordinates it will **not** pickup our > configuration supplied. Consider: > {code:java} > com.example.plugins > test-plugin > 0.0.1 > > from Maven! > > {code} > h1. Issue Reproducer > Attached I have an example that consists of essentially two parts. On a high > level my understanding is that the the publication under the "old" > coordinates can have a jar ("01_project_old_coordinates_with_jar"), but > doesn't need to have one which would then essentially be a relocation pom > ("01_project_old_coordinates_without_jar"). > The project publication with jar allows to see the expected by running > {code:java} > cd 01_project_old_coordinates_with_jar > mvn clean install > mvn clean package -Pdemo > {code} > which outputs {{Hello from Maven!}} (since this is the setting configured in > the pom). > When the relocation is done ("02_project_new_coordinates") and a new version > under the new coordinates is published (but one still points to the old > configuration) the configuration will not be picked up. > {code:java} > cd 02_project_new_coordinates > # install the SAME version under new coordinates > mvn clean install > # run the demo again which still points to the OLD config > mvn clean package -Pdemo > {code} > which output {{Hello World!}}. World is the default encoded in the Mojo, but > **not** what was provided to the plugin config! > This issue can also be observed when the publication under the old > coordinates is just a relocation pom. > h1. Reproducible under > {code:java} > $ mvn --version > Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; > 2019-04-04T21:00:29+02:00) > Maven home: /usr/share/maven-3.6.1 > Java version: 11.0.11, vendor: Oracle Corporation, runtime: > /usr/lib/jvm/java-11-oracle > Default locale: en_US, platform encoding: UTF-8 > OS name: "linux", version: "5.4.0-77-generic", arch: "amd64", family: "unix" > {code} > {code:java} > $ mvn --version > Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d) > Maven home: /usr/share/maven-3.8.1 > Java version: 11.0.11, vendor: Oracle Corporation, runtime: > /usr/lib/jvm/java-11-oracle > Default locale: en_US, platform encoding: UTF-8 > OS name: "linux", version: "5.4.0-77-generic", arch: "amd64", family: "unix" > {code} > Potentially many other versions. -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (MNG-7204) Maven might pick up the wrong configuration when the plugin happens to include relocation information
[ https://issues.apache.org/jira/browse/MNG-7204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17465076#comment-17465076 ] Michael Osipov commented on MNG-7204: - I think the first problem here is that you did wrong and changed the packaging type of a plugin from maven-plugin to pom which leads to undefined behavior. The guide is horribly outdated. I think what likely should be done, independent of the relocation is that if the packaging fo the plugin is not what expected it should yield a warn/error. I will check whether it still will lose plugin config when the packaging is correctly retained. > Maven might pick up the wrong configuration when the plugin happens to > include relocation information > - > > Key: MNG-7204 > URL: https://issues.apache.org/jira/browse/MNG-7204 > Project: Maven > Issue Type: Bug >Affects Versions: 3.6.1, 3.8.1 >Reporter: S L >Priority: Critical > Attachments: MNG-7204.zip > > > h1. Issue Description > The relocation process is outlined in > [here|https://maven.apache.org/guides/mini/guide-relocation.html] and IMHO > boils down to adding the relocation information into the > distributionManagement. > For the sake of experimenting assume we want to relocate a plugin from > {code:java} > com.example.plugins > test-plugin > {code} > to > {code:java} > com.test.plugins > test-plugin-enhanced > {code} > To visualize the issue the plugin needs one configuration parameter (let's > call it helloString). Based on the relocation guide my understanding is that > we need two publications. One under the old coordinates and one under the new > coordinates. > When invoking the plugin with the old coordinates it will **not** pickup our > configuration supplied. Consider: > {code:java} > com.example.plugins > test-plugin > 0.0.1 > > from Maven! > > {code} > h1. Issue Reproducer > Attached I have an example that consists of essentially two parts. On a high > level my understanding is that the the publication under the "old" > coordinates can have a jar ("01_project_old_coordinates_with_jar"), but > doesn't need to have one which would then essentially be a relocation pom > ("01_project_old_coordinates_without_jar"). > The project publication with jar allows to see the expected by running > {code:java} > cd 01_project_old_coordinates_with_jar > mvn clean install > mvn clean package -Pdemo > {code} > which outputs {{Hello from Maven!}} (since this is the setting configured in > the pom). > When the relocation is done ("02_project_new_coordinates") and a new version > under the new coordinates is published (but one still points to the old > configuration) the configuration will not be picked up. > {code:java} > cd 02_project_new_coordinates > # install the SAME version under new coordinates > mvn clean install > # run the demo again which still points to the OLD config > mvn clean package -Pdemo > {code} > which output {{Hello World!}}. World is the default encoded in the Mojo, but > **not** what was provided to the plugin config! > This issue can also be observed when the publication under the old > coordinates is just a relocation pom. > h1. Reproducible under > {code:java} > $ mvn --version > Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; > 2019-04-04T21:00:29+02:00) > Maven home: /usr/share/maven-3.6.1 > Java version: 11.0.11, vendor: Oracle Corporation, runtime: > /usr/lib/jvm/java-11-oracle > Default locale: en_US, platform encoding: UTF-8 > OS name: "linux", version: "5.4.0-77-generic", arch: "amd64", family: "unix" > {code} > {code:java} > $ mvn --version > Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d) > Maven home: /usr/share/maven-3.8.1 > Java version: 11.0.11, vendor: Oracle Corporation, runtime: > /usr/lib/jvm/java-11-oracle > Default locale: en_US, platform encoding: UTF-8 > OS name: "linux", version: "5.4.0-77-generic", arch: "amd64", family: "unix" > {code} > Potentially many other versions. -- This message was sent by Atlassian Jira (v8.20.1#820001)
[jira] [Commented] (MNG-7204) Maven might pick up the wrong configuration when the plugin happens to include relocation information
[ https://issues.apache.org/jira/browse/MNG-7204?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17464873#comment-17464873 ] Marcono1234 commented on MNG-7204: -- Might be the same as MNG-5561 > Maven might pick up the wrong configuration when the plugin happens to > include relocation information > - > > Key: MNG-7204 > URL: https://issues.apache.org/jira/browse/MNG-7204 > Project: Maven > Issue Type: Bug >Affects Versions: 3.6.1, 3.8.1 >Reporter: S L >Priority: Critical > Attachments: MNG-7204.zip > > > h1. Issue Description > The relocation process is outlined in > [here|https://maven.apache.org/guides/mini/guide-relocation.html] and IMHO > boils down to adding the relocation information into the > distributionManagement. > For the sake of experimenting assume we want to relocate a plugin from > {code:java} > com.example.plugins > test-plugin > {code} > to > {code:java} > com.test.plugins > test-plugin-enhanced > {code} > To visualize the issue the plugin needs one configuration parameter (let's > call it helloString). Based on the relocation guide my understanding is that > we need two publications. One under the old coordinates and one under the new > coordinates. > When invoking the plugin with the old coordinates it will **not** pickup our > configuration supplied. Consider: > {code:java} > com.example.plugins > test-plugin > 0.0.1 > > from Maven! > > {code} > h1. Issue Reproducer > Attached I have an example that consists of essentially two parts. On a high > level my understanding is that the the publication under the "old" > coordinates can have a jar ("01_project_old_coordinates_with_jar"), but > doesn't need to have one which would then essentially be a relocation pom > ("01_project_old_coordinates_without_jar"). > The project publication with jar allows to see the expected by running > {code:java} > cd 01_project_old_coordinates_with_jar > mvn clean install > mvn clean package -Pdemo > {code} > which outputs {{Hello from Maven!}} (since this is the setting configured in > the pom). > When the relocation is done ("02_project_new_coordinates") and a new version > under the new coordinates is published (but one still points to the old > configuration) the configuration will not be picked up. > {code:java} > cd 02_project_new_coordinates > # install the SAME version under new coordinates > mvn clean install > # run the demo again which still points to the OLD config > mvn clean package -Pdemo > {code} > which output {{Hello World!}}. World is the default encoded in the Mojo, but > **not** what was provided to the plugin config! > This issue can also be observed when the publication under the old > coordinates is just a relocation pom. > h1. Reproducible under > {code:java} > $ mvn --version > Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; > 2019-04-04T21:00:29+02:00) > Maven home: /usr/share/maven-3.6.1 > Java version: 11.0.11, vendor: Oracle Corporation, runtime: > /usr/lib/jvm/java-11-oracle > Default locale: en_US, platform encoding: UTF-8 > OS name: "linux", version: "5.4.0-77-generic", arch: "amd64", family: "unix" > {code} > {code:java} > $ mvn --version > Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d) > Maven home: /usr/share/maven-3.8.1 > Java version: 11.0.11, vendor: Oracle Corporation, runtime: > /usr/lib/jvm/java-11-oracle > Default locale: en_US, platform encoding: UTF-8 > OS name: "linux", version: "5.4.0-77-generic", arch: "amd64", family: "unix" > {code} > Potentially many other versions. -- This message was sent by Atlassian Jira (v8.20.1#820001)