[
https://issues.apache.org/jira/browse/MINSTALL-191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17840341#comment-17840341
]
Tamas Cservenak edited comment on MINSTALL-191 at 4/25/24 7:28 AM:
-------------------------------------------------------------------
This is a user ~~mistake~~ unconventional choice, and cannot be supported well
by Maven repository layout, hence, these things should be avoided. The example
project has 3 artifacts:
{noformat}
at.dvallant.maven:maven-install-plugin-bug:0.1.0-SNAPSHOT (root/parent POM)
at.dvallant.maven:plugins:0.1.0-SNAPSHOT
at.dvalland.maven.plugins:my-maven-plugin:0.1.0-SNAPSHOT{noformat}
Clearly can be seen, that the two overlap: {{at.dwallant.maven:plugins}} (GA)
and {{at.dvallant.maven.plugins}} (G). This means that on disk (mapped by
layout) this directory contains once G level metadata (for
at.dvalland.maven.plugins:my-maven-plugin plugin) and once A level metadata
(for at.dvallant.maven:plugins artifact). These situations should be avoided.
was (Author: cstamas):
This is a user mistake, and cannot be supported well by Maven repository
layout, hence, these things should be avoided. The example project has 3
artifacts:
{noformat}
at.dvallant.maven:maven-install-plugin-bug:0.1.0-SNAPSHOT (root/parent POM)
at.dvallant.maven:plugins:0.1.0-SNAPSHOT
at.dvalland.maven.plugins:my-maven-plugin:0.1.0-SNAPSHOT{noformat}
Clearly can be seen, that the two overlap: {{at.dwallant.maven:plugins}} (GA)
and {{at.dvallant.maven.plugins}} (G). This means that on disk (mapped by
layout) this directory contains once G level metadata (for
at.dvalland.maven.plugins:my-maven-plugin plugin) and once A level metadata
(for at.dvallant.maven:plugins artifact). These situations should be avoided.
> Metadata for submodules seems to be incomplete
> ----------------------------------------------
>
> Key: MINSTALL-191
> URL: https://issues.apache.org/jira/browse/MINSTALL-191
> Project: Maven Install Plugin
> Issue Type: Bug
> Components: install:install
> Affects Versions: 3.0.0-M1, 3.0.0, 3.1.0, 3.1.1
> Environment: Apache Maven 3.8.8
> (4c87b05d9aedce574290d1acc98575ed5eb6cd39)
> Java version: 11.0.18, vendor: Eclipse Adoptium
> Default locale: en_US, platform encoding: UTF-8
> OS name: "linux", version: "5.15.0-83-generic", arch: "amd64", family: "unix"
> Reporter: Dorian Vallant
> Priority: Major
> Attachments: maven-install-plugin-bug.tgz
>
>
> maven-install-plugin 3.x (and maven-deploy-plugin 3.x too) seems to have a
> bug when generating maven-metadata-*.xml for submodules containing custom
> maven-plugins.
> With version 2.5.2 maven-install-plugin generates the local metadata as
> follows:
> {code:xml}
> <?xml version="1.0" encoding="UTF-8"?>
> <metadata>
> <groupId>at.dvallant.maven</groupId>
> <artifactId>plugins</artifactId>
> <versioning>
> <versions>
> <version>0.1.0-SNAPSHOT</version>
> </versions>
> <lastUpdated>20230831082036</lastUpdated>
> </versioning>
> <plugins>
> <plugin>
> <name>my-maven-plugin</name>
> <prefix>my</prefix>
> <artifactId>my-maven-plugin</artifactId>
> </plugin>
> </plugins>
> </metadata>
> {code}
>
> After upgrading to 3.1.1 (also testet with 3.0.0-M1, 3.0.0 and 3.1.0) the
> generated file looks this:
> {code:xml}
> <metadata>
> <groupId>at.dvallant.maven</groupId>
> <artifactId>plugins</artifactId>
> <versioning>
> <versions>
> <version>0.1.0-SNAPSHOT</version>
> </versions>
> <lastUpdated>20230831082207</lastUpdated>
> </versioning>
> </metadata>
> {code}
> A test-project to reproduce the issue is attached.
> To reproduce build the project by calling `mvn clean install` and then check
> the contents of
> `~/.m2/repository/at/dvallant/maven/plugins/maven-metadata-local.xml`.
> If you downgrade the version to 2.5.2, metadata generation works as expected.
> If you could give me a hint where the problem might be in the code I can try
> to fix it and open a pull request.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)