[pkg-java] r14656 - in tags/maven-debian-helper: . 1.4.5/debian 1.4.5/maven-debian-plugin/src/main/java/org/debian/maven/plugin

Damien Raude-Morvan drazzib at alioth.debian.org
Thu Sep 1 20:58:31 UTC 2011


Author: drazzib
Date: 2011-09-01 20:58:30 +0000 (Thu, 01 Sep 2011)
New Revision: 14656

Added:
   tags/maven-debian-helper/1.4.5/
   tags/maven-debian-helper/1.4.5/debian/changelog
   tags/maven-debian-helper/1.4.5/maven-debian-plugin/src/main/java/org/debian/maven/plugin/SysInstallMojo.java
Removed:
   tags/maven-debian-helper/1.4.5/debian/changelog
   tags/maven-debian-helper/1.4.5/maven-debian-plugin/src/main/java/org/debian/maven/plugin/SysInstallMojo.java
Log:
[svn-buildpackage] Tagging maven-debian-helper 1.4.5

Deleted: tags/maven-debian-helper/1.4.5/debian/changelog
===================================================================
--- trunk/maven-debian-helper/debian/changelog	2011-08-30 20:14:21 UTC (rev 14621)
+++ tags/maven-debian-helper/1.4.5/debian/changelog	2011-09-01 20:58:30 UTC (rev 14656)
@@ -1,293 +0,0 @@
-maven-debian-helper (1.4.4) unstable; urgency=low
-
-  [ Ludovic Claude ]
-  * Move apt-file, devscripts, subversion from Recommends: to Suggests: as
-    they are only required when mh_make is used
-  * mh_make: rescan the Maven repository after the user installs a
-    required package.
-  * mh_resolve_dependencies: Also launch Maven in offline mode
-    (with --offline option) when --offline parameter is used.
-
-  [ Damien Raude-Morvan ]
-  * Upload to unstable (Closes: #637656).
-  * mh_make: Update debian/copyright template for latest DEP-5 format.
-  * mh_resolve_dependencies: Don't use mvn directly but call to
-    DependenciesSolver main (so packages can have a main pom
-    in other directory than root).
-  * DependenciesSolver: Add new parameters :
-    - --non-explore: doesn't explore directories for pom.xml
-    - --base-directory: path to root directory of package
-  * maven.mk: Send base-directory and non-explore parameters when calling
-    mh_resolve_dependencies.
-  * Bump Standards-Version to 3.9.2: no changes needed.
-
- -- Damien Raude-Morvan <drazzib at debian.org>  Sat, 20 Aug 2011 16:25:50 +0200
-
-maven-debian-helper (1.4.3) unstable; urgency=low
-
-  * DependenciesSolver: Don't use Properties.store() method since
-    it escape some chars (like " >\=") from variables.
-    Replace it with simple FileWriter. Closes: #628272.
-  * SysInstallMojo: Send "--keep-elements" flag to POMCleaner if its
-    set in <pkg>.poms file. Thanks to James Page <james.page at canonical.com>.
-    Closes: #613364
-  * mh_resolve_dependencies: Always launch Maven in offline mode
-    with --offline option (as already done on mh_make). Closes: #629356
-  * SysInstallDocMojo, SysInstallMojo: Drop initProperties method and only rely
-    on Maven mojo attributes injection of "debianPackage" and "destPackage".
-    Closes: #628693.
-  * mh_resolve_dependencies: New --javadoc param, send from maven.mk CDBS file
-    to automatically compute Javadoc dependencies when there is some *-doc
-    package. Closes: #628703.
-
- -- Damien Raude-Morvan <drazzib at debian.org>  Thu, 09 Jun 2011 00:11:08 +0200
-
-maven-debian-helper (1.4.2) unstable; urgency=low
-
-  * mh_resolve_dependencies: Handle --verbose option has described in
-    documentation (it was previously just ignored).
-  * DependenciesSolver: In case we didn't found anything for "jar" type,
-    just check for a "bundle" type inside repository
-
- -- Damien Raude-Morvan <drazzib at debian.org>  Sat, 14 May 2011 22:59:17 +0200
-
-maven-debian-helper (1.4.1) unstable; urgency=low
-
-  * Upload to unstable.
-
- -- Torsten Werner <twerner at debian.org>  Wed, 09 Feb 2011 21:42:36 +0100
-
-maven-debian-helper (1.4) experimental; urgency=low
-
-  * d/control: Add Recommends on devscripts (which provides licensecheck)
-  * mh_make: 
-     - Improve generated copyright
-     - Fix generated rules for a build using ant
-     - When ignoring dependencies, don't fail the build
-     - When ant is used as the build tool, generate the build.xml file
-       required for multi projects.
-     - use licensecheck as an additional source of information for licenses
-
- -- Ludovic Claude <ludovic.claude at laposte.net>  Fri, 12 Nov 2010 12:26:37 +0100
-
-maven-debian-helper (1.3) experimental; urgency=low
-
-  * ${maven:Depends} and similar substitution vars: add
-    version constraints when possible
-  * Use dpkg to resolve the dependent packages in ${maven:DocDepends}
-    (Closes: #588114)
-  * Use dpkg to search for the documentation package (Closes: #588114)
-  * mh_make: suggest installing missing dependencies which are not ignored
-    during the build
-  * add property debian.hasPackageVersion property, if true in the
-    repository POM then other packages depending on a POM with this property on
-    will have an addition version constraint generated in ${maven:Depends}
-  * mh_make: detect when debian.hasPackageVersion can be used, ask for the
-    upstream version of the package for confirmation.
-  * d/control: add Recommends: on subversion as it's used by mh_make,
-     add Build-Depends on libmaven-plugin-tools-java and junit
-  * d/build.xml: fix build when previous versions of this package are
-    not already installed on the system.
-  * d/rules: use debian/.mh instead of debian/tmp as temp directory to better
-    comply with Debian policy.
-
- -- Ludovic Claude <ludovic.claude at laposte.net>  Wed, 29 Sep 2010 00:17:34 +0200
-
-maven-debian-helper (1.2) unstable; urgency=low
-
-  [ Ludovic Claude ]
-  * debian/control: Update Standards-Version to 3.9.1, no changes
-  * mh_make: fix issue when no-parent option is needed. Thanks Torsten
-    for the report (Closes: #591513)
-  * mh_make: assist with the rules to transform the versions
-  * mh_make: use existing package.poms files if any
-  * maven.mk: all rules in maven.ignoreRules are also used during the
-    clean phase, so there is no need to duplicate them in
-    maven.cleanIgnoreRules also.
-
-  [ Damien Raude-Morvan ]
-  * DependenciesSolver: Fix ClassCastException when using mh_make.
-
- -- Ludovic Claude <ludovic.claude at laposte.net>  Thu, 16 Sep 2010 23:28:02 +0200
-
-maven-debian-helper (1.1) unstable; urgency=low
-
-  * debian/control: Update Standards-Version to 3.9.0, no changes
-  * Fix compilation issues with gcj
-  * mh_make: 
-      - update generated control to use Standards-Version 3.9.0
-      - improve useability and recognize more plugins and extensions
-      - read existing maven rules in debian folder, don't ask twice the
-        same questions.
-  * Support installing build artifacts in different packages with the
-    --package option in the <package>.poms file
-  * Add mvn-build to phony rules to avoid creating a file called
-    mvn-build during the build (Closes: #589635)
-
- -- Ludovic Claude <ludovic.claude at laposte.net>  Mon, 28 Jun 2010 23:10:50 +0200
-
-maven-debian-helper (1.0) unstable; urgency=low
-
-  * debian/control:
-     - replace Depends: on openjdk-6-jre | java2-runtime by default-jdk
-     - remove Conflits: on old maven-debian-helper as there is already
-       a version constraint for a new version of this package.
-  * mh_make:
-      - supports checking out code from the svn of dev.java.net
-      - use upstream copyright when available for debian/* files
-      - update Standards version, generate with source 3.0 (quilt) package
-        format
-      - mh_make --from-svn: improve package name proposal for URLs
-        containing /tags/
-      - ask to ignore missing dependencies
-  * maven.mk: 
-      - add before-mvn-build:: and after-mvn-build:: targets
-        to be able to insert custom actions before and after running the Maven
-        build
-      - add DEB_MAVEN_INSTALL_TO_USJ variable. Set this variable to false to
-        prevent maven.mk to install the jars in /usr/share/java. This
-        variable defaults to true.
-      - add call to mh_clean to remove temporary files
-  * Add -Duse.maven.repo.local option to maven-debian-plugin:install
-    and install-doc to give the option to deploy artifacts on the
-    local (and temporary) Maven repository used by the Debian build
-    Typical use-case: bootstrapping the build of a project with 
-    some artifacts of the project pre-built and installed in the tmp repo
-    before the normal build is executed. See the antlr3 package for an example
-  * SysInstallMojo: clean the target directory before an installation if the
-    directory is a symlink that was created by copy-repo.sh
-
- -- Ludovic Claude <ludovic.claude at laposte.net>  Sun, 16 May 2010 14:42:29 +0200
-
-maven-debian-helper (0.12) unstable; urgency=low
-
-  * SysInstallDocMojo: Fix methods override to install -javadoc JAR flavors.
-
- -- Damien Raude-Morvan <drazzib at debian.org>  Mon, 05 Apr 2010 23:46:22 +0200
-
-maven-debian-helper (0.11) unstable; urgency=low
-
-  * SysInstallMojo: Read generated pom.properties after POMCleaner
-    calls to allow changing groupId and artifactId inside maven.rules
-    (trying to mimic mh_installpom/mh_installjar behavior)
-  * Switch to 3.0 (native) source format
-
- -- Damien Raude-Morvan <drazzib at debian.org>  Mon, 05 Apr 2010 21:48:23 +0200
-
-maven-debian-helper (0.10) unstable; urgency=low
-
-  * Add --non-interactive option to mh_lspoms and use it
-    in maven.mk to avoid asking questions during a build
-    (Closes: #574399)
-
- -- Ludovic Claude <ludovic.claude at laposte.net>  Wed, 24 Mar 2010 23:48:29 +0100
-
-maven-debian-helper (0.9) unstable; urgency=low
-
-  * maven-vars.mk: Fix detection of DEB_DOC_PACKAGE
-    Only exclude first exact match from dh_listpackages result
-    instead of all packages which contains main package name.
-  * maven.mk: Pass DEB_DOC_PACKAGE when invoke DEB_MAVEN_DOC_TARGET.
-
- -- Damien Raude-Morvan <drazzib at debian.org>  Mon, 01 Mar 2010 21:22:34 +0100
-
-maven-debian-helper (0.8) unstable; urgency=low
-
-  * mh_make falls back on EMAIL when DEBEMAIL is not set
-  * mh_make handles better multi projects
-  * mh_make generates projects following the Debian 3.8.3 policy
-  * Documentation improvements
-  * maven.mk: unpatch the poms in cleanbuilddir, to have a good
-    clean sequence when maven.mk is used with a patch system -
-    clean target -> mvn clean -> rm tmp files -> unpatch pom files
-     -> unpatch files with patch system
-  * Read rules from the Maven repository to force the version of
-    Maven plugins to be the same as in the repository
-  * maven.mk removes some elements from the POM files when their
-    use is against the Debian policy (<repositories> as they
-    imply downloading artifacts from the Internet, 
-    <distributionManagement> as it implies publishing on the net
-    or in a location not controlled by Debian) or when they are
-    not needed and risk pulling out unwanted dependencies
-    (<reports> which is not used if a documentation package is
-    not generated)
-  * maven.mk adds a patch to Maven to disable using the
-    maven-site-plugin when no documentation package is generated.
-    This helps to reduce the amount of build dependencies
-
- -- Ludovic Claude <ludovic.claude at laposte.net>  Mon, 04 Jan 2010 23:13:29 +0100
-
-maven-debian-helper (0.7) unstable; urgency=low
-
-  [Ludovic Claude]
-  * Make the package more version agnostic. Versions are discovered
-    at runtime
-  * mh_make has a new option, --from-svn, to download automatically
-    the sources from a SVN repository and generate the Debian packaging
-    for the project.
-  * Add apt-file to Recommends: as it's used by mh_lspoms
-    (Closes: #542511)
-
-  [Michael Koch]
-  * Add Recommends: apt-file to maven-debian-helper (Closes: #542511).
-  * Build-Depends on debhelper (>= 7).
-  * Added myself to Uploaders.
-  * Updated Standards-Version to 3.8.3.
-
- -- Ludovic Claude <ludovic.claude at laposte.net>  Thu, 17 Dec 2009 20:09:00 +0100
-
-maven-debian-helper (0.6) unstable; urgency=low
-
-  * Update everything to version 0.6 because 2 scripts have still been at
-    version 0.4. We should make the package more version agnostic.
-
- -- Torsten Werner <twerner at debian.org>  Sun, 16 Aug 2009 15:18:57 +0200
-
-maven-debian-helper (0.5) unstable; urgency=low
-
-  * Update Standards-Version to 3.8.2
-  * Follow the new convention for Javadoc:
-    javadoc in /usr/share/doc/package/api even if it's in package-doc
-
- -- Ludovic Claude <ludovic.claude at laposte.net>  Sun, 02 Aug 2009 11:42:31 +0100
-
-maven-debian-helper (0.4) experimental; urgency=low
-
-  [Ludovic Claude]
-  * Add myself to Uploaders
-  * Use maven-ant-helper for the build instead of recursively building
-    this package with itself (which required an ugly bootstrap script)
-  * Integrate the cdbs helper with maven-repo-helper, this unifies the
-    way the Maven repository is used, and simplifies the job of the
-    packager as maven-repo-helper takes care of most POM patching work.
-  * Use default-jdk for the build
-  * Change section to java, update Standards-Version to 3.8.1
-  * Generate Javadoc API automatically.
-  * Add mh_make tool to generate Debian packaging automatically from
-    a Maven project.
-    
-  [Torsten Werner]
-  * Implement pom faking.
-
- -- Ludovic Claude <ludovic.claude at laposte.net>  Tue, 14 Jul 2009 20:17:16 +0100
-
-maven-debian-helper (0.3) unstable; urgency=low
-
-  * Implement better exception handling.
-  * Create our own maven repository during build time.
-  * Set version for non plugins to '[$version]' instead of '$version' only.
-
- -- Torsten Werner <twerner at debian.org>  Sun, 25 Jan 2009 23:16:20 +0100
-
-maven-debian-helper (0.2) unstable; urgency=low
-
-  * Rename the bootstrap script.
-  * Add a manpage for mvn-debian.
-
- -- Torsten Werner <twerner at debian.org>  Sat, 17 Jan 2009 12:13:35 +0100
-
-maven-debian-helper (0.1) unstable; urgency=low
-
-  * Initial release. (Closes: #508511)
-
- -- Torsten Werner <twerner at debian.org>  Mon, 05 Jan 2009 11:47:25 +0100

Copied: tags/maven-debian-helper/1.4.5/debian/changelog (from rev 14654, trunk/maven-debian-helper/debian/changelog)
===================================================================
--- tags/maven-debian-helper/1.4.5/debian/changelog	                        (rev 0)
+++ tags/maven-debian-helper/1.4.5/debian/changelog	2011-09-01 20:58:30 UTC (rev 14656)
@@ -0,0 +1,302 @@
+maven-debian-helper (1.4.5) unstable; urgency=low
+
+  * SysInstallMojo: Support "finalName" attribute to override
+    expected artifact (conform to Maven standards).
+  * SysInstallMojo: Read usj-name, usj-version and no-usj-versionless.
+    Closes: #629621.
+
+ -- Damien Raude-Morvan <drazzib at debian.org>  Thu, 01 Sep 2011 22:52:29 +0200
+
+maven-debian-helper (1.4.4) unstable; urgency=low
+
+  [ Ludovic Claude ]
+  * Move apt-file, devscripts, subversion from Recommends: to Suggests: as
+    they are only required when mh_make is used
+  * mh_make: rescan the Maven repository after the user installs a
+    required package.
+  * mh_resolve_dependencies: Also launch Maven in offline mode
+    (with --offline option) when --offline parameter is used.
+
+  [ Damien Raude-Morvan ]
+  * Upload to unstable (Closes: #637656).
+  * mh_make: Update debian/copyright template for latest DEP-5 format.
+  * mh_resolve_dependencies: Don't use mvn directly but call to
+    DependenciesSolver main (so packages can have a main pom
+    in other directory than root).
+  * DependenciesSolver: Add new parameters :
+    - --non-explore: doesn't explore directories for pom.xml
+    - --base-directory: path to root directory of package
+  * maven.mk: Send base-directory and non-explore parameters when calling
+    mh_resolve_dependencies.
+  * Bump Standards-Version to 3.9.2: no changes needed.
+
+ -- Damien Raude-Morvan <drazzib at debian.org>  Sat, 20 Aug 2011 16:25:50 +0200
+
+maven-debian-helper (1.4.3) unstable; urgency=low
+
+  * DependenciesSolver: Don't use Properties.store() method since
+    it escape some chars (like " >\=") from variables.
+    Replace it with simple FileWriter. Closes: #628272.
+  * SysInstallMojo: Send "--keep-elements" flag to POMCleaner if its
+    set in <pkg>.poms file. Thanks to James Page <james.page at canonical.com>.
+    Closes: #613364
+  * mh_resolve_dependencies: Always launch Maven in offline mode
+    with --offline option (as already done on mh_make). Closes: #629356
+  * SysInstallDocMojo, SysInstallMojo: Drop initProperties method and only rely
+    on Maven mojo attributes injection of "debianPackage" and "destPackage".
+    Closes: #628693.
+  * mh_resolve_dependencies: New --javadoc param, send from maven.mk CDBS file
+    to automatically compute Javadoc dependencies when there is some *-doc
+    package. Closes: #628703.
+
+ -- Damien Raude-Morvan <drazzib at debian.org>  Thu, 09 Jun 2011 00:11:08 +0200
+
+maven-debian-helper (1.4.2) unstable; urgency=low
+
+  * mh_resolve_dependencies: Handle --verbose option has described in
+    documentation (it was previously just ignored).
+  * DependenciesSolver: In case we didn't found anything for "jar" type,
+    just check for a "bundle" type inside repository
+
+ -- Damien Raude-Morvan <drazzib at debian.org>  Sat, 14 May 2011 22:59:17 +0200
+
+maven-debian-helper (1.4.1) unstable; urgency=low
+
+  * Upload to unstable.
+
+ -- Torsten Werner <twerner at debian.org>  Wed, 09 Feb 2011 21:42:36 +0100
+
+maven-debian-helper (1.4) experimental; urgency=low
+
+  * d/control: Add Recommends on devscripts (which provides licensecheck)
+  * mh_make: 
+     - Improve generated copyright
+     - Fix generated rules for a build using ant
+     - When ignoring dependencies, don't fail the build
+     - When ant is used as the build tool, generate the build.xml file
+       required for multi projects.
+     - use licensecheck as an additional source of information for licenses
+
+ -- Ludovic Claude <ludovic.claude at laposte.net>  Fri, 12 Nov 2010 12:26:37 +0100
+
+maven-debian-helper (1.3) experimental; urgency=low
+
+  * ${maven:Depends} and similar substitution vars: add
+    version constraints when possible
+  * Use dpkg to resolve the dependent packages in ${maven:DocDepends}
+    (Closes: #588114)
+  * Use dpkg to search for the documentation package (Closes: #588114)
+  * mh_make: suggest installing missing dependencies which are not ignored
+    during the build
+  * add property debian.hasPackageVersion property, if true in the
+    repository POM then other packages depending on a POM with this property on
+    will have an addition version constraint generated in ${maven:Depends}
+  * mh_make: detect when debian.hasPackageVersion can be used, ask for the
+    upstream version of the package for confirmation.
+  * d/control: add Recommends: on subversion as it's used by mh_make,
+     add Build-Depends on libmaven-plugin-tools-java and junit
+  * d/build.xml: fix build when previous versions of this package are
+    not already installed on the system.
+  * d/rules: use debian/.mh instead of debian/tmp as temp directory to better
+    comply with Debian policy.
+
+ -- Ludovic Claude <ludovic.claude at laposte.net>  Wed, 29 Sep 2010 00:17:34 +0200
+
+maven-debian-helper (1.2) unstable; urgency=low
+
+  [ Ludovic Claude ]
+  * debian/control: Update Standards-Version to 3.9.1, no changes
+  * mh_make: fix issue when no-parent option is needed. Thanks Torsten
+    for the report (Closes: #591513)
+  * mh_make: assist with the rules to transform the versions
+  * mh_make: use existing package.poms files if any
+  * maven.mk: all rules in maven.ignoreRules are also used during the
+    clean phase, so there is no need to duplicate them in
+    maven.cleanIgnoreRules also.
+
+  [ Damien Raude-Morvan ]
+  * DependenciesSolver: Fix ClassCastException when using mh_make.
+
+ -- Ludovic Claude <ludovic.claude at laposte.net>  Thu, 16 Sep 2010 23:28:02 +0200
+
+maven-debian-helper (1.1) unstable; urgency=low
+
+  * debian/control: Update Standards-Version to 3.9.0, no changes
+  * Fix compilation issues with gcj
+  * mh_make: 
+      - update generated control to use Standards-Version 3.9.0
+      - improve useability and recognize more plugins and extensions
+      - read existing maven rules in debian folder, don't ask twice the
+        same questions.
+  * Support installing build artifacts in different packages with the
+    --package option in the <package>.poms file
+  * Add mvn-build to phony rules to avoid creating a file called
+    mvn-build during the build (Closes: #589635)
+
+ -- Ludovic Claude <ludovic.claude at laposte.net>  Mon, 28 Jun 2010 23:10:50 +0200
+
+maven-debian-helper (1.0) unstable; urgency=low
+
+  * debian/control:
+     - replace Depends: on openjdk-6-jre | java2-runtime by default-jdk
+     - remove Conflits: on old maven-debian-helper as there is already
+       a version constraint for a new version of this package.
+  * mh_make:
+      - supports checking out code from the svn of dev.java.net
+      - use upstream copyright when available for debian/* files
+      - update Standards version, generate with source 3.0 (quilt) package
+        format
+      - mh_make --from-svn: improve package name proposal for URLs
+        containing /tags/
+      - ask to ignore missing dependencies
+  * maven.mk: 
+      - add before-mvn-build:: and after-mvn-build:: targets
+        to be able to insert custom actions before and after running the Maven
+        build
+      - add DEB_MAVEN_INSTALL_TO_USJ variable. Set this variable to false to
+        prevent maven.mk to install the jars in /usr/share/java. This
+        variable defaults to true.
+      - add call to mh_clean to remove temporary files
+  * Add -Duse.maven.repo.local option to maven-debian-plugin:install
+    and install-doc to give the option to deploy artifacts on the
+    local (and temporary) Maven repository used by the Debian build
+    Typical use-case: bootstrapping the build of a project with 
+    some artifacts of the project pre-built and installed in the tmp repo
+    before the normal build is executed. See the antlr3 package for an example
+  * SysInstallMojo: clean the target directory before an installation if the
+    directory is a symlink that was created by copy-repo.sh
+
+ -- Ludovic Claude <ludovic.claude at laposte.net>  Sun, 16 May 2010 14:42:29 +0200
+
+maven-debian-helper (0.12) unstable; urgency=low
+
+  * SysInstallDocMojo: Fix methods override to install -javadoc JAR flavors.
+
+ -- Damien Raude-Morvan <drazzib at debian.org>  Mon, 05 Apr 2010 23:46:22 +0200
+
+maven-debian-helper (0.11) unstable; urgency=low
+
+  * SysInstallMojo: Read generated pom.properties after POMCleaner
+    calls to allow changing groupId and artifactId inside maven.rules
+    (trying to mimic mh_installpom/mh_installjar behavior)
+  * Switch to 3.0 (native) source format
+
+ -- Damien Raude-Morvan <drazzib at debian.org>  Mon, 05 Apr 2010 21:48:23 +0200
+
+maven-debian-helper (0.10) unstable; urgency=low
+
+  * Add --non-interactive option to mh_lspoms and use it
+    in maven.mk to avoid asking questions during a build
+    (Closes: #574399)
+
+ -- Ludovic Claude <ludovic.claude at laposte.net>  Wed, 24 Mar 2010 23:48:29 +0100
+
+maven-debian-helper (0.9) unstable; urgency=low
+
+  * maven-vars.mk: Fix detection of DEB_DOC_PACKAGE
+    Only exclude first exact match from dh_listpackages result
+    instead of all packages which contains main package name.
+  * maven.mk: Pass DEB_DOC_PACKAGE when invoke DEB_MAVEN_DOC_TARGET.
+
+ -- Damien Raude-Morvan <drazzib at debian.org>  Mon, 01 Mar 2010 21:22:34 +0100
+
+maven-debian-helper (0.8) unstable; urgency=low
+
+  * mh_make falls back on EMAIL when DEBEMAIL is not set
+  * mh_make handles better multi projects
+  * mh_make generates projects following the Debian 3.8.3 policy
+  * Documentation improvements
+  * maven.mk: unpatch the poms in cleanbuilddir, to have a good
+    clean sequence when maven.mk is used with a patch system -
+    clean target -> mvn clean -> rm tmp files -> unpatch pom files
+     -> unpatch files with patch system
+  * Read rules from the Maven repository to force the version of
+    Maven plugins to be the same as in the repository
+  * maven.mk removes some elements from the POM files when their
+    use is against the Debian policy (<repositories> as they
+    imply downloading artifacts from the Internet, 
+    <distributionManagement> as it implies publishing on the net
+    or in a location not controlled by Debian) or when they are
+    not needed and risk pulling out unwanted dependencies
+    (<reports> which is not used if a documentation package is
+    not generated)
+  * maven.mk adds a patch to Maven to disable using the
+    maven-site-plugin when no documentation package is generated.
+    This helps to reduce the amount of build dependencies
+
+ -- Ludovic Claude <ludovic.claude at laposte.net>  Mon, 04 Jan 2010 23:13:29 +0100
+
+maven-debian-helper (0.7) unstable; urgency=low
+
+  [Ludovic Claude]
+  * Make the package more version agnostic. Versions are discovered
+    at runtime
+  * mh_make has a new option, --from-svn, to download automatically
+    the sources from a SVN repository and generate the Debian packaging
+    for the project.
+  * Add apt-file to Recommends: as it's used by mh_lspoms
+    (Closes: #542511)
+
+  [Michael Koch]
+  * Add Recommends: apt-file to maven-debian-helper (Closes: #542511).
+  * Build-Depends on debhelper (>= 7).
+  * Added myself to Uploaders.
+  * Updated Standards-Version to 3.8.3.
+
+ -- Ludovic Claude <ludovic.claude at laposte.net>  Thu, 17 Dec 2009 20:09:00 +0100
+
+maven-debian-helper (0.6) unstable; urgency=low
+
+  * Update everything to version 0.6 because 2 scripts have still been at
+    version 0.4. We should make the package more version agnostic.
+
+ -- Torsten Werner <twerner at debian.org>  Sun, 16 Aug 2009 15:18:57 +0200
+
+maven-debian-helper (0.5) unstable; urgency=low
+
+  * Update Standards-Version to 3.8.2
+  * Follow the new convention for Javadoc:
+    javadoc in /usr/share/doc/package/api even if it's in package-doc
+
+ -- Ludovic Claude <ludovic.claude at laposte.net>  Sun, 02 Aug 2009 11:42:31 +0100
+
+maven-debian-helper (0.4) experimental; urgency=low
+
+  [Ludovic Claude]
+  * Add myself to Uploaders
+  * Use maven-ant-helper for the build instead of recursively building
+    this package with itself (which required an ugly bootstrap script)
+  * Integrate the cdbs helper with maven-repo-helper, this unifies the
+    way the Maven repository is used, and simplifies the job of the
+    packager as maven-repo-helper takes care of most POM patching work.
+  * Use default-jdk for the build
+  * Change section to java, update Standards-Version to 3.8.1
+  * Generate Javadoc API automatically.
+  * Add mh_make tool to generate Debian packaging automatically from
+    a Maven project.
+    
+  [Torsten Werner]
+  * Implement pom faking.
+
+ -- Ludovic Claude <ludovic.claude at laposte.net>  Tue, 14 Jul 2009 20:17:16 +0100
+
+maven-debian-helper (0.3) unstable; urgency=low
+
+  * Implement better exception handling.
+  * Create our own maven repository during build time.
+  * Set version for non plugins to '[$version]' instead of '$version' only.
+
+ -- Torsten Werner <twerner at debian.org>  Sun, 25 Jan 2009 23:16:20 +0100
+
+maven-debian-helper (0.2) unstable; urgency=low
+
+  * Rename the bootstrap script.
+  * Add a manpage for mvn-debian.
+
+ -- Torsten Werner <twerner at debian.org>  Sat, 17 Jan 2009 12:13:35 +0100
+
+maven-debian-helper (0.1) unstable; urgency=low
+
+  * Initial release. (Closes: #508511)
+
+ -- Torsten Werner <twerner at debian.org>  Mon, 05 Jan 2009 11:47:25 +0100

Deleted: tags/maven-debian-helper/1.4.5/maven-debian-plugin/src/main/java/org/debian/maven/plugin/SysInstallMojo.java
===================================================================
--- trunk/maven-debian-helper/maven-debian-plugin/src/main/java/org/debian/maven/plugin/SysInstallMojo.java	2011-08-30 20:14:21 UTC (rev 14621)
+++ tags/maven-debian-helper/1.4.5/maven-debian-plugin/src/main/java/org/debian/maven/plugin/SysInstallMojo.java	2011-09-01 20:58:30 UTC (rev 14656)
@@ -1,547 +0,0 @@
-package org.debian.maven.plugin;
-
-/*
- * Copyright 2009 Torsten Werner, Ludovic Claude.
- *
- * 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.
- */
-
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import org.codehaus.plexus.util.FileUtils;
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.debian.maven.repo.ListOfPOMs;
-import org.debian.maven.repo.POMCleaner;
-import org.debian.maven.repo.POMTransformer;
-
-/**
- * Install pom and jar files into the /usr/share/hierarchy
- *
- * @goal sysinstall
- */
-public class SysInstallMojo extends AbstractMojo
-{
-  // ----------------------------------------------------------------------
-  // Mojo parameters
-  // ----------------------------------------------------------------------
-
-  /**
-   * groupId
-   *
-   * @parameter expression="${project.groupId}"
-   * @required
-   * @readonly
-   */
-  private String groupId;
-
-  /**
-   * artifactId
-   *
-   * @parameter expression="${project.artifactId}"
-   * @required
-   * @readonly
-   */
-  private String artifactId;
-  
-  /**
-   * destGroupId
-   * 
-   * @parameter expression="${project.groupId}"
-   * @required
-   */
-  private String destGroupId;
-
-  /**
-   * destArtifactId
-   * 
-   * @parameter expression="${project.artifactId}"
-   * @required
-   */
-  private String destArtifactId;
-
-  /**
-   * version
-   *
-   * @parameter expression="${project.version}"
-   * @required
-   * @readonly
-   */
-  private String version;
-
-  /**
-   * debianVersion
-   *
-   * @parameter
-   */
-  private String debianVersion;
-
-  /**
-   * directory where the current pom.xml can be found
-   *
-   * @parameter expression="${basedir}"
-   * @required
-   * @readonly
-   */
-  private File basedir;
-
-  /**
-   * directory of the jar file
-   *
-   * @parameter expression="${project.build.directory}"
-   * @required
-   * @readonly
-   */
-  private String jarDir;
-
-  /**
-   * Debian directory
-   *
-   * @parameter expression="${debian.dir}"
-   */
-  private File debianDir;
-
-  /**
-   * Debian package (send from commande line)
-   *
-   * @parameter expression="${debian.package}"
-   */
-  private String debianPackage;
-  
-  /**
-   * Debian package destination (set by xxx.poms file).
-   * By defaul, equals to <code>debianPackage</code> attribute.
-   *
-   * @parameter expression="${debian.package}"
-   */
-  private String destPackage;
-
-  /**
-   * @parameter expression="${maven.rules}" default-value="maven.rules"
-   * @required
-   */
-  private String mavenRules;
-
-  /**
-   * root directory of the Maven repository
-   *
-   * @parameter expression="${basedir}"
-   * @readonly
-   */
-  private File repoDir;
-
-    /**
-     * Install the jar to /usr/share/java if true. Default is true
-     * @parameter expression="${install.to.usj}" default-value="true"
-     */
-  private boolean installToUsj = true;
-
-  // ----------------------------------------------------------------------
-  // Public methods
-  // ----------------------------------------------------------------------
-
-  public void execute() throws MojoExecutionException
-  {
-    try
-    {
-      runMojo();
-    }
-    catch(IOException e)
-    {
-      getLog().error("execution failed", e);
-      throw new MojoExecutionException("IOException catched");
-    }
-  }
-
-  // ----------------------------------------------------------------------
-  // Private methods
-  // ----------------------------------------------------------------------
-
-  protected String getArtifactId()
-  {
-      return artifactId;
-  }
-  
-  protected String getDestArtifactId()
-  {
-      return destArtifactId;
-  }
-
-  protected String getVersion()
-  {
-      return version;
-  }
-
-  protected String getDebianVersion()
-  {
-      return debianVersion;
-  }
-
-  protected File getDebianDir()
-  {
-      return debianDir;
-  }
-
-  protected String getDebianPackage()
-  {
-      return debianPackage;
-  }
-
-  protected String getDestPackage()
-  {
-      return destPackage;    
-  }
-
-  /**
-   * optional destination prefix, empty by default
-   */
-  protected String packagePath()
-  {
-    return "";
-  }
-
-  /**
-   * returns e.g. /org/debian/maven/maven-debian-plugin/0.1/
-   */
-  protected final String repoPath()
-  {
-    return "/" + groupId.replace( '.', '/' ) + "/" + artifactId + "/" + version + "/";
-  }
-  
-  /**
-   * returns e.g. /org/debian/maven/maven-debian-plugin/0.1/
-   */
-  protected final String destRepoPath()
-  {
-    return "/" + destGroupId.replace( '.', '/' ) + "/" + destArtifactId + "/" + version + "/";
-  }
-
-  /**
-   * returns e.g. /org/debian/maven/maven-debian-plugin/debian/
-   */
-  protected final String debianRepoPath()
-  {
-    return "/" + destGroupId.replace( '.', '/' ) + "/" + destArtifactId + "/" + debianVersion + "/";
-  }
-
-  /**
-   * absolute path to destination dir
-   */
-  protected String fullRepoPath()
-  {
-    return packagePath() + "/usr/share/maven-repo" + destRepoPath();
-  }
-
-  /**
-   * absolute path to destination dir
-   */
-  protected String debianFullRepoPath()
-  {
-    return packagePath() + "/usr/share/maven-repo" + debianRepoPath();
-  }
-
-  protected String pomName()
-  {
-    return artifactId + "-" + version + ".pom";
-  }
-  
-  protected String destPomName()
-  {
-    return destArtifactId + "-" + version + ".pom";
-  }
-
-  protected String debianPomName()
-  {
-    return destArtifactId + "-" + debianVersion + ".pom";
-  }
-
-  private String pomSrcPath()
-  {
-    return basedir.getAbsolutePath() + "/pom.xml";
-  }
-
-  private String cleanedPomSrcPath()
-  {
-    return basedir.getAbsolutePath() + "/target/pom.xml";
-  }
-
-  private String cleanedPomPropertiesSrcPath()
-  {
-    return basedir.getAbsolutePath() + "/target/pom.properties";
-  }
-
-  private String debianPomSrcPath()
-  {
-    return basedir.getAbsolutePath() + "/target/pom.debian.xml";
-  }
-
-  private String debianPomPropertiesSrcPath()
-  {
-    return basedir.getAbsolutePath() + "/target/pom.debian.properties";
-  }
-
-  private String pomDestPath()
-  {
-    return fullRepoPath() + destPomName();
-  }
-
-  private String debianPomDestPath()
-  {
-    return debianFullRepoPath() + debianPomName();
-  }
-
-  protected String jarName()
-  {
-    return artifactId + "-" + version + ".jar";
-  }
-  
-  protected String destJarName()
-  {
-    return destArtifactId + "-" + version + ".jar";
-  }
-
-  protected String debianJarName()
-  {
-    return destArtifactId + "-" + debianVersion + ".jar";
-  }
-
-  protected final String fullJarName()
-  {
-    return jarDir + "/" + jarName();
-  }
-
-  protected final String jarDestPath()
-  {
-    return fullRepoPath() + destJarName();
-  }
-
-  protected final String jarDestRelPath()
-  {
-    return "../" + version + "/" + destJarName();
-  }
-
-  protected final String debianJarDestPath()
-  {
-    return debianFullRepoPath() + debianJarName();
-  }
-
-  /** 
-   * jar file name without version number
-   */
-  protected final String compatName()
-  {
-    return destArtifactId + ".jar";
-  }
-
-  protected final String compatSharePath()
-  {
-    return packagePath() + "/usr/share/java/";
-  }
-
-  protected final String compatRelPath()
-  {
-    return "../maven-repo" + destRepoPath() + destJarName();
-  }
-
-  protected String fullCompatPath()
-  {
-    return compatSharePath() + compatName();
-  }
-
-  protected String versionedFullCompatPath()
-  {
-    return compatSharePath() + destJarName();
-  }
-
-  /**
-   * command for creating the relative symlink
-   */
-  private String[] linkCommand(String source, String dest)
-  {
-    String[] command = {"ln", "-s", source, dest};
-    return command;
-  }
-
-  private void mkdir(String path) throws IOException
-  {
-    File destinationDirectory = new File(path);
-    if (destinationDirectory.isDirectory())
-    {
-      return;
-    }
-    if (!destinationDirectory.mkdirs())
-    {
-      throw new IOException("cannot create destination directory " + path);
-    }
-  }
-
-  private void run(String[] command) throws IOException
-  {
-    Runtime.getRuntime().exec(command, null);
-  }
-
-  /**
-   * if a jar exists: copy it to the Maven repository
-   */
-  protected void copyJar() throws IOException
-  {
-    File jarFile = new File(fullJarName());
-    if (jarFile.exists())
-    {
-      FileUtils.copyFile(jarFile, new File(jarDestPath()));
-      if (debianVersion != null && !debianVersion.equals(version))
-      {
-        mkdir(debianFullRepoPath());
-        run(linkCommand(jarDestRelPath(), debianJarDestPath()));
-      }
-    }
-  }
-
-  /**
-   * if a jar exists: symlink it to the compat share dir
-   */
-  private void symlinkJar() throws IOException
-  {
-    File jarFile = new File(fullJarName());
-    if (jarFile.exists())
-    {
-      mkdir(compatSharePath());
-      System.out.println("Install link to " + artifactId + " into /usr/share/java");
-      run(linkCommand(compatRelPath(), fullCompatPath()));
-      run(linkCommand(compatRelPath(), versionedFullCompatPath()));
-    }
-  }
-
-  /**
-   * clean the pom.xml
-   */
-  private void cleanPom()
-  {
-    File pomOptionsFile = new File(debianDir, debianPackage + ".poms");
-    ListOfPOMs listOfPOMs = new ListOfPOMs(pomOptionsFile);
-
-    // Use the saved pom before cleaning as it was untouched by the transform operation
-    String pomPath = pomSrcPath() + ".save";
-    File pomFile = new File(pomPath);
-    String originalPomPath = pomSrcPath();
-    File originalPom = new File(originalPomPath);
-    if (! pomFile.exists())
-    {
-        pomFile = originalPom;
-        pomPath = originalPomPath;
-    }
-
-    String relativePomPath = originalPom.getAbsolutePath();
-    relativePomPath = relativePomPath.substring(debianDir.getParentFile().getAbsolutePath().length() + 1);
-
-    ListOfPOMs.POMOptions pomOption = listOfPOMs.getPOMOptions(relativePomPath);
-
-    if (pomOption != null && pomOption.isIgnore()) {
-        throw new RuntimeException("POM file " + pomFile + " should be ignored");
-    }
-    if (pomOption != null && pomOption.getDestPackage() != null) {
-      destPackage = pomOption.getDestPackage();
-    }
-
-    List params = new ArrayList();
-    params.add("--keep-pom-version");
-      
-    params.add("--package=" + destPackage);
-    String mavenRulesPath = new File(debianDir, mavenRules).getAbsolutePath();
-    params.add("--rules=" + mavenRulesPath);
-
-    System.out.println("Cleaning pom file: " + pomFile + " with options:");
-    System.out.println("\t--keep-pom-version --package=" + destPackage);
-    System.out.println("\t--rules=" + mavenRulesPath);
-
-    // add optional --no-parent option
-    if (pomOption != null && pomOption.isNoParent()) {
-        params.add("--no-parent");
-        System.out.println("\t--no-parent");
-    }
-    
-    // add options --keep-elements option
-    if (pomOption != null && pomOption.getKeepElements() != null) {
-        params.add("--keep-elements=" + pomOption.getKeepElements());
-        System.out.println("\t--keep-elements=" + pomOption.getKeepElements());
-    }
-    
-    params.add(pomFile.getAbsolutePath());
-    params.add(cleanedPomSrcPath());
-    params.add(cleanedPomPropertiesSrcPath());
-
-    POMCleaner.main((String[]) params.toArray(new String[params.size()]));
-
-    Properties pomProperties = new Properties();
-    try {
-      pomProperties.load(new FileReader(cleanedPomPropertiesSrcPath()));
-    } catch (IOException ex) {
-      ex.printStackTrace();
-    }
-    destGroupId = pomProperties.getProperty("groupId");
-    destArtifactId = pomProperties.getProperty("artifactId");
-    debianVersion = pomProperties.getProperty("debianVersion");
-
-    if (debianVersion != null && !debianVersion.equals(version))
-    {
-      params.remove(0);
-      params.remove(params.size() -1);
-      params.remove(params.size() -1);
-      params.add(debianPomSrcPath());
-      params.add(debianPomPropertiesSrcPath());
-
-      POMCleaner.main((String[]) params.toArray(new String[params.size()]));
-    }
-  }
- 
-  /**
-   * copy the pom.xml
-   */
-  protected void copyPom() throws IOException
-  {
-    FileUtils.copyFile(new File(cleanedPomSrcPath()), new File(pomDestPath()));
-    if (debianVersion != null && !debianVersion.equals(version))
-    {
-      FileUtils.copyFile(new File(debianPomSrcPath()), new File(debianPomDestPath()));
-    }
-  }
-
-  /**
-     * Prepare the destination  directories: remove the directory symlinks that were created
-     * by copy-repo.sh if they exist as they point to a directory owned by root and that cannot
-     * be modified.
-     */
-  protected void prepareDestDirs() {
-      // Simply try to delete the path. If it's a symlink, it will work, otherwise delete() returns false
-      new File(fullRepoPath()).delete();
-      new File(debianFullRepoPath()).delete();
-  }
-  /**
-   * do the actual work
-   */
-  protected void runMojo() throws IOException
-  {
-    cleanPom();
-    prepareDestDirs();
-    copyPom();
-    copyJar();
-    if (installToUsj) {
-      symlinkJar();
-    }
-  }
-}

Copied: tags/maven-debian-helper/1.4.5/maven-debian-plugin/src/main/java/org/debian/maven/plugin/SysInstallMojo.java (from rev 14650, trunk/maven-debian-helper/maven-debian-plugin/src/main/java/org/debian/maven/plugin/SysInstallMojo.java)
===================================================================
--- tags/maven-debian-helper/1.4.5/maven-debian-plugin/src/main/java/org/debian/maven/plugin/SysInstallMojo.java	                        (rev 0)
+++ tags/maven-debian-helper/1.4.5/maven-debian-plugin/src/main/java/org/debian/maven/plugin/SysInstallMojo.java	2011-09-01 20:58:30 UTC (rev 14656)
@@ -0,0 +1,645 @@
+package org.debian.maven.plugin;
+
+/*
+ * Copyright 2009 Torsten Werner, Ludovic Claude.
+ *
+ * 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.
+ */
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.codehaus.plexus.util.FileUtils;
+import org.debian.maven.repo.ListOfPOMs;
+import org.debian.maven.repo.POMCleaner;
+
+/**
+ * Install pom and jar files into the /usr/share/hierarchy
+ *
+ * @goal sysinstall
+ */
+public class SysInstallMojo extends AbstractMojo
+{
+  // ----------------------------------------------------------------------
+  // Mojo parameters
+  // ----------------------------------------------------------------------
+
+  /**
+   * groupId
+   *
+   * @parameter expression="${project.groupId}"
+   * @required
+   * @readonly
+   */
+  private String groupId;
+
+  /**
+   * artifactId
+   *
+   * @parameter expression="${project.artifactId}"
+   * @required
+   * @readonly
+   */
+  private String artifactId;
+  
+  /**
+   * destGroupId
+   * 
+   * @parameter expression="${project.groupId}"
+   * @required
+   */
+  private String destGroupId;
+
+  /**
+   * destArtifactId
+   * 
+   * @parameter expression="${project.artifactId}"
+   * @required
+   */
+  private String destArtifactId;
+
+  /**
+   * version
+   *
+   * @parameter expression="${project.version}"
+   * @required
+   * @readonly
+   */
+  private String version;
+
+  /**
+   * debianVersion
+   *
+   * @parameter
+   */
+  private String debianVersion;
+
+  /**
+   * directory where the current pom.xml can be found
+   *
+   * @parameter expression="${basedir}"
+   * @required
+   * @readonly
+   */
+  private File basedir;
+
+  /**
+   * directory of the jar file
+   *
+   * @parameter expression="${project.build.directory}"
+   * @required
+   * @readonly
+   */
+  private String jarDir;
+  
+  /**
+   * finalname of the artifact
+   *
+   * @parameter expression="${project.build.finalName}"
+   * @required
+   * @readonly
+   */
+  private String finalName;
+
+  /**
+   * Debian directory
+   *
+   * @parameter expression="${debian.dir}"
+   */
+  private File debianDir;
+
+  /**
+   * Debian package (send from commande line)
+   *
+   * @parameter expression="${debian.package}"
+   */
+  private String debianPackage;
+  
+  /**
+   * Debian package destination (set by xxx.poms file).
+   * By defaul, equals to <code>debianPackage</code> attribute.
+   *
+   * @parameter expression="${debian.package}"
+   */
+  private String destPackage;
+
+  /**
+   * @parameter expression="${maven.rules}" default-value="maven.rules"
+   * @required
+   */
+  private String mavenRules;
+
+  /**
+   * root directory of the Maven repository
+   *
+   * @parameter expression="${basedir}"
+   * @readonly
+   */
+  private File repoDir;
+
+    /**
+     * Install the jar to /usr/share/java if true. Default is true
+     * @parameter expression="${install.to.usj}" default-value="true"
+     */
+  private boolean installToUsj = true;
+
+  /**
+   * Basename of the JAR inside /usr/share/java
+   */
+	private String usjName;
+
+	/**
+	 * Version of the JAR install /usr/share/java
+	 */
+    private String usjVersion;
+
+    /**
+     * If true, disable installation of version-less JAR into /usr/share/java
+     */
+	private boolean noUsjVersionless;
+
+  // ----------------------------------------------------------------------
+  // Public methods
+  // ----------------------------------------------------------------------
+
+  public void execute() throws MojoExecutionException
+  {
+    try
+    {
+      runMojo();
+    }
+    catch(IOException e)
+    {
+      getLog().error("execution failed", e);
+      throw new MojoExecutionException("IOException catched");
+    }
+  }
+
+  // ----------------------------------------------------------------------
+  // Private methods
+  // ----------------------------------------------------------------------
+
+  protected String getArtifactId()
+  {
+      return artifactId;
+  }
+  
+  protected String getDestArtifactId()
+  {
+      return destArtifactId;
+  }
+
+  protected String getVersion()
+  {
+      return version;
+  }
+
+  protected String getDebianVersion()
+  {
+      return debianVersion;
+  }
+
+  protected File getDebianDir()
+  {
+      return debianDir;
+  }
+
+  protected String getDebianPackage()
+  {
+      return debianPackage;
+  }
+
+  protected String getDestPackage()
+  {
+      return destPackage;    
+  }
+
+  /**
+   * optional destination prefix, empty by default
+   */
+  protected String packagePath()
+  {
+    return "";
+  }
+
+  /**
+   * returns e.g. /org/debian/maven/maven-debian-plugin/0.1/
+   */
+  protected final String repoPath()
+  {
+    return "/" + groupId.replace( '.', '/' ) + "/" + artifactId + "/" + version + "/";
+  }
+  
+  /**
+   * returns e.g. /org/debian/maven/maven-debian-plugin/0.1/
+   */
+  protected final String destRepoPath()
+  {
+    return "/" + destGroupId.replace( '.', '/' ) + "/" + destArtifactId + "/" + version + "/";
+  }
+
+  /**
+   * returns e.g. /org/debian/maven/maven-debian-plugin/debian/
+   */
+  protected final String debianRepoPath()
+  {
+    return "/" + destGroupId.replace( '.', '/' ) + "/" + destArtifactId + "/" + debianVersion + "/";
+  }
+
+  /**
+   * absolute path to destination dir
+   */
+  protected String fullRepoPath()
+  {
+    return packagePath() + "/usr/share/maven-repo" + destRepoPath();
+  }
+
+  /**
+   * absolute path to destination dir
+   */
+  protected String debianFullRepoPath()
+  {
+    return packagePath() + "/usr/share/maven-repo" + debianRepoPath();
+  }
+
+  protected String pomName()
+  {
+    return artifactId + "-" + version + ".pom";
+  }
+  
+  protected String destPomName()
+  {
+    return destArtifactId + "-" + version + ".pom";
+  }
+
+  protected String debianPomName()
+  {
+    return destArtifactId + "-" + debianVersion + ".pom";
+  }
+
+  private String pomSrcPath()
+  {
+    return basedir.getAbsolutePath() + "/pom.xml";
+  }
+
+  private String cleanedPomSrcPath()
+  {
+    return basedir.getAbsolutePath() + "/target/pom.xml";
+  }
+
+  private String cleanedPomPropertiesSrcPath()
+  {
+    return basedir.getAbsolutePath() + "/target/pom.properties";
+  }
+
+  private String debianPomSrcPath()
+  {
+    return basedir.getAbsolutePath() + "/target/pom.debian.xml";
+  }
+
+  private String debianPomPropertiesSrcPath()
+  {
+    return basedir.getAbsolutePath() + "/target/pom.debian.properties";
+  }
+
+  private String pomDestPath()
+  {
+    return fullRepoPath() + destPomName();
+  }
+
+  private String debianPomDestPath()
+  {
+    return debianFullRepoPath() + debianPomName();
+  }
+
+  protected String jarName()
+  {
+	  String jarName = "";
+	  if (finalName != null && finalName.length() > 0)
+	  {
+		  jarName += finalName;
+	  }
+	  else
+	  {
+		  jarName += artifactId + "-" + version;
+	  }
+    return jarName + ".jar";
+  }
+  
+  protected String destJarName()
+  {
+    return destArtifactId + "-" + version + ".jar";
+  }
+
+  protected String debianJarName()
+  {
+    return destArtifactId + "-" + debianVersion + ".jar";
+  }
+
+  protected final String fullJarName()
+  {
+    return jarDir + "/" + jarName();
+  }
+
+  protected final String jarDestPath()
+  {
+    return fullRepoPath() + destJarName();
+  }
+
+  protected final String jarDestRelPath()
+  {
+    return "../" + version + "/" + destJarName();
+  }
+
+  protected final String debianJarDestPath()
+  {
+    return debianFullRepoPath() + debianJarName();
+  }
+
+  /** 
+   * jar file name without version number
+   */
+  protected final String compatName()
+  {
+    return destArtifactId + ".jar";
+  }
+
+  protected final String compatSharePath()
+  {
+    return packagePath() + "/usr/share/java/";
+  }
+
+  protected final String compatRelPath()
+  {
+    return "../maven-repo" + destRepoPath() + destJarName();
+  }
+
+  /**
+   * Example: /usr/share/java/xml-apis.jar
+   */
+  protected String fullCompatPath()
+  {
+    return compatSharePath() + destUsjJarName();
+  }
+
+  /**
+   * Example: /usr/share/java/xml-apis-1.3.04.jar
+   */
+  protected String versionedFullCompatPath()
+  {
+    return compatSharePath() + destUsjVersionnedJarName();
+  }
+  
+  /**
+   * Compute version-less filename for installation into /usr/share/java
+   */
+  private String destUsjJarName() {
+	  String usjJarName = "";
+	  if (usjName != null && usjName.length() > 0)
+	  {
+		  usjJarName += usjName;
+	  }
+	  else
+	  {
+		  usjJarName += destArtifactId;
+	  }
+		  
+	  return usjJarName + ".jar";
+  }
+
+  /**
+   * Compute versionned filename for installation into /usr/share/java
+   */
+  private String destUsjVersionnedJarName() {
+	  String usjJarName = "";
+	  if (usjName != null && usjName.length() > 0)
+	  {
+		  usjJarName += usjName;
+	  }
+	  else
+	  {
+		  usjJarName += destArtifactId;
+	  }
+	  
+	  if (usjVersion != null && usjVersion.length() > 0)
+	  {
+		  usjJarName += "-" + usjVersion;
+	  }
+	  else
+	  {
+		  usjJarName += "-" + version;
+	  }
+		  
+	  return usjJarName + ".jar";
+  }
+
+/**
+   * command for creating the relative symlink
+   */
+  private String[] linkCommand(String source, String dest)
+  {
+    String[] command = {"ln", "-s", source, dest};
+    return command;
+  }
+
+  private void mkdir(String path) throws IOException
+  {
+    File destinationDirectory = new File(path);
+    if (destinationDirectory.isDirectory())
+    {
+      return;
+    }
+    if (!destinationDirectory.mkdirs())
+    {
+      throw new IOException("cannot create destination directory " + path);
+    }
+  }
+
+  private void run(String[] command) throws IOException
+  {
+    Runtime.getRuntime().exec(command, null);
+  }
+
+  /**
+   * if a jar exists: copy it to the Maven repository
+   */
+  protected void copyJar() throws IOException
+  {
+    File jarFile = new File(fullJarName());
+    if (jarFile.exists())
+    {
+      FileUtils.copyFile(jarFile, new File(jarDestPath()));
+      if (debianVersion != null && !debianVersion.equals(version))
+      {
+        mkdir(debianFullRepoPath());
+        run(linkCommand(jarDestRelPath(), debianJarDestPath()));
+      }
+    }
+  }
+
+  /**
+   * if a jar exists: symlink it to the compat share dir
+   */
+  private void symlinkJar() throws IOException
+  {
+    File jarFile = new File(fullJarName());
+    if (jarFile.exists())
+    {
+      mkdir(compatSharePath());
+      System.out.println("Install link to " + artifactId + " into /usr/share/java");
+      if (!noUsjVersionless) {
+    	  run(linkCommand(compatRelPath(), fullCompatPath()));
+      }
+      run(linkCommand(compatRelPath(), versionedFullCompatPath()));
+    }
+  }
+
+  /**
+   * clean the pom.xml
+   */
+  private void cleanPom()
+  {
+    File pomOptionsFile = new File(debianDir, debianPackage + ".poms");
+    ListOfPOMs listOfPOMs = new ListOfPOMs(pomOptionsFile);
+
+    // Use the saved pom before cleaning as it was untouched by the transform operation
+    String pomPath = pomSrcPath() + ".save";
+    File pomFile = new File(pomPath);
+    String originalPomPath = pomSrcPath();
+    File originalPom = new File(originalPomPath);
+    if (! pomFile.exists())
+    {
+        pomFile = originalPom;
+        pomPath = originalPomPath;
+    }
+
+    String relativePomPath = originalPom.getAbsolutePath();
+    relativePomPath = relativePomPath.substring(debianDir.getParentFile().getAbsolutePath().length() + 1);
+
+    ListOfPOMs.POMOptions pomOption = listOfPOMs.getPOMOptions(relativePomPath);
+
+    if (pomOption != null && pomOption.isIgnore()) {
+        throw new RuntimeException("POM file " + pomFile + " should be ignored");
+    }
+    if (pomOption != null && pomOption.getDestPackage() != null) {
+      destPackage = pomOption.getDestPackage();
+    }
+    
+    // handle usj-name
+    if (pomOption != null && pomOption.getUsjName() != null) {
+      usjName = pomOption.getUsjName();
+    }
+    
+    // handle usj-version
+    if (pomOption != null && pomOption.getUsjVersion() != null) {
+      usjVersion = pomOption.getUsjVersion();
+    }
+    
+    // handle no-usj-versionless
+    if (pomOption != null) {
+      noUsjVersionless = pomOption.isNoUsjVersionless();
+    }
+
+    List params = new ArrayList();
+    params.add("--keep-pom-version");
+      
+    params.add("--package=" + destPackage);
+    String mavenRulesPath = new File(debianDir, mavenRules).getAbsolutePath();
+    params.add("--rules=" + mavenRulesPath);
+
+    System.out.println("Cleaning pom file: " + pomFile + " with options:");
+    System.out.println("\t--keep-pom-version --package=" + destPackage);
+    System.out.println("\t--rules=" + mavenRulesPath);
+
+    // add optional --no-parent option
+    if (pomOption != null && pomOption.isNoParent()) {
+        params.add("--no-parent");
+        System.out.println("\t--no-parent");
+    }
+    
+    // add options --keep-elements option
+    if (pomOption != null && pomOption.getKeepElements() != null) {
+        params.add("--keep-elements=" + pomOption.getKeepElements());
+        System.out.println("\t--keep-elements=" + pomOption.getKeepElements());
+    }
+    
+    params.add(pomFile.getAbsolutePath());
+    params.add(cleanedPomSrcPath());
+    params.add(cleanedPomPropertiesSrcPath());
+
+    POMCleaner.main((String[]) params.toArray(new String[params.size()]));
+
+    Properties pomProperties = new Properties();
+    try {
+      pomProperties.load(new FileReader(cleanedPomPropertiesSrcPath()));
+    } catch (IOException ex) {
+      ex.printStackTrace();
+    }
+    destGroupId = pomProperties.getProperty("groupId");
+    destArtifactId = pomProperties.getProperty("artifactId");
+    debianVersion = pomProperties.getProperty("debianVersion");
+
+    if (debianVersion != null && !debianVersion.equals(version))
+    {
+      params.remove(0);
+      params.remove(params.size() -1);
+      params.remove(params.size() -1);
+      params.add(debianPomSrcPath());
+      params.add(debianPomPropertiesSrcPath());
+
+      POMCleaner.main((String[]) params.toArray(new String[params.size()]));
+    }
+  }
+ 
+  /**
+   * copy the pom.xml
+   */
+  protected void copyPom() throws IOException
+  {
+    FileUtils.copyFile(new File(cleanedPomSrcPath()), new File(pomDestPath()));
+    if (debianVersion != null && !debianVersion.equals(version))
+    {
+      FileUtils.copyFile(new File(debianPomSrcPath()), new File(debianPomDestPath()));
+    }
+  }
+
+  /**
+     * Prepare the destination  directories: remove the directory symlinks that were created
+     * by copy-repo.sh if they exist as they point to a directory owned by root and that cannot
+     * be modified.
+     */
+  protected void prepareDestDirs() {
+      // Simply try to delete the path. If it's a symlink, it will work, otherwise delete() returns false
+      new File(fullRepoPath()).delete();
+      new File(debianFullRepoPath()).delete();
+  }
+  /**
+   * do the actual work
+   */
+  protected void runMojo() throws IOException
+  {
+    cleanPom();
+    prepareDestDirs();
+    copyPom();
+    copyJar();
+    if (installToUsj) {
+      symlinkJar();
+    }
+  }
+}




More information about the pkg-java-commits mailing list