Bug#1091772: libmaven-resolver-1.6-java: missing interface: o.e.a.spi.synccontext.SyncContextFactory

Julien Plissonneau Duquène sre4ever at free.fr
Tue Dec 31 09:30:37 GMT 2024


Package: libmaven-resolver-1.6-java
Version: 1.6.3-3
Severity: important
Tags: patch
X-Debbugs-Cc: ebourg at apache.org, sre4ever at free.fr

Hi Emmanuel,

Currently gradle (4.4.1-21) in sid fails to build kotlin (MR with fixes at [1])
with the following error [2]:

>     1) [Guice/NullInjectedIntoNonNullable]: null returned by binding at
LocatorWiring
>      but the 1st parameter of
DefaultRepositorySystem.<init>(DefaultRepositorySystem.java:127) is not
@Nullable

After some tedious investigation (dependency injection is great when it works
but when it doesn't debugging it is not exactly straightforward) it appeared
that the actual problem was that the interface
org.eclipse.aether.spi.synccontext.SyncContextFactory could not be located
while resolving the dependencies for DefaultVersionResolver and
DefaultVersionRangeResolver.

I've simply backported the declaration from 1.9.22 and made the existing
org.eclipse.aether.impl.SyncContextFactory extend it and that fixes the issue
at least on my system.

Could you please review and eventually merge the changes, push your 1.6 branch
to Salsa and upload a new version to unstable?

Best wishes,


[1]: https://salsa.debian.org/java-team/kotlin/-/merge_requests/19
[2]: https://salsa.debian.org/jpd/kotlin/-/jobs/6826698

--
Julien Plissonneau Duquène


-- System Information:
Debian Release: trixie/sid
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'testing'), (20, 'unstable'), (10, 'experimental'), (5, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 6.11.10-amd64 (SMP w/12 CPU threads; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages libmaven-resolver-1.6-java depends on:
ii  libcommons-lang3-java       3.17.0-1
ii  libwagon-provider-api-java  3.5.3-1

libmaven-resolver-1.6-java recommends no packages.

libmaven-resolver-1.6-java suggests no packages.

-- no debconf information
-------------- next part --------------
diff --git a/debian/changelog b/debian/changelog
index c978746..8f2ab3b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+maven-resolver-1.6 (1.6.3-4) UNRELEASED; urgency=medium
+
+  * Backport org.eclipse.aether.spi.synccontext.SyncContextFactory (required
+    by maven3-resolver-provider and indirectly gradle).
+
+ -- Julien Plissonneau Duquène <sre4ever at free.fr>  Tue, 31 Dec 2024 08:45:30 +0000
+
 maven-resolver-1.6 (1.6.3-3) unstable; urgency=medium
 
   * libmaven-resolver-transport-http-1.6-java now depends
diff --git a/debian/patches/20-backport-spi-synccontext.patch b/debian/patches/20-backport-spi-synccontext.patch
new file mode 100644
index 0000000..35fc4e4
--- /dev/null
+++ b/debian/patches/20-backport-spi-synccontext.patch
@@ -0,0 +1,106 @@
+Description: Backport org.eclipse.aether.spi.synccontext.SyncContextFactory
+Author: Julien Plissonneau Duquène <sre4ever at free.fr>
+Forwarded: not-needed
+Last-Update: 2024-12-31
+
+This interface is needed by the following 2 classes of maven3-resolver-provider:
+org.apache.maven.repository.internal.DefaultVersionResolver
+org.apache.maven.repository.internal.DefaultVersionRangeResolver
+
+Without it gradle 4.4.1 fails with the following error:
+>     1) [Guice/NullInjectedIntoNonNullable]: null returned by binding at LocatorWiring
+>      but the 1st parameter of DefaultRepositorySystem.<init>(DefaultRepositorySystem.java:127) is not @Nullable
+... as the class fails to be loaded (linkage error) while sisu checks its
+dependencies.
+--- /dev/null
++++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/synccontext/SyncContextFactory.java
+@@ -0,0 +1,41 @@
++/*
++ * Licensed to the Apache Software Foundation (ASF) under one
++ * or more contributor license agreements.  See the NOTICE file
++ * distributed with this work for additional information
++ * regarding copyright ownership.  The ASF licenses this file
++ * to you under the Apache License, Version 2.0 (the
++ * "License"); you may not use this file except in compliance
++ * with the License.  You may obtain a copy of the License at
++ *
++ *   http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing,
++ * software distributed under the License is distributed on an
++ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
++ * KIND, either express or implied.  See the License for the
++ * specific language governing permissions and limitations
++ * under the License.
++ */
++package org.eclipse.aether.spi.synccontext;
++
++import org.eclipse.aether.RepositorySystem;
++import org.eclipse.aether.RepositorySystemSession;
++import org.eclipse.aether.SyncContext;
++
++/**
++ * A factory to create synchronization contexts. A synchronization context is used to coordinate concurrent access to
++ * artifacts or metadata.
++ */
++public interface SyncContextFactory {
++
++    /**
++     * Creates a new synchronization context.
++     *
++     * @param session The repository session during which the context will be used, must not be {@code null}.
++     * @param shared A flag indicating whether access to the artifacts/metadata associated with the new context can be
++     *            shared among concurrent readers or whether access needs to be exclusive to the calling thread.
++     * @return The synchronization context, never {@code null}.
++     * @see RepositorySystem#newSyncContext(RepositorySystemSession, boolean)
++     */
++    SyncContext newInstance(RepositorySystemSession session, boolean shared);
++}
+--- /dev/null
++++ b/maven-resolver-spi/src/main/java/org/eclipse/aether/spi/synccontext/package-info.java
+@@ -0,0 +1,23 @@
++// CHECKSTYLE_OFF: RegexpHeader
++/*
++ * Licensed to the Apache Software Foundation (ASF) under one
++ * or more contributor license agreements.  See the NOTICE file
++ * distributed with this work for additional information
++ * regarding copyright ownership.  The ASF licenses this file
++ * to you under the Apache License, Version 2.0 (the
++ * "License"); you may not use this file except in compliance
++ * with the License.  You may obtain a copy of the License at
++ *
++ *  http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing,
++ * software distributed under the License is distributed on an
++ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
++ * KIND, either express or implied.  See the License for the
++ * specific language governing permissions and limitations
++ * under the License.
++ */
++/**
++ * The contract for synchronization context implementations.
++ */
++package org.eclipse.aether.spi.synccontext;
+--- a/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/SyncContextFactory.java
++++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/impl/SyncContextFactory.java
+@@ -29,18 +29,7 @@
+  * 
+  * @provisional This type is provisional and can be changed, moved or removed without prior notice.
+  */
+-public interface SyncContextFactory
++public interface SyncContextFactory extends org.eclipse.aether.spi.synccontext.SyncContextFactory
+ {
+ 
+-    /**
+-     * Creates a new synchronization context.
+-     * 
+-     * @param session The repository session during which the context will be used, must not be {@code null}.
+-     * @param shared A flag indicating whether access to the artifacts/metadata associated with the new context can be
+-     *            shared among concurrent readers or whether access needs to be exclusive to the calling thread.
+-     * @return The synchronization context, never {@code null}.
+-     * @see RepositorySystem#newSyncContext(RepositorySystemSession, boolean)
+-     */
+-    SyncContext newInstance( RepositorySystemSession session, boolean shared );
+-
+ }
diff --git a/debian/patches/series b/debian/patches/series
index 79362ee..021a999 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 02-backward-compatibility.patch
+20-backport-spi-synccontext.patch


More information about the pkg-java-maintainers mailing list