gnodet opened a new issue, #12085:
URL: https://github.com/apache/maven/issues/12085

   ## Description
   
   When building projects that inherit their version from a remote parent POM 
(with `<relativePath/>`), Maven 4 fails with `Invalid Collect Request: null` 
during dependency collection. The root artifact passed to 
`CollectRequest.setRootArtifact()` is null.
   
   This affects projects where `mvnup --infer` removes the child version 
because it matches the parent version. After removal, Maven 4 should inherit 
the version from the remote parent, but the project artifact appears to not be 
properly initialized.
   
   ## Steps to Reproduce
   
   1. Build `apache/causeway-app-helloworld` with Maven 4 after running `mvnup 
apply`
   2. mvnup removes `<version>3.6.0</version>` from child POM because it 
matches parent
   3. The POM has:
      ```xml
      <parent>
          <groupId>org.apache.causeway.app</groupId>
          <artifactId>causeway-app-starter-parent</artifactId>
          <version>3.6.0</version>
          <relativePath/>
      </parent>
      <artifactId>helloworld-jpa</artifactId>
      <groupId>org.apache.causeway.starters</groupId>
      <!-- version removed by mvnup inference, inherited from parent -->
      ```
   
   ## Error
   
   ```
   [ERROR] Invalid Collect Request: null -> 
[org.apache.causeway.mavendeps:causeway-mavendeps-webapp:pom:3.6.0 (compile), 
...] < [central (...), staging (...)]
   java.lang.IllegalArgumentException: Invalid Collect Request: null -> [...]
       at 
org.eclipse.aether.internal.impl.DefaultRepositorySystemValidator.mayThrow(DefaultRepositorySystemValidator.java:62)
       at 
org.eclipse.aether.internal.impl.DefaultRepositorySystemValidator.validateCollectRequest(DefaultRepositorySystemValidator.java:220)
       at 
org.eclipse.aether.internal.impl.DefaultRepositorySystem.collectDependencies(DefaultRepositorySystem.java:246)
       at 
org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(DefaultProjectDependenciesResolver.java:158)
   ```
   
   ## Affected Projects
   
   - `causeway-app-helloworld`
   - `causeway-app-petclinic`
   - `causeway-app-simpleapp`
   
   All inherit from `causeway-app-starter-parent:3.6.0` → 
`spring-boot-starter-parent:3.5.13`.
   
   ## Analysis
   
   In `DefaultProjectDependenciesResolver.resolve()` (line 98):
   ```java
   collect.setRootArtifact(RepositoryUtils.toArtifact(project.getArtifact()));
   ```
   
   `project.getArtifact()` returns null, so `RepositoryUtils.toArtifact()` 
returns null (line 136-138).
   
   The model building succeeds (dependencies have proper versions like 3.6.0 
and 3.5.13), so the project model IS correctly built with inherited version. 
But the project artifact is not initialized.
   
   Notable: the child POM has a DIFFERENT `groupId` from the parent, and uses 
`<relativePath/>` (empty, resolve from repo).
   
   _Claude Code on behalf of Guillaume Nodet_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to