[jira] [Comment Edited] (MNG-7920) Usage of packaging BOM fails in maven-install-plugin

2023-11-18 Thread Karl Heinz Marbaise (Jira)


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

Karl Heinz Marbaise edited comment on MNG-7920 at 11/18/23 2:14 PM:


So after diving a bit deeper into this... it looks like the resulting 
{{pom.xml}} should be made the main artifact of the {{bom}} packaged project 
because in the end it's the main artifact of the module. For example if we have 
a normal pom packaged module it works the same. The {{maven-install-plugin}} 
already WARNs exactly about that. Furthermore is my opinion that the 
{{maven-install-plugin}} should not needed to be changed because the main 
artifact is the resulting {{{}pom{}}}. 
So the core should assign the interpolated (bom) as the main artifact 
(packaging: pom) while the {{pom-build}} is already attached as classifier 
based artifacts.

I created a full reproducer to look more in detail on the problems:

Lets start with the {{bom}} packaging module which contains the following 
(original pom):
{code:xml}
  
maven.four.bug.7920
bom-example
  

  bom
  bom
  Maven Bug :: 7920 :: BOM

  

  
maven.four.bug.7920
mod-1
  
  
maven.four.bug.7920
mod-2
  

  
..
{code}
So the above {{pom.xml}} is converted into {{pom}} packaging based 
{{{}pom.xml{}}}.. it looks like this:
{code:xml}

http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
https://maven.apache.org/xsd/maven-4.0.0.xsd";>
  4.0.0
  maven.four.bug.7920
  bom
  1.0.0-SNAPSHOT
  pom
  Maven Bug :: 7920 :: BOM
  

  
maven.four.bug.7920
mod-1
  
  
maven.four.bug.7920
mod-2
  
  
org.junit.jupiter
junit-jupiter
5.10.1
  

  
org.assertj
assertj-core
3.24.2
  
  
org.assertj
assertj-guava
3.24.2
  
...

  

{code}
The list of issues I found from my point of view:
 # So the first issue I can identify is that the integrated artifacts:
{code:xml}
  
maven.four.bug.7920
mod-1
  
  
maven.four.bug.7920
mod-2
  
{code}
do not contain a version number.

 # The second issue I can identify is that it contains all bom's resolved which 
are from the module parent (see junit-jupiter, assertj, mockito), but *not* the 
test scoped dependencies of the {{mod-1}} (added a dependency to 
{{junit:junit:4.13.2}} and a non test scoped dependency 
{{{}commons-collections:commons-collections:3.2.2{}}}.

>From my point of view the resulting {{pom.xml}} should look like this:
{code:xml}

http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
https://maven.apache.org/xsd/maven-4.0.0.xsd";>
  4.0.0
  maven.four.bug.7920
  bom
  1.0.0-SNAPSHOT
  pom
  Maven Bug :: 7920 :: BOM
  

  
maven.four.bug.7920
mod-1
1.0.0-SNAPSHOT
  
  
maven.four.bug.7920
mod-2
1.0.0-SNAPSHOT
  

  

{code}
It should contain things like: URL, name, organization, developers, licenses, 
issueManagement, ciManagement(no),distributionManagement(no), repositories (no)

The link to the full repoducer: 
[https://github.com/khmarbaise/maven-bugs/tree/master/MNG-7920]


was (Author: khmarbaise):
So after diving a bit deeper into this... it looks like the resulting 
{{pom.xml}} should be made the main artifact of the {{bom}} packaged project 
because in the end it's the main artifact of the module. For example if we have 
a normal pom packaged module it works the same. The {{maven-install-plugin}} 
already WARNs exactly about that. Furthermore is my opinion that the 
{{maven-install-plugin}} should not needed to be changed because the main 
artifact is the resulting {{{}pom{}}}. 
So the core should assign the interpolated (bom) as the main artifact 
(packaging: pom) while the {{pom-build}} is already attached as classifier 
based artifacts.

I created a full reproducer to look more in detail on the problems:

Lets start with the {{bom}} packaging module which contains the following 
(original pom):
{code:xml}
  
maven.four.bug.7920
bom-example
  

  bom
  bom
  Maven Bug :: 7920 :: BOM

  

  
maven.four.bug.7920
mod-1
  
  
maven.four.bug.7920
mod-2
  

  
..
{code}
So the above {{pom.xml}} is converted into {{pom}} packaging based 
{{{}pom.xml{}}}.. it looks like this:
{code:xml}

http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
https://maven.apache.org/xsd/maven-4.0.0.xsd";>
  4.0.0
  maven.four.bug.7920
  bom
  1

[jira] [Comment Edited] (MNG-7920) Usage of packaging BOM fails in maven-install-plugin

2023-11-18 Thread Karl Heinz Marbaise (Jira)


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

Karl Heinz Marbaise edited comment on MNG-7920 at 11/18/23 2:10 PM:


So after diving a bit deeper into this... it looks like the resulting 
{{pom.xml}} should be made the main artifact of the {{bom}} packaged project 
because in the end it's the main artifact of the module. For example if we have 
a normal pom packaged module it works the same. The {{maven-install-plugin}} 
already WARNs exactly about that. Furthermore is my opinion that the 
{{maven-install-plugin}} should not needed to be changed because the main 
artifact is the resulting {{{}pom{}}}. 
So the core should assign the interpolated (bom) as the main artifact 
(packaging: pom) while the {{pom-build}} is already attached as classifier 
based artifacts.

I created a full reproducer to look more in detail on the problems:

Lets start with the {{bom}} packaging module which contains the following 
(original pom):
{code:xml}
  
maven.four.bug.7920
bom-example
  

  bom
  bom
  Maven Bug :: 7920 :: BOM

  

  
maven.four.bug.7920
mod-1
  
  
maven.four.bug.7920
mod-2
  

  
..
{code}
So the above {{pom.xml}} is converted into {{pom}} packaging based 
{{{}pom.xml{}}}.. it looks like this:
{code:xml}

http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
https://maven.apache.org/xsd/maven-4.0.0.xsd";>
  4.0.0
  maven.four.bug.7920
  bom
  1.0.0-SNAPSHOT
  pom
  Maven Bug :: 7920 :: BOM
  

  
maven.four.bug.7920
mod-1
  
  
maven.four.bug.7920
mod-2
  
  
org.junit.jupiter
junit-jupiter
5.10.1
  

  
org.assertj
assertj-core
3.24.2
  
  
org.assertj
assertj-guava
3.24.2
  
...

  

{code}
The list of issues I found from my point of view:
 # So the first issue I can identify is that the integrated artifacts:
{code:xml}
  
maven.four.bug.7920
mod-1
  
  
maven.four.bug.7920
mod-2
  
{code}
do not contain a version number.

 # The second issue I can identify is that it contains all bom's resolved which 
are from the module parent (see junit-jupiter, assertj, mockito), but 
*{*}not{*}* the test scoped dependencies of the {{mod-1}} (added a dependency 
to {{junit:junit:4.13.2}} and a non test scoped dependency 
{{{}commons-collections:commons-collections:3.2.2{}}}.

>From my point of view the resulting {{pom.xml}} should look like this:
{code:xml}

http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
https://maven.apache.org/xsd/maven-4.0.0.xsd";>
  4.0.0
  maven.four.bug.7920
  bom
  1.0.0-SNAPSHOT
  pom
  Maven Bug :: 7920 :: BOM
  

  
maven.four.bug.7920
mod-1
1.0.0-SNAPSHOT
  
  
maven.four.bug.7920
mod-2
1.0.0-SNAPSHOT
  

  

{code}
It should contain things like: URL, name, organization, developers, licenses, 
issueManagement, ciManagement(no),distributionManagement(no), repositories (no)

The link to the full repoducer: 
[https://github.com/khmarbaise/maven-bugs/tree/master/MNG-7920]


was (Author: khmarbaise):
So after diving a bit deeper into this... it looks like the resulting 
{{pom.xml}} should be made the main artifact of the {{bom}} packaged project 
because in the end it's the main artifact of the module. For example if we have 
a normal pom packaged module it works the same. The {{maven-install-plugin}} 
already WARNs exactly about that. Furthermore is my opinion that the 
{{maven-install-plugin}} should not needed to be changed because the main 
artifact is the resulting {{pom}}. 
So the core should assign the interpolated (bom) as the main artifact 
(packaging: pom) while the {{pom-build}} is already attached as classifier 
based artifacts.

I created a full reproducer to look more in detail on the problems:

Lets start with the {{bom}} packaging module which contains the following 
(original pom):
{code:xml}
  
maven.four.bug.7920
bom-example
  

  bom
  bom
  Maven Bug :: 7920 :: BOM

  

  
maven.four.bug.7920
mod-1
  
  
maven.four.bug.7920
mod-2
  

  
..
{code}

So the above {{pom.xml}} is converted into {{pom}} packaging based 
{{pom.xml}}.. it looks like this:

{code:xml}

http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
https://maven.apache.org/xsd/maven-4.0.0.xsd";>
  4.0.0
  maven.four.bug.7920
  bom
  1

[jira] [Comment Edited] (MNG-7920) Usage of packaging BOM fails in maven-install-plugin

2023-11-18 Thread Zhongming Hua (Jira)


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

Zhongming Hua edited comment on MNG-7920 at 11/18/23 1:50 PM:
--

Thank you for testing and replying to my PR. I have some questions about two 
issues you mentioned:
 # I found that neither the *pom* nor the *bom* would automatically parse and 
include the version. Does that mean *pom* has the same problem?
 # At present, the pom will contain all bom's resolved which are from the 
module parent. But we expect that the bom does not contain all bom's resolved 
which are from the module parent, right?

[~khmarbaise] 

 


was (Author: crazyhzm):
Thank you for testing and replying to my PR. I have some questions about two 
issues you mentioned:
 # I found that neither the *pom* nor the *bom* would automatically parse and 
include the version.
 # At present, the pom will contain all bom's resolved which are from the 
module parent. But we expect that the bom does not contain all bom's resolved 
which are from the module parent, right?

[~khmarbaise] 

 

> Usage of packaging BOM fails in maven-install-plugin
> 
>
> Key: MNG-7920
> URL: https://issues.apache.org/jira/browse/MNG-7920
> Project: Maven
>  Issue Type: Bug
>  Components: Deployment
>Affects Versions: 4.0.0-alpha-8
>Reporter: Karl Heinz Marbaise
>Priority: Critical
> Fix For: 4.0.0, 4.0.0-alpha-9
>
>
> Using to use the {{bom}} packaging in a module it will fail with:
> {code}
> [INFO] 
> --
> [ERROR] Failed to execute goal 
> org.apache.maven.plugins:maven-install-plugin:3.1.1:install (default-install) 
> on project bom: The packaging plugin for this project did not assign a main 
> file to the project but it has attachments. Change packaging to 'pom'. -> 
> [Help 1]
> {code}
> The bom module looks like this:
> {code:xml}
>xmlns="http://maven.apache.org/POM/4.1.0";
>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>   xsi:schemaLocation="http://maven.apache.org/POM/4.1.0 
> http://maven.apache.org/maven-v4_1_0.xsd";>
>   4.1.0
>   
> maven4
> bom-example
>   
>   bom
>   bom
>   
> 
>   
>   ...maven4
>   mod-1
>   
>   
>   maven4
>   mod-2
>   
> 
>   
> 
> {code}
> I would assume that I need to upgrade the maven-install-plugin which is 
> capable of handling that...but I assumed that this conversion is done by core?



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