You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Tamas Cservenak (Jira)" <ji...@apache.org> on 2024/08/14 14:21:00 UTC
[jira] [Comment Edited] (MINSTALL-201) Regression in 3.1.2 when installing pom artifact
[ https://issues.apache.org/jira/browse/MINSTALL-201?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17873555#comment-17873555 ]
Tamas Cservenak edited comment on MINSTALL-201 at 8/14/24 2:20 PM:
-------------------------------------------------------------------
This is not install/deploy plugin bug, but Maven bug: MNG-8138
In short, when MNG-8138 is fixed your project will fail, and reason is following:
Your module kohlschutter-parent-multirelease declares packaging=pom in POM, but despite that it builds a JAR and _attaches it as main JAR_. This brings Maven inner state into "invalid state": a project that is packaging=pom, but has attached a JAR as main artifact. This should not happen.
Workaround for now: skip jar plugin in module kohlschutter-parent-multirelease.
was (Author: cstamas):
This is not install/deploy plugin bug, but Maven bug: MNG-8138
In short, when MNG-8138 is fixed your project will fail, and reason is following:
You module kohlschutter-parent-multirelease declares packaging=pom in POM, but despite that is builds a JAR and _attaches it as main JAR_. This brings Maven inner state "invalid" (a project that is packaging=pom and has a JAR as main artifact).
Workaround for now: skip jar plugin in module kohlschutter-parent-multirelease.
> Regression in 3.1.2 when installing pom artifact
> ------------------------------------------------
>
> Key: MINSTALL-201
> URL: https://issues.apache.org/jira/browse/MINSTALL-201
> Project: Maven Install Plugin
> Issue Type: Bug
> Affects Versions: 3.1.2
> Environment: macOS 14.5, Maven 3.9.8; probably any
> Reporter: Christian Kohlschütter
> Priority: Blocker
> Fix For: 3.1.3
>
>
> With 3.1.2, I'm seeing wrong artifact metadata (POM files) being installed for POM-packaged artifacts in a multi-module project.
> Prior to 3.1.2, we were excluding some operations in InstallMojo.java when a project's packaging was "pom". The check got removed, leading to ".pom" artifact files being installed as some sort of zip file (yet having the ".pom" file suffix).
> This breaks all sorts of things for me, effectively rendering version 3.1.2 unusable.
> Patch forthcoming.
> To reproduce:
> {code:java}
> git clone git@github.com:kohlschutter/kohlschutter-parent.git
> git checkout kohlschutter-parent-1.7.2
> cd kohlschutter-parent
> mvn clean install -Dignorant -DskipTests
> file $HOME/.m2/repository/com/kohlschutter/kohlschutter-parent-multirelease/1.7.2/kohlschutter-parent-multirelease-1.7.2.pom
> # the above command should return something like "XML 1.0 document text, ASCII text"
> #
> # now change maven-install-plugin dependency version in kohlschutter-parent's pom.xml from 3.1.1 to 3.1.2
> mvn clean install -Dignorant -DskipTests
> file $HOME/.m2/repository/com/kohlschutter/kohlschutter-parent-multirelease/1.7.2/kohlschutter-parent-multirelease-1.7.2.pom
> #
> # the above command now returns something like "Zip archive data, at least v1.0 to extract, compression method=store"
> #
> # contents of the zip file:
> # META-INF/
> # META-INF/MANIFEST.MF
> # META-INF/maven/
> # META-INF/maven/com.kohlschutter/
> # META-INF/maven/com.kohlschutter/kohlschutter-parent-multirelease/
> # META-INF/maven/com.kohlschutter/kohlschutter-parent-multirelease/pom.xml
> # META-INF/maven/com.kohlschutter/kohlschutter-parent-multirelease/pom.properties}}
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)