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

   ## Summary
   
   Maven 4 fails builds when a transitive dependency's POM contains 
uninterpolated expressions in repository definitions (e.g., 
`${eclipseP2RepoId}` as a repository ID). Maven 3 silently ignored these. The 
consuming project has no control over third-party POM content.
   
   ## Reproduction
   
   Build [apache/opennlp](https://github.com/apache/opennlp) with Maven 4:
   
   ```
   mvn package -DskipTests
   ```
   
   ### Expected
   
   Build succeeds (as it does with Maven 3). Unresolvable transitive 
repositories are silently skipped or produce a warning.
   
   ### Actual
   
   Build fails with:
   
   ```
   Caused by: java.lang.IllegalArgumentException: Invalid RemoteRepositories: 
[central (...), 
     ApacheIncubatorRepository (...), apache.snapshots (...), 
     ${eclipseP2RepoId} (https://download.eclipse.org/releases/2022-09/, p2, 
releases+snapshots)]
       Suppressed: java.lang.IllegalArgumentException: Not fully interpolated 
remote repository 
         ${eclipseP2RepoId} (https://download.eclipse.org/releases/2022-09/, 
p2, releases+snapshots)
       at 
org.apache.maven.impl.resolver.validator.MavenValidator.validateDependency(MavenValidator.java:72)
       at 
org.eclipse.aether.internal.impl.DefaultRepositorySystemValidator.validateCollectRequest(...)
   ```
   
   ### Key difference from #11920
   
   Issue #11920 is about uninterpolated expressions in the **project's own** 
profile-scoped repositories, where the properties are defined in the profile's 
`<properties>` but injected after validation.
   
   This issue is about uninterpolated expressions in **transitive dependency 
POMs** — repositories contributed by third-party dependencies during dependency 
collection. The consuming project has no control over these POMs and cannot fix 
them.
   
   The `${eclipseP2RepoId}` expression is not defined anywhere in the opennlp 
project. It comes from a transitive dependency's POM that was presumably built 
with a Tycho/Eclipse setup where this property was provided at build time. The 
published POM on Maven Central contains the unresolved expression.
   
   ## Affected projects
   
   From maven4-testing across ~960 Apache repositories:
   - apache/opennlp — https://github.com/gnodet/maven4-testing/issues/10104
   - apache/opennlp-sandbox — 
https://github.com/gnodet/maven4-testing/issues/10117
   
   ## Proposed behavior
   
   1. **Skip** transitive repositories with unresolvable expressions (they 
can't be useful in the consuming project's context anyway)
   2. **Warn** with an actionable message identifying the source dependency:
      ```
      [WARNING] Ignoring repository '${eclipseP2RepoId}' from 
org.example:some-dep:1.0 — 
        repository ID contains uninterpolated expression.
      ```
   3. Make the warning **suppressible** for projects that are aware and don't 
want noise
   
   ## Environment
   
   - Maven: 4.0.0-SNAPSHOT (branch `maven-4.0.x-test-fixes`, commit 6c192d4d61)
   - Java: 17.0.18 (Eclipse Adoptium)
   - OS: Ubuntu (GitHub Actions)
   
   _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