maven icon indicating copy to clipboard operation
maven copied to clipboard

3.9.12 nightly breaks Tycho Maven plugin

Open oehme opened this issue 1 month ago • 9 comments

Affected version

3.9.12

Bug description

Tycho uses RepositorySystem in many places. With Maven 3.9.11, Tycho projects build normally. With Maven 3.9.12, they fail to resolve dependencies. There is no stacktrace from the resolve, it simply says that none of my dependencies could be found.

I'm pretty sure this is due to https://github.com/apache/maven/commit/3afbdb8f7653125c82495411f07999f7a6a2672d#diff-64f7dba44bfc4bf654efbd092058718253adde1449ce9fc63ac5531fba20a071

This change probably means that Tycho can't see the repositores declared in the POM anymore and so it doesn't know where to search.

Here's a breakdown of all the places where Tycho still uses this interface: https://github.com/search?q=repo%3Aeclipse-tycho%2Ftycho+repositorysystem&type=code

I think there needs to be a longer deprecation period before you can break this class like that.

oehme avatar Nov 26 '25 17:11 oehme

Which Tycho version is affected.

RepositorySystem is still available,

One change in mentioned commit is replace RepositorySystem by MavenRepositorySystem in DefaultProjectBuildingHelper

slawekjaranowski avatar Nov 26 '25 17:11 slawekjaranowski

One change in mentioned commit is replace RepositorySystem by MavenRepositorySystem in DefaultProjectBuildingHelper

Yes, and I assume this means that the old RepositorySystem no longer gets the repositories declared in the project. So all users of it are now broken.

Which Tycho version is affected.

All. Tried 4.0.13, 5.0.0, 6.0.0-SNAPSHOT

oehme avatar Nov 26 '25 17:11 oehme

Probably I have, in: MavenRepositorySystem we have:

    public ArtifactRepository buildArtifactRepository(org.apache.maven.model.Repository repo)
            throws InvalidRepositoryException {
....
            ArtifactRepositoryLayout layout = new DefaultRepositoryLayout(); <---- layout should be taken from repository

            return createArtifactRepository(id, url, layout, snapshots, releases);
....
    }

slawekjaranowski avatar Nov 26 '25 18:11 slawekjaranowski

The same is in Maven 4.x code:

  • https://github.com/apache/maven/blob/d749fbca7f14000c657c9c7880554db389bd2dba/impl/maven-core/src/main/java/org/apache/maven/bridge/MavenRepositorySystem.java#L346
  • https://github.com/apache/maven/blob/a6c85f15f15734d132d6513fc9e9e02b9748a4c3/impl/maven-core/src/main/java/org/apache/maven/bridge/MavenRepositorySystem.java#L346

@oehme can you try Maven 4, eg 4.0.0-rc-5

slawekjaranowski avatar Nov 26 '25 21:11 slawekjaranowski

In my test it is the same for 4.x

slawekjaranowski avatar Nov 26 '25 22:11 slawekjaranowski

Yep, same issue in Maven 4.x for me too. Attaching a super simple repro.

tycho-repro.zip

oehme avatar Nov 27 '25 10:11 oehme

with attached project and 4.0.0-rc-5 I have:

Apache Maven 4.0.0-rc-5 (fb3ecaef88106acb40467a450248dfdbd75f3b35)
Maven home: /Users/slawomir.jaranowski/.sdkman/candidates/maven/4.0.0-rc-5
Java version: 21.0.9, vendor: Eclipse Adoptium, runtime: /Users/slawomir.jaranowski/.sdkman/candidates/java/21.0.9-tem
Default locale: en_PL, platform encoding: UTF-8
OS name: "mac os x", version: "15.7.1", arch: "aarch64", family: "mac"
[WARNING] Unable to find the root directory. Create a .mvn directory in the root directory or add the root="true" attribute on the root project's model to identify it.
[INFO] Scanning for projects...
[INFO] Loaded 21718 auto-discovered prefixes for remote repository central (prefixes-central.txt)
[INFO] Loaded 74 auto-discovered prefixes for remote repository apache.snapshots (prefixes-apache.snapshots-c1d4c55f9308e5ac18a4069bed41dca64d85c515.txt)
[WARNING] Error injecting: org.eclipse.tycho.p2resolver.DefaultTargetPlatformFactory
com.google.inject.ProvisionException: Unable to provision, see the following errors:

1) No implementation for MavenTargetLocationFactory was bound.
  at ClassRealm[extension>org.eclipse.tycho:tycho-maven-plugin:4.0.13, parent: ClassLoaders$AppClassLoader@c387f44]
      \_ installed by: WireModule -> PlexusBindingModule
  while locating TargetDefinitionResolverService
  while locating DefaultTargetPlatformFactory

1 error

probably another issue ... @laeubi

slawekjaranowski avatar Nov 29 '25 18:11 slawekjaranowski

@slawekjaranowski I don't think Tycho currently supports Maven 4 at all see

  • https://github.com/eclipse-tycho/tycho/pull/4219

I't might be some parts are working but I won't bet on that, so Maven 3.9.x is the right choice at the moment.

But there is another project that adds custom layout here:

  • https://github.com/OpenNTF/p2-layout-provider

that might run at maven4

laeubi avatar Nov 29 '25 18:11 laeubi

same story https://github.com/apache/maven/issues/8631 where I reverted with https://github.com/apache/maven/commit/763f76cf833cddd6630add035c541ac54bbe381d due same reason

history here: https://github.com/apache/maven/issues/8684

slachiewicz avatar Dec 07 '25 22:12 slachiewicz