Package: maven-repo-helper
Version: 1.9.2
Followup-For: Bug #811053

I haven't reproduced the trailing newline issue, but there's definitely a 
problem with multiple poms.

What happens at the moment is that jh_maven_repo_helper adds the following to 
the debhelper sequence:

mh_installpoms
mh_linkjars --skip-clean-poms

mh_installpoms calls mh_installpom for each pom, which calls mh_cleanpom, which 
creates (amongst other things) the file debian/.mh/pom.properties. mh_linkjars 
--skip-clean-poms calls mh_linkjar --skip-clean-poms for each pom. The 
--skip-clean-poms option assumes that debian/.mh/pom.properties already exists 
and reuses it in the creation of the symlinks.

This is fine if there's only one pom to deal with, but if there are multiple 
poms, each call to mh_installpom overwrites the previous 
debian/.mh/pom.properties, so that mh_linkjar only creates the symlink for the 
last pom processed by mh_installpoms.

You can see this in the package mongo-java-driver which I am currently working 
on. I am working around the problem by overriding mh_linkjars in debian/rules 
to remove the --skip-clean-poms option.

The attached patch modifies jh_maven_repo_helper.pm to remove the 
--skip-clean-poms options from the debhelper sequence. (Another option might be 
to modify mh_installpom to copy debian/.mh/pom.properties to 
debian/.mh/${artifactId}-${version}.properties and then modify mh_linkjar to 
look for this file instead.)

Christopher

Dear Maintainer,

*** Reporter, please consider answering these questions, where appropriate ***

   * What led up to the situation?
   * What exactly did you do (or not do) that was effective (or
     ineffective)?
   * What was the outcome of this action?
   * What outcome did you expect instead?

*** End of the template - remove these template lines ***


-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.6.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages maven-repo-helper depends on:
ii  default-jre-headless [java2-runtime-headless]    2:1.8-57
ii  gcj-5-jre-headless [java2-runtime-headless]      5.4.1-1
ii  libstax-java                                     1.2.0-3
ii  openjdk-7-jre-headless [java2-runtime-headless]  7u111-2.6.7-1
ii  openjdk-8-jre-headless [java2-runtime-headless]  8u102-b14.1-2

Versions of packages maven-repo-helper recommends:
ii  debhelper  10

Versions of packages maven-repo-helper suggests:
ii  maven-debian-helper  2.1.1

-- no debconf information
>From dad07cffc697dea5d23fba0453e5b4992556d526 Mon Sep 17 00:00:00 2001
From: Christopher Hoskin <christopher.hos...@gmail.com>
Date: Tue, 27 Sep 2016 04:11:52 +0100
Subject: [PATCH] Fix jh_maven_repo_helper to work with multiple poms (Closes:
 #811053)

---
 debian/changelog                       | 4 ++++
 src/main/share/jh_maven_repo_helper.pm | 1 -
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index b75212d..2f4c9f6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,13 @@
 maven-repo-helper (1.9.3) UNRELEASED; urgency=medium
 
+  [ tony mancill ]
   * Team upload.
   * Apply patch for mh_patchpoms to honor the --verbose option.
     Thank you to Christopher Hoskin for the patch. (Closes: #835042)
 
+  [ Christopher Hoskin ]
+  * Fix jh_maven_repo_helper to work with multiple poms (Closes: #811053)
+
  -- tony mancill <tmanc...@debian.org>  Tue, 23 Aug 2016 22:26:59 -0700
 
 maven-repo-helper (1.9.2) unstable; urgency=medium
diff --git a/src/main/share/jh_maven_repo_helper.pm b/src/main/share/jh_maven_repo_helper.pm
index 0dcbdb7..def5e37 100644
--- a/src/main/share/jh_maven_repo_helper.pm
+++ b/src/main/share/jh_maven_repo_helper.pm
@@ -8,7 +8,6 @@ use Debian::Debhelper::Dh_Lib;
 
 insert_after("jh_depends", "mh_installpoms");
 insert_after("mh_installpoms", "mh_linkjars");
-add_command_options("mh_linkjars", "--skip-clean-poms");
 insert_before("dh_clean", "mh_clean");
 
 1;
-- 
2.9.3

Reply via email to