[Git][java-team/maven-repo-helper][master] 8 commits: Added the classifier to the string representation of a Dependency

Emmanuel Bourg gitlab at salsa.debian.org
Wed Feb 10 13:10:20 GMT 2021



Emmanuel Bourg pushed to branch master at Debian Java Maintainers / maven-repo-helper


Commits:
ba367a08 by Emmanuel Bourg at 2021-02-10T11:18:29+01:00
Added the classifier to the string representation of a Dependency

- - - - -
0013fe7a by Emmanuel Bourg at 2021-02-10T11:29:45+01:00
Fixed the resolution of the dependencies with a classifier (Closes: #982438)

- - - - -
497dd34d by Emmanuel Bourg at 2021-02-10T11:30:53+01:00
Standards-Version updated to 4.5.1

- - - - -
9f67ed77 by Emmanuel Bourg at 2021-02-10T11:30:57+01:00
Switch to debhelper level 13

- - - - -
fcff46e0 by Emmanuel Bourg at 2021-02-10T13:08:31+01:00
Build with the DH sequencer instead of CDBS

- - - - -
2d96f0ef by Emmanuel Bourg at 2021-02-10T14:00:04+01:00
Fixed the lintian warnings on debian/copyright

- - - - -
e092b312 by Emmanuel Bourg at 2021-02-10T14:08:18+01:00
Updated the location of the source repository in pom.xml and debian/copyright

- - - - -
f767bba1 by Emmanuel Bourg at 2021-02-10T14:08:30+01:00
Upload to unstable

- - - - -


12 changed files:

- debian/changelog
- + debian/clean
- − debian/compat
- debian/control
- debian/copyright
- + debian/maven-repo-helper.install
- + debian/maven-repo-helper.links
- debian/rules
- pom.xml
- src/main/java/org/debian/maven/repo/Dependency.java
- src/main/java/org/debian/maven/repo/Repository.java
- src/test/java/org/debian/maven/repo/RepositoryTest.java


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,15 @@
+maven-repo-helper (1.10) unstable; urgency=medium
+
+  * Fixed the resolution of the dependencies with a classifier (Closes: #982438)
+  * Added the classifier to the string representation of a Dependency
+  * Build with the DH sequencer instead of CDBS
+  * Standards-Version updated to 4.5.1
+  * Switch to debhelper level 13
+  * Fixed the lintian warnings on debian/copyright
+  * Updated the location of the source repository in pom.xml and d/copyright
+
+ -- Emmanuel Bourg <ebourg at apache.org>  Wed, 10 Feb 2021 14:08:24 +0100
+
 maven-repo-helper (1.9.4) unstable; urgency=medium
 
   [ Emmanuel Bourg ]


=====================================
debian/clean
=====================================
@@ -0,0 +1,2 @@
+debian/.mh/
+debian/maven-repo/


=====================================
debian/compat deleted
=====================================
@@ -1 +0,0 @@
-10


=====================================
debian/control
=====================================
@@ -8,15 +8,14 @@ Uploaders:
 Build-Depends:
  ant,
  ant-optional,
- cdbs,
- debhelper (>= 10),
+ debhelper-compat (= 13),
  default-jdk (>= 2:1.7),
  help2man,
  junit4,
  libcommons-io-java,
  libxmlunit-java,
  python3-docutils
-Standards-Version: 4.1.4
+Standards-Version: 4.5.1
 Vcs-Git: https://salsa.debian.org/java-team/maven-repo-helper.git
 Vcs-Browser: https://salsa.debian.org/java-team/maven-repo-helper
 Homepage: https://wiki.debian.org/Java/MavenRepoSpec
@@ -24,7 +23,7 @@ Homepage: https://wiki.debian.org/Java/MavenRepoSpec
 Package: maven-repo-helper
 Architecture: all
 Depends: ${misc:Depends}, default-jre-headless (>= 2:1.7) | java7-runtime-headless
-Recommends: debhelper (>= 10)
+Recommends: debhelper-compat (= 13)
 Suggests: maven-debian-helper
 Breaks: maven-debian-helper (<= 1.6.6)
 Description: Helper tools for including Maven metadata in Debian packages


=====================================
debian/copyright
=====================================
@@ -1,15 +1,20 @@
 Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
 Upstream-Name: Maven Repo support
 Upstream-Contact: Ludovic Claude <ludovic.claude at laposte.net>
-Source: https://launchpad.net/maven-packaging-support/
+Source: https://salsa.debian.org/java-team/maven-repo-helper
 
 Files: *
 Copyright: 2009, Ludovic Claude  <ludovic.claude at laposte.net>
 License: Apache-2.0
 
+Files: src/test/resources/*.xml
+       src/test/resources/org/apache/maven/project/pom-4.0.0.xml
+Copyright: 2001-2009, Apache Software foundation
+License: Apache-2.0
+
 Files: src/test/resources/slf4j.xml
 Copyright: 2004-2005, SLF4J.ORG
-	       2004-2007, QOS.ch
+           2004-2007, QOS.ch
 License: MIT
 
 Files: src/test/resources/modello-core.xml
@@ -25,10 +30,6 @@ Files: src/test/resources/plexus-active-collections.pom
 Copyright: 2006-2009, Codehaus Foundation
 License: Apache-2.0
 
-Files: src/test/resources/*.xml src/test/resources/org/apache/maven/project/pom-4.0.0.xml
-Copyright: 2001-2009, Apache Software foundation
-License: Apache-2.0
-
 Files: debian/*
 Copyright: 2009, Ludovic Claude <ludovic.claude at laposte.net>
 License: Apache-2.0


=====================================
debian/maven-repo-helper.install
=====================================
@@ -0,0 +1,7 @@
+build/maven-repo-helper-debian.jar       /usr/share/maven-repo/org/debian/maven/maven-repo-helper/debian/
+debian/.mh/maven-repo-helper-debian.pom  /usr/share/maven-repo/org/debian/maven/maven-repo-helper/debian/
+
+src/main/bin/mh_*                        /usr/bin
+src/main/share/mh_*                      /usr/share/maven-repo-helper
+src/main/share/*.pm                      /usr/share/perl5/Debian/Debhelper/Sequence
+debian/.mh/doc/*.html                    /usr/share/doc/maven-repo-helper/


=====================================
debian/maven-repo-helper.links
=====================================
@@ -0,0 +1 @@
+/usr/share/maven-repo/org/debian/maven/maven-repo-helper/debian/maven-repo-helper-debian.jar /usr/share/java/maven-repo-helper.jar


=====================================
debian/rules
=====================================
@@ -1,44 +1,66 @@
 #!/usr/bin/make -f
 
-include /usr/share/cdbs/1/rules/debhelper.mk
-include /usr/share/cdbs/1/class/ant.mk
-
-PACKAGE              := $(DEB_SOURCE_PACKAGE)
-VERSION              := $(DEB_UPSTREAM_VERSION)
-JAVA_HOME            := /usr/lib/jvm/default-java
-DEB_JARS             := ant-junit junit4 ant-junit4
-DEB_ANT_BUILD_TARGET := package
-DEB_ANT_BUILDFILE    := ./debian/build.xml
-DEB_ANT_ARGS         := -Dpackage=$(PACKAGE) -Dversion=$(VERSION)
-CLASSPATH            := /usr/share/java/ant-junit.jar
+include /usr/share/dpkg/pkg-info.mk
+
+PACKAGE := maven-repo-helper
+VERSION := $(DEB_VERSION_UPSTREAM)
+
+export CLASSPATH=/usr/share/java/junit4.jar
+
+%:
+	dh $@ --buildsystem=ant
+
+override_dh_auto_configure:
+	mkdir -p debian/.mh
+
+override_dh_auto_build: man-pages
+	dh_auto_build -- -f debian/build.xml -Dpackage=$(PACKAGE) -Dversion=$(VERSION) package -Dmaven.test.skip=true
+	mv build/$(PACKAGE)-$(VERSION).jar build/$(PACKAGE)-debian.jar
+
+	java -cp build/$(PACKAGE)-debian.jar:$(CLASSPATH) $(JAVA_OPTIONS) org.debian.maven.repo.POMCleaner \
+	        --no-parent --has-package-version --rules=debian/maven.rules pom.xml \
+		debian/.mh/$(PACKAGE)-debian.pom debian/.mh/pom.properties
+
+override_dh_auto_test:
+ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
+	dh_auto_build -- -f debian/build.xml -Dpackage=$(PACKAGE) -Dversion=$(VERSION) test
+endif
+
+override_dh_auto_install:
+	dh_installman $(MAN_PAGES)
+
+override_dh_auto_clean:
+	dh_auto_build -- -f debian/build.xml clean
 
 # Generation of man pages
 SCRIPTS       := $(wildcard src/main/bin/mh_*)
 MAN_PAGES     := $(addprefix debian/.mh/doc/,$(addsuffix .1, $(notdir $(SCRIPTS))))
-mh_checkrepo_description = "Checks the Maven repository."
-mh_clean_description = "Cleans the temporary files created by the other mh_* utilities."
-mh_cleanpom_description = "Cleans a POM file."
-mh_genrules_description = "Generates the debian/rules file with Maven support."
-mh_install_description = "Installs the POM files and the artifacts into /usr/share/maven-repo."
-mh_installjar_description = "Installs a jar into /usr/share/maven-repo."
-mh_installpom_description = "Installs a POM file into /usr/share/maven-repo."
+
+mh_checkrepo_description   = "Checks the Maven repository."
+mh_clean_description       = "Cleans the temporary files created by the other mh_* utilities."
+mh_cleanpom_description    = "Cleans a POM file."
+mh_genrules_description    = "Generates the debian/rules file with Maven support."
+mh_install_description     = "Installs the POM files and the artifacts into /usr/share/maven-repo."
+mh_installjar_description  = "Installs a jar into /usr/share/maven-repo."
+mh_installpom_description  = "Installs a POM file into /usr/share/maven-repo."
 mh_installpoms_description = "Installs all POMs for the package into /usr/share/maven-repo."
 mh_installsite_description = "Installs site.xml into /usr/share/maven-repo."
-mh_linkjar_description = "Creates a link in /usr/share/maven-repo for an existing jar."
-mh_linkjars_description = "Creates links in /usr/share/maven-repo for all jars."
+mh_linkjar_description     = "Creates a link in /usr/share/maven-repo for an existing jar."
+mh_linkjars_description    = "Creates links in /usr/share/maven-repo for all jars."
 mh_linkrepojar_description = "Creates a link from a jar already installed in /usr/share/maven-repo."
-mh_lspoms_description = "Generates a list of POMs for the package."
-mh_patchpom_description = "Patches one POM file using the Maven dependency rules."
-mh_patchpoms_description = "Patches the POM files using the Maven dependency rules."
+mh_lspoms_description      = "Generates a list of POMs for the package."
+mh_patchpom_description    = "Patches one POM file using the Maven dependency rules."
+mh_patchpoms_description   = "Patches the POM files using the Maven dependency rules."
 mh_unpatchpoms_description = "Undo the patches on the POM files."
+
 debian/.mh/mh_lib.sh : src/main/share/mh_lib.sh
-	mkdir -p debian/.mh
 	cp src/main/share/mh_lib.sh debian/.mh/mh_lib.sh
+
 debian/.mh/mh_% : src/main/bin/mh_% debian/.mh/mh_lib.sh
-	mkdir -p debian/.mh
 	cp $< $@
 	perl -i -pe 's,\. /usr/share/maven-repo-helper/mh_lib.sh,\. debian/.mh/mh_lib.sh,' $@
 	chmod +x $@
+
 debian/.mh/doc:
 	mkdir -p debian/.mh/doc
 	rst2html --title="Maven Repo Helper tutorial" --stylesheet-path=doc/style.css doc/tutorial.rst debian/.mh/doc/tutorial.html
@@ -52,24 +74,7 @@ debian/.mh/doc:
 
 debian/.mh/doc/mh_%.1 : debian/.mh/mh_%
 	help2man -N -n $(mh_$*_description) -o $@ $<
-man-pages: debian/.mh/doc $(MAN_PAGES)
 
-build/$(PACKAGE):: man-pages
-
-binary-post-install/$(PACKAGE)::
-	mv build/$(PACKAGE)-$(VERSION).jar build/$(PACKAGE)-debian.jar
-	dh_install -p$(PACKAGE) build/$(PACKAGE)-debian.jar /usr/share/maven-repo/org/debian/maven/$(PACKAGE)/debian
-	dh_install -p$(PACKAGE) src/main/bin/mh_* /usr/bin
-	dh_install -p$(PACKAGE) src/main/share/mh_* /usr/share/$(PACKAGE)
-	dh_install -p$(PACKAGE) src/main/share/*.pm /usr/share/perl5/Debian/Debhelper/Sequence
-	dh_link -p$(PACKAGE) /usr/share/maven-repo/org/debian/maven/$(PACKAGE)/debian/$(PACKAGE)-debian.jar /usr/share/java/$(PACKAGE).jar
-	dh_installman $(MAN_PAGES)
-	mkdir -p debian/.mh
-	java -cp build/$(PACKAGE)-debian.jar:$(CLASSPATH) $(JAVA_OPTIONS) org.debian.maven.repo.POMCleaner --no-parent --has-package-version --rules=debian/maven.rules pom.xml \
-		debian/.mh/$(PACKAGE)-debian.pom debian/.mh/pom.properties
-	dh_install -p$(PACKAGE) --sourcedir=debian/.mh $(PACKAGE)-debian.pom \
-		usr/share/maven-repo/org/debian/maven/$(PACKAGE)/debian
-	dh_install -p$(PACKAGE) --sourcedir=debian/.mh/doc tutorial.html reference.html repository.html usr/share/doc/maven-repo-helper
+man-pages: debian/.mh/doc $(MAN_PAGES)
 
-clean::
-	-rm -rf debian/.mh
+.PHONY: man-pages


=====================================
pom.xml
=====================================
@@ -5,7 +5,7 @@
     <artifactId>maven-repo-helper</artifactId>
     <name>Maven Repo helper</name>
     <packaging>jar</packaging>
-    <version>1.9.2</version>
+    <version>1.10</version>
     <description>Provides support for managing the Maven repository in a Debian distribution.</description>
 
     <inceptionYear>2009</inceptionYear>
@@ -42,9 +42,9 @@
         <url>http://bugs.debian.org</url>
     </issueManagement>
     <scm>
-        <connection>scm:git:git://anonscm.debian.org/pkg-java/maven-repo-helper.git</connection>
-        <developerConnection>scm:git:git+ssh://git.debian.org/git/pkg-java/maven-repo-helper.git</developerConnection>
-        <url>http://anonscm.debian.org/gitweb/?p=pkg-java/maven-repo-helper.git</url>
+        <connection>scm:git:https://salsa.debian.org/java-team/maven-repo-helper.git</connection>
+        <developerConnection>scm:git:git at salsa.debian.org:java-team/maven-repo-helper.git</developerConnection>
+        <url>https://salsa.debian.org/java-team/maven-repo-helper</url>
     </scm>
 
     <build>


=====================================
src/main/java/org/debian/maven/repo/Dependency.java
=====================================
@@ -269,7 +269,7 @@ public class Dependency implements Comparable<Dependency>, Cloneable {
     }
 
     public String toString() {
-        return groupId + ":" + artifactId + ":" + type + ":" + version;
+        return groupId + ":" + artifactId + ":" + type + ":" + version + (!"".equals(classifier) ? ":" + classifier : "");
     }
 
     public int compareTo(Dependency dependency) {


=====================================
src/main/java/org/debian/maven/repo/Repository.java
=====================================
@@ -111,6 +111,11 @@ public class Repository {
      * @param dependency
      */
     public POMInfo getPOM(Dependency dependency) {
+        if (!"".equals(dependency.getClassifier())) {
+            // dependencies with a classifier share the same pom as the main artifact
+            dependency = new Dependency(dependency);
+            dependency.setClassifier("");
+        }
         return dep2info.get(dependency);
     }
 


=====================================
src/test/java/org/debian/maven/repo/RepositoryTest.java
=====================================
@@ -53,6 +53,21 @@ public class RepositoryTest {
         assertEquals(pom, repo.searchMatchingPOM(dependency));
     }
 
+    @Test
+    public void testGetPomWithClassifier() throws Exception {
+        Repository repo = getRepository();
+        repo.scan();
+
+        Dependency baseDependency = new Dependency("org.apache.ant", "ant-apache-bcel", "jar", "debian");
+        Dependency dependency = new Dependency(baseDependency);
+        dependency.setClassifier("no_aop");
+        POMInfo pom = repo.getPOM(dependency);
+        assertNotNull(pom);
+        assertEquals(pom.getThisPom(), baseDependency);
+
+        assertEquals(pom, repo.searchMatchingPOM(dependency));
+    }
+
     @Test
     public void testRegisterPom() throws Exception {
         Repository repo = getRepository();



View it on GitLab: https://salsa.debian.org/java-team/maven-repo-helper/-/compare/da9a07d8ead469ebc8489fe6931bcb6baacaa602...f767bba1c8f9397e05723f31e85859d971c0fe6a

-- 
View it on GitLab: https://salsa.debian.org/java-team/maven-repo-helper/-/compare/da9a07d8ead469ebc8489fe6931bcb6baacaa602...f767bba1c8f9397e05723f31e85859d971c0fe6a
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20210210/3c6245f8/attachment.html>


More information about the pkg-java-commits mailing list