Emmanuel Bourg pushed to branch master at Debian Java Maintainers / gradle-debian-helper
Commits: 8459c58f by Emmanuel Bourg at 2026-10-29T08:38:22+01:00 Resolve the dependencies declared without version - - - - - 92a1e32c by Emmanuel Bourg at 2026-10-29T09:42:48+01:00 Depend on gradle (>= 4.8) and libgradle-kotlin-dsl-java (>= 0.17.5) - - - - - d375ae51 by Emmanuel Bourg at 2026-10-29T09:43:08+01:00 Upload to unstable - - - - - 4 changed files: - debian/changelog - debian/control - gradle-helper-hook/src/main/java/org/debian/gradle/plugin/MavenResolverHook.java - + gradle-helper-hook/src/test/java/org/debian/gradle/plugin/MavenResolverHookTest.java Changes: ===================================== debian/changelog ===================================== @@ -1,3 +1,10 @@ +gradle-debian-helper (3.2) unstable; urgency=medium + + * Resolve the dependencies declared without version + * Depend on gradle (>= 4.8) and libgradle-kotlin-dsl-java (>= 0.17.5) + + -- Emmanuel Bourg <[email protected]> Thu, 29 Oct 2026 09:42:58 +0100 + gradle-debian-helper (3.1) unstable; urgency=medium * Resolve the plugins of the plugins {} blocks from /usr/share/maven-repo ===================================== debian/control ===================================== @@ -18,8 +18,9 @@ Package: gradle-debian-helper Architecture: all Depends: default-jre-headless | java7-runtime-headless, - gradle (>= 4.7), - libgradle-kotlin-dsl-java (>= 0.16.3), + gradle (>= 4.8), + libgradle-kotlin-dsl-java (>= 0.17.5-3~), + kotlin (>= 1.3.31+ds1-8~), maven-repo-helper, ${misc:Depends} Description: Helper tools for building Debian packages with Gradle ===================================== gradle-helper-hook/src/main/java/org/debian/gradle/plugin/MavenResolverHook.java ===================================== @@ -56,6 +56,10 @@ public class MavenResolverHook { if (rulesets == null) { initRules(); } + if (version != null && version.isEmpty()) { + // a dependency declared without version, handled like a missing version by the rules + version = null; + } Dependency dependency = new Dependency(groupId, artifactId, type, version, "compile", false, classifier, null); Dependency resolved = resolve(dependency); @@ -99,7 +103,8 @@ public class MavenResolverHook { * issue the '.x' generic versions are detected and passed through. Artifacts with no generic version are still * affected though, and their rules have to be added to debian/maven.rules. */ - if (!dependency.getVersion().endsWith(".x") && !dependency.getVersion().equals("debian")) { + String version = dependency.getVersion(); + if (version == null || (!version.endsWith(".x") && !version.equals("debian"))) { // apply the first rule that matches for (DependencyRule rule : rulesets.get(DependencyRuleSetFiles.RulesType.RULES).getRules()) { if (rule.matches(dependency)) { ===================================== gradle-helper-hook/src/test/java/org/debian/gradle/plugin/MavenResolverHookTest.java ===================================== @@ -0,0 +1,51 @@ +/** + * Copyright 2026 Emmanuel Bourg + * + * Licensed 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.debian.gradle.plugin; + +import java.util.Map; + +import org.junit.Test; + +import static org.junit.Assert.*; + +public class MavenResolverHookTest { + + private String rewriteVersion(String version) throws Exception { + Map<String, String> dependency = MavenResolverHook.getInstance().rewrite("org.example", "example", version, "jar", null); + return dependency.get("version"); + } + + @Test + public void testVersion() throws Exception { + assertEquals("debian", rewriteVersion("1.2.3")); + } + + @Test + public void testGenericVersion() throws Exception { + assertEquals("4.x", rewriteVersion("4.x")); + } + + @Test + public void testDebianVersion() throws Exception { + assertEquals("debian", rewriteVersion("debian")); + } + + @Test + public void testEmptyVersion() throws Exception { + assertEquals("debian", rewriteVersion("")); + } +} View it on GitLab: https://salsa.debian.org/java-team/gradle-debian-helper/-/compare/5a0480f3e6513da2f8653cef99489bb05dbb3887...d375ae51cbbff845d3d2571aece604a676bb1d71 -- View it on GitLab: https://salsa.debian.org/java-team/gradle-debian-helper/-/compare/5a0480f3e6513da2f8653cef99489bb05dbb3887...d375ae51cbbff845d3d2571aece604a676bb1d71 You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help
_______________________________________________ pkg-java-commits mailing list [email protected] https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-java-commits

