8000 mvnup apply --infer removes groupId which results in failing build · Issue #11135 · apache/maven · GitHub
[go: up one dir, main page]

Skip to content

mvnup apply --infer removes groupId which results in failing build #11135

@khmarbaise

Description

@khmarbaise

Affected version

Maven 4.0.0-rc-4

Bug description

I'm using the following example project to demonstrate the issue:

https://github.com/khmarbaise/javaee-example

Maven Version

Built Maven from maven-4.0.xbranch with the following commit a86a182

First I do

mvnup apply --model-version 4.1.0

which correctly upgrades the modelVersion.
The next step is to apply changes like this:

mvnup apply --infer

That will remove groupId entries in the pom files, also drops the GAV in the parent, for example:

$> git di app/pom.xml 
diff --git a/app/pom.xml b/app/pom.xml
index dd54f13..6045600 100644
--- a/app/pom.xml
+++ b/app/pom.xml
@@ -1,11 +1,8 @@
-<project xmlns="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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+<project 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 https://maven.apache.org/xsd/maven-4.1.0.xsd">
 
-  <modelVersion>4.0.0</modelVersion>
+  
 
   <parent>
-    <groupId>com.soebes.examples.j2ee</groupId>
-    <artifactId>jee-parent</artifactId>
-    <version>1.2.7-SNAPSHOT</version>
   </parent>
 
   <artifactId>app</artifactId>
@@ -24,7 +21,6 @@
       <version>${project.version}</version>
     </dependency>
     <dependency>
-      <groupId>com.soebes.examples.j2ee</groupId>
       <artifactId>service</artifactId>
       <version>${project.version}</version>
       <type>ejb</type>
$> 

this is also applied to other pom files in subprojects.. but that unfortunately results in failing like this:

$> mvn clean
[INFO] 
[INFO] 1 problem was encountered while building the effective settings (use -e to see details)
[INFO] 
[INFO] Scanning for projects...
[ERROR] Some problems were encountered while processing the POMs
[ERROR] The build could not read 5 projects -> [Help 1]
[ERROR]   
[ERROR]   The project com.soebes.examples.j2ee:app:1.2.7-SNAPSHOT (/Users/khm/ws-git-soebes/javaee/app/pom.xml) has 1 error
[ERROR]     'dependencies.dependency.groupId' for groupId=, artifactId='service', type='ejb' is missing. @ [unknown-group-id]:app:[unknown-version], file:///Users/khm/ws-git-soebes/javaee/app/pom.xml, line 23, column 5
[ERROR]   
[ERROR]   The project com.soebes.examples.j2ee:assembly:1.2.7-SNAPSHOT (/Users/khm/ws-git-soebes/javaee/assembly/pom.xml) has 5 errors
[ERROR]     'dependencies.dependency.groupId' for groupId=, artifactId='webgui', type='war' is missing. @ [unknown-group-id]:assembly:[unknown-version], file:///Users/khm/ws-git-soebes/javaee/assembly/pom.xml, line 12, column 5
[ERROR]     'dependencies.dependency.groupId' for groupId=, artifactId='app', type='ear' is missing. @ [unknown-group-id]:assembly:[unknown-version], file:///Users/khm/ws-git-soebes/javaee/assembly/pom.xml, line 17, column 5
[ERROR]     'dependencies.dependency.groupId' for groupId=, artifactId='service', type='ejb' is missing. @ [unknown-group-id]:assembly:[unknown-version], file:///Users/khm/ws-git-soebes/javaee/assembly/pom.xml, line 22, column 5
[ERROR]     'dependencies.dependency.groupId' for groupId=, artifactId='shade', classifier='dev', type='jar' is missing. @ [unknown-group-id]:assembly:[unknown-version], file:///Users/khm/ws-git-soebes/javaee/assembly/pom.xml, line 27, column 5
[ERROR]     'dependencies.dependency.groupId' for groupId=, artifactId='shade', classifier='prod', type='jar' is missing. @ [unknown-group-id]:assembly:[unknown-version], file:///Users/khm/ws-git-soebes/javaee/assembly/pom.xml, line 32, column 5
[ERROR]   
[ERROR]   The project com.soebes.examples.j2ee:shade:1.2.7-SNAPSHOT (/Users/khm/ws-git-soebes/javaee/shade/pom.xml) has 1 error
[ERROR]     'dependencies.dependency.groupId' for groupId=, artifactId='domain', type='jar' is missing. @ [unknown-group-id]:shade:[unknown-version], file:///Users/khm/ws-git-soebes/javaee/shade/pom.xml, line 11, column 5
[ERROR]   
[ERROR]   The project com.soebes.examples.j2ee:service-client:1.2.7-SNAPSHOT (/Users/khm/ws-git-soebes/javaee/service-client/pom.xml) has 1 error
[ERROR]     'dependencies.dependency.groupId' for groupId=, artifactId='domain', type='jar' is missing. @ [unknown-group-id]:service-client:[unknown-version], file:///Users/khm/ws-git-soebes/javaee/service-client/pom.xml, line 11, column 5
[ERROR]   
[ERROR]   The project com.soebes.examples.j2ee:appasm:1.2.7-SNAPSHOT (/Users/khm/ws-git-soebes/javaee/appasm/pom.xml) has 2 errors
[ERROR]     'dependencies.dependency.groupId' for groupId=, artifactId='webgui', type='war' is missing. @ [unknown-group-id]:appasm:[unknown-version], file:///Users/khm/ws-git-soebes/javaee/appasm/pom.xml, line 12, column 5
[ERROR]     'dependencies.dependency.groupId' for groupId=, artifactId='service', type='ejb' is missing. @ [unknown-group-id]:appasm:[unknown-version], file:///Users/khm/ws-git-soebes/javaee/appasm/pom.xml, line 17, column 5
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the '-e' switch
[ERROR] Re-run Maven using the '-X' switch to enable verbose output
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException

Maven 4.0.0-rc-4

Using Maven 4.0.0-rc-4 it fails with the following (difference between Maven 4.0.0-rc-4 and the maven-4.0.x branch...

$> mvn clean
[INFO] 
[INFO] 1 problem was encountered while building the effective settings (use -e to see details)
[INFO] 
[INFO] Scanning for projects...
[ERROR] Some problems were encountered while processing the POMs
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project (/Users/khm/ws-git-soebes/javaee/pom.xml) has 2 errors
[ERROR]     'parent.artifactId' is missing. @ com.soebes.examples.j2ee:jee-parent:1.2.7-SNAPSHOT, file:///Users/khm/ws-git-soebes/javaee/pom.xml, line 5, column 3
[ERROR]     Failed to load project /Users/khm/ws-git-soebes/javaee/pom.xml: 1 problem was 
[ERROR]         - [FATAL] 'parent.artifactId' is missing. @ line 5, column 3
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the '-e' switch
[ERROR] Re-run Maven using the '-X' switch to enable verbose output
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0