Author: ludovicc-guest
Date: 2011-09-06 22:36:54 +0000 (Tue, 06 Sep 2011)
New Revision: 14736

Added:
   trunk/maven-repo-helper/doc/ref/dh_with_jh_maven_repo_helper.txt
   trunk/maven-repo-helper/doc/ref/dh_with_maven_repo_helper.txt
   trunk/maven-repo-helper/doc/ref/mh_checkrepo.txt
   trunk/maven-repo-helper/doc/ref/mh_clean.txt
   trunk/maven-repo-helper/doc/ref/mh_install.txt
   trunk/maven-repo-helper/doc/ref/mh_installsite.txt
   trunk/maven-repo-helper/doc/ref/mh_linkjars.txt
   trunk/maven-repo-helper/doc/reference4.txt
   trunk/maven-repo-helper/doc/reference5.txt
   trunk/maven-repo-helper/src/main/share/jh_maven_repo_helper.pm
Modified:
   trunk/maven-repo-helper/debian/changelog
   trunk/maven-repo-helper/debian/rules
   trunk/maven-repo-helper/doc/ref/mh_cleanpom.txt
   trunk/maven-repo-helper/doc/ref/mh_installjar.txt
   trunk/maven-repo-helper/doc/ref/mh_patchpom.txt
   trunk/maven-repo-helper/doc/ref/mh_patchpoms.txt
   trunk/maven-repo-helper/doc/ref/mh_unpatchpoms.txt
   trunk/maven-repo-helper/doc/reference3.txt
   trunk/maven-repo-helper/pom.xml
   trunk/maven-repo-helper/src/main/bin/mh_install
   trunk/maven-repo-helper/src/main/bin/mh_installjar
   trunk/maven-repo-helper/src/main/bin/mh_installsite
   trunk/maven-repo-helper/src/main/bin/mh_linkjar
   trunk/maven-repo-helper/src/main/bin/mh_linkjars
   trunk/maven-repo-helper/src/main/share/mh_lib.sh
Log:
* Deprecate mh_installjar -i option and replace it with -j to avoid conflicts
  with -i/--ignore-rules option used elsewhere.
* Review all options passed to the mh_* scripts, in particular --set-version
  for mh_installjar (Closes: #640730)

Modified: trunk/maven-repo-helper/debian/changelog
===================================================================
--- trunk/maven-repo-helper/debian/changelog    2011-09-06 22:04:38 UTC (rev 
14735)
+++ trunk/maven-repo-helper/debian/changelog    2011-09-06 22:36:54 UTC (rev 
14736)
@@ -1,4 +1,4 @@
-maven-repo-helper (1.5.3) UNRELEASED; urgency=low
+maven-repo-helper (1.6) UNRELEASED; urgency=low
 
   * Add tutorial, reference and repository specification in documentation
   * Update options on mh_installpom and mh_installpoms, to use the new 
arguments
@@ -12,8 +12,12 @@
     <package>.poms file and the POM files in your package).
   * Add mh_linkjars to link the jars listed in the .poms file, this is used by
     the jh_maven_repo_helper plugin for dh 7.
+  * Deprecate mh_installjar -i option and replace it with -j to avoid conflicts
+    with -i/--ignore-rules option used elsewhere.
+  * Review all options passed to the mh_* scripts, in particular --set-version
+    for mh_installjar (Closes: #640730)
 
- -- Ludovic Claude <[email protected]>  Wed, 03 Aug 2011 00:31:08 
+0100
+ -- Ludovic Claude <[email protected]>  Sun, 28 Aug 2011 00:31:08 
+0100
 
 maven-repo-helper (1.5.2) unstable; urgency=low
 

Modified: trunk/maven-repo-helper/debian/rules
===================================================================
--- trunk/maven-repo-helper/debian/rules        2011-09-06 22:04:38 UTC (rev 
14735)
+++ trunk/maven-repo-helper/debian/rules        2011-09-06 22:36:54 UTC (rev 
14736)
@@ -44,9 +44,11 @@
        mkdir -p debian/.mh/doc
        markdown --html4tags doc/tutorial.txt | \
                cat doc/tutorial-header.html - doc/tutorial-footer.html > 
debian/.mh/doc/tutorial.html
-       cp doc/reference.txt + doc/ref/mh_cleanpom.txt + 
doc/ref/mh_installpom.txt + doc/ref/mh_installpoms.txt + 
doc/ref/mh_patchpom.txt \
-               + doc/ref/mh_patchpoms.txt + doc/ref/mh_unpatchpoms.txt + 
doc/reference2.txt + doc/ref/mh_installjar.txt \
-               + doc/ref/mh_linkjar.txt + doc/reference3.txt > 
debian/.mh/doc/reference.txt
+       cat doc/reference.txt doc/ref/mh_cleanpom.txt doc/ref/mh_installpom.txt 
doc/ref/mh_installpoms.txt doc/ref/mh_patchpom.txt \
+               doc/ref/mh_patchpoms.txt doc/ref/mh_unpatchpoms.txt 
doc/reference2.txt doc/ref/mh_installjar.txt \
+               doc/ref/mh_linkjar.txt doc/ref/mh_linkjars.txt 
doc/reference3.txt doc/ref/mh_clean.txt doc/ref/mh_installsite.txt \
+               doc/ref/mh_install.txt doc/reference4.txt 
doc/ref/mh_checkrepo.txt doc/reference5.txt \
+                doc/ref/dh_with_maven_repo_helper.txt 
doc/ref/dh_with_jh_maven_repo_helper.txt > debian/.mh/doc/reference.txt
        markdown --html4tags debian/.mh/doc/reference.txt | \
                cat doc/reference-header.html - doc/reference-footer.html > 
debian/.mh/doc/reference.html
        markdown --html4tags doc/repository.txt | \

Added: trunk/maven-repo-helper/doc/ref/dh_with_jh_maven_repo_helper.txt
===================================================================
--- trunk/maven-repo-helper/doc/ref/dh_with_jh_maven_repo_helper.txt            
                (rev 0)
+++ trunk/maven-repo-helper/doc/ref/dh_with_jh_maven_repo_helper.txt    
2011-09-06 22:36:54 UTC (rev 14736)
@@ -0,0 +1,25 @@
+### --with jh\_maven\_repo\_helper:
+
+This DH 7 plugin uses the tools provided by the maven\_repo\_helper package to 
install the project jars and POM files into /usr/share/maven-repo.
+It uses the file(s) debian/$package.poms for its configuration, as well as the 
files debian/maven.rules, debian/maven.ignoreRules and 
debian/maven.publishedRules.
+
+It is designed to work alongside javahelper, and requires the use of the 
javahelper plugin for DH 7 at the same time.
+To use this plugin in the rules file, all you need to do is to add those lines 
to debian/rules:
+
+    %:
+        dh --with javahelper --with jh_maven_repo_helper $@
+
+As for the plugin --with maven\_repo\_helper, you need to list the POM files 
and the artifacts to install in debian/$package.poms, but this is done in 
coordination with the configuration of javahelper.
+For example, if the .jlibs configuration for javahelper installs the 
httpunit.jar located in the lib folder into /usr/share/java,
+
+libhttpunit-java.jlibs:
+
+       lib/httpunit.jar
+
+Then we need to tell javahelper to install this httpunit.jar file from 
/usr/share/java into the Maven repository /usr/share/maven-repo
+
+libhttpunit-java.poms:
+
+       debian/pom.xml --usj-name=httpunit
+
+

Added: trunk/maven-repo-helper/doc/ref/dh_with_maven_repo_helper.txt
===================================================================
--- trunk/maven-repo-helper/doc/ref/dh_with_maven_repo_helper.txt               
                (rev 0)
+++ trunk/maven-repo-helper/doc/ref/dh_with_maven_repo_helper.txt       
2011-09-06 22:36:54 UTC (rev 14736)
@@ -0,0 +1,26 @@
+### --with maven\_repo\_helper:
+
+This DH 7 plugin uses the tools provided by the maven\_repo\_helper package to 
install the project jars and POM files into /usr/share/maven-repo.
+It uses the file(s) debian/$package.poms for its configuration, as well as the 
files debian/maven.rules, debian/maven.ignoreRules and 
debian/maven.publishedRules.
+
+There can be several .poms file, one for each binary package if the source 
package builds multiple binary packages, each containing its own set of 
artifacts.
+
+As --with maven\_repo\_helper plugin uses internally mh\_install, the 
requirements for the configuration of the .poms files are the same, namely:
+
+For each POM file associated with a jar, we need to supply at least the 
--artifact parameter. For example:
+
+maven-debian-helper.poms:
+
+    pom.xml --no-parent --has-package-version
+    maven-debian-helper/pom.xml --has-package-version 
--artifact=maven-debian-helper/target/maven-debian-helper-*.jar --java-lib
+    maven-debian-plugin/pom.xml --has-package-version 
--artifact=maven-debian-plugin/target/maven-debian-plugin-*.jar --java-lib
+    maven-build-nodocs/pom.xml --has-package-version 
--artifact=maven-build-nodocs/target/maven-build-nodocs-*.jar --java-lib
+    maven-packager-utils/pom.xml --has-package-version 
--artifact=maven-packager-utils/target/maven-packager-utils-*.jar --java-lib
+
+To use this plugin in the rules file, all you need to do is to add those lines 
to debian/rules:
+
+    %:
+        dh $@ --buildsystem=ant --with maven_repo_helper
+
+The option --buildsystem=ant is optional, and you can use any other build 
system or let DH 7 detect it, and you may add additional options to dh.
+

Added: trunk/maven-repo-helper/doc/ref/mh_checkrepo.txt
===================================================================
--- trunk/maven-repo-helper/doc/ref/mh_checkrepo.txt                            
(rev 0)
+++ trunk/maven-repo-helper/doc/ref/mh_checkrepo.txt    2011-09-06 22:36:54 UTC 
(rev 14736)
@@ -0,0 +1,19 @@
+### mh\_checkrepo:
+
+Checks the Maven repository for consistency and prints a report.
+
+Where:
+
+    <location> is the location of the Maven repository.
+    Default to /usr/share/maven-repo
+
+Options:
+
+    -h --help: show this text
+    -V --version: show the version
+    -v --verbose: show more information while running
+    -o<format>, --output=<format>: 'text' or 'html' to change output format
+    -r<repository>, --repository=<repository>: directory of Maven repository
+
+
+

Added: trunk/maven-repo-helper/doc/ref/mh_clean.txt
===================================================================
--- trunk/maven-repo-helper/doc/ref/mh_clean.txt                                
(rev 0)
+++ trunk/maven-repo-helper/doc/ref/mh_clean.txt        2011-09-06 22:36:54 UTC 
(rev 14736)
@@ -0,0 +1,15 @@
+### mh\_clean:
+
+Cleans the temporary files created by the other mh_* utilities.
+Add it to the clean: target in debian/rules
+
+Usage: 
+
+    mh_clean
+
+In debian/rules, use:
+
+    clean::
+        mh_clean
+
+

Modified: trunk/maven-repo-helper/doc/ref/mh_cleanpom.txt
===================================================================
--- trunk/maven-repo-helper/doc/ref/mh_cleanpom.txt     2011-09-06 22:04:38 UTC 
(rev 14735)
+++ trunk/maven-repo-helper/doc/ref/mh_cleanpom.txt     2011-09-06 22:36:54 UTC 
(rev 14736)
@@ -52,10 +52,12 @@
 If versions are given for a dependency, this version will be replaced by the 
'debian' version, or a rule can be given to use a custom version.
 
 You  can  modify those defaults with the help of the rules file. This file 
should contain the lines with the format:
+
     <groupId> [artifactId] [type]  [version]  [classifier] [scope]
+
 where  groupId,  artifactId,  type,  version, classifier and scope can be the 
explicit attribute to match, or can contain a wildcard (*) for generic matches.
 
-Each one of those elements can also be a replace rule, of the form 
s/<regex>/<replace>/ where regex is a regular expression, and replace is the 
replacement. Substitution groups $1 $2... can be used in the replacement if 
capture groups () have been used in the regex.
+Each one of those elements can also be a replace rule, of the form 
s/\<regex\>/\<replace\>/ where regex is a regular expression, and replace is 
the replacement. Substitution groups $1 $2... can be used in the replacement if 
capture groups () have been used in the regex.
 
 The first element is mandatory (groupId), but you can ignore the elements on 
the right hand side. If the scope is missing, then any scope is matched and 
left unchanged. If the version missing, then any version will be replaced with 
'debian'. If type is missing, then any type is matched and left unchanged. If 
artifactId is missing, then any artifactId is matched and left unchanged.
 
@@ -68,12 +70,13 @@
     plexus-container-default jar s/1\.0-alpha.*/1.0-alpha/
 
 This  rules file does the following:
+
  - all groupIds starting with commons- will have org.apache.commons. prefixed 
to them
  - any artifact in the org.itext group with a version number starting with 1. 
will use the 1.x version
  - any artifact in the org.itext group with a version number starting with 2. 
will use the 2.x version
  - the jar with groupId=org.codehaus.plexus and 
artifactId=plexus-container-default and a version starting with 1.0-alpha- will 
use the 1.0-alpha version
 
-The default rule (* * * s/.*/debian/ *) replaces any version number with the 
'debian' version and always applies last if there was no other matches. Another 
default rule (* * maven-plugin * *) keep the version for all plugins  as the 
plugin mechanism requires a version in Maven.
+The default rule (\* \* \* s/.\*/debian/ \*) replaces any version number with 
the 'debian' version and always applies last if there was no other matches. 
Another default rule (\* \* maven-plugin \* \*) keeps the version for all 
plugins  as the plugin mechanism requires a version in Maven.
 
 Any rules given on the command line (using -R/--extra-rule, 
-U/--extra-published-rule or -I/--extra-ignore-rule) are applied in the order 
given, in between the rules given in the rules file (if any) and the default 
rules.
 

Added: trunk/maven-repo-helper/doc/ref/mh_install.txt
===================================================================
--- trunk/maven-repo-helper/doc/ref/mh_install.txt                              
(rev 0)
+++ trunk/maven-repo-helper/doc/ref/mh_install.txt      2011-09-06 22:36:54 UTC 
(rev 14736)
@@ -0,0 +1,42 @@
+### mh\_install:
+
+Usage:
+
+    mh_install [option]...
+
+Reads the file debian/$package.poms and installs each POM file listed in the 
.poms file, as well as the associated jars - assuming that at least the 
--artifact option is given in the .poms file for all jars to install.
+
+Options:
+
+    -h --help: show this text
+    -V --version: show the version
+    -p<package> --package=<package>: name of the Debian package which will 
contain all the files to install
+    -e<version>, --set-version=<version>: set the version for all artifacts, 
do not use the version declared in the POM files.
+    -r<rules> --rules=<rules>: path to the file containing the rules to apply 
when cleaning the POM files.
+      Optional, the default location is debian/maven.rules
+    -u<rules> --published-rules=<rules>: path to the file containing the extra 
rules to publish in the property debian.mavenRules in the cleaned POM.
+      Optional, the default location is debian/maven.publishedRules
+    -i<rules> --ignore-rules=<rules>: path to the file containing the rules 
used to remove certain dependencies from the cleaned POM.
+      Optional, the default location is debian/maven.ignoreRules
+    --no-publish-used-rule: don't publish the rule used to transform a POM's 
own attributes in debian.mavenRules
+    -v --verbose: show more information while running
+    -n --no-act: don't actually do anything, just print the results
+
+The $package.poms file must contain enough information to locate the jar files 
to install, and to associate them with their POM file.
+For each POM file associated with a jar, we need to supply at least the 
--artifact parameter. For example:
+
+maven-debian-helper.poms:
+
+    pom.xml --no-parent --has-package-version
+    maven-debian-helper/pom.xml --has-package-version 
--artifact=maven-debian-helper/target/maven-debian-helper-*.jar --java-lib
+    maven-debian-plugin/pom.xml --has-package-version 
--artifact=maven-debian-plugin/target/maven-debian-plugin-*.jar --java-lib
+    maven-build-nodocs/pom.xml --has-package-version 
--artifact=maven-build-nodocs/target/maven-build-nodocs-*.jar --java-lib
+    maven-packager-utils/pom.xml --has-package-version 
--artifact=maven-packager-utils/target/maven-packager-utils-*.jar --java-lib
+
+Here we tell mh\_install to deploy the maven-debian-helper project and its sub 
projects into /usr/share/maven-repo,
+and to deploy all jars also into /usr/share/java (--java-lib option)
+
+Internally, mh\_installpom is used to install the POM file, mh\_installjar is 
used to install the jar if --artifact is supplied.
+If a project or sub-project contains the file src/site/site.xml, then it will 
be installed with mh\_installsite. 
+
+

Modified: trunk/maven-repo-helper/doc/ref/mh_installjar.txt
===================================================================
--- trunk/maven-repo-helper/doc/ref/mh_installjar.txt   2011-09-06 22:04:38 UTC 
(rev 14735)
+++ trunk/maven-repo-helper/doc/ref/mh_installjar.txt   2011-09-06 22:36:54 UTC 
(rev 14736)
@@ -1,7 +1,7 @@
 ### mh\_installjar:
 
 Usage:
- 
+
     mh_installjar [option]... [pom] [jar] [link]...
 
 Installs the jar file in /usr/share/maven-repo, at the correct location for
@@ -33,7 +33,7 @@
       The jar will be installed as /usr/share/java/\$name-\$version.jar and a 
versionless link /usr/share/java/\$name.jar will point to it, as well as the 
links installed in /usr/share/maven-repo
     -n<name> --usj-name=<name>: Optional, the name to use when installing the 
library in /usr/share/java when --java-lib is used.
       Defaults to the artifact id found in the POM.
-    -i<version> --usj-version=<version>: Optional, the version to use when 
installing the library in /usr/share/java when --java-lib is used.
+    -j<version> --usj-version=<version>: Optional, the version to use when 
installing the library in /usr/share/java when --java-lib is used.
       Defaults to the version found in the POM.
     -s --no-usj-versionless: Optional, don't install the versionless link in 
/usr/share/java.
       This flag is used only when the -l or --java-lib option is given.

Added: trunk/maven-repo-helper/doc/ref/mh_installsite.txt
===================================================================
--- trunk/maven-repo-helper/doc/ref/mh_installsite.txt                          
(rev 0)
+++ trunk/maven-repo-helper/doc/ref/mh_installsite.txt  2011-09-06 22:36:54 UTC 
(rev 14736)
@@ -0,0 +1,29 @@
+### mh\_installsite:
+
+Usage:
+
+    mh_installsite [option]... [pom] [site-file]
+
+Installs the site.xml file in /usr/share/maven-repo, at the correct location 
for Maven.
+
+Where:
+
+    [pom] is the location of the POM associated with the site.xml file to 
install.
+      GroupId, artifactId and version will be extracted from this file.
+    [site-file] is the location of the site.xml to install.
+
+Options:
+
+    -h --help: show this text
+    -V --version: show the version
+    -p<package> --package=<package>: name of the Debian package which will 
contain the site file
+    -e<version>, --set-version=<version>: set the version for the POM, do not 
use the version declared in the POM file.
+    -r<rules> --rules=<rules>: path to the file containing the rules to apply 
when cleaning the POM.
+      Optional, the default location is debian/maven.rules
+      Maven rules are used here to extract the groupId, artifactId and version 
from the POM file.
+    -v --verbose: show more information while running
+    -n --no-act: don't actually do anything, just print the results
+    --skip-clean-pom: don't clean the pom, assume that a previous action ran 
mh_cleanpom with the correct options.
+      mh_cleanpom is run only to extract the groupId, artifactId and version 
of the jar
+
+

Added: trunk/maven-repo-helper/doc/ref/mh_linkjars.txt
===================================================================
--- trunk/maven-repo-helper/doc/ref/mh_linkjars.txt                             
(rev 0)
+++ trunk/maven-repo-helper/doc/ref/mh_linkjars.txt     2011-09-06 22:36:54 UTC 
(rev 14736)
@@ -0,0 +1,33 @@
+### mh\_linkjars:
+
+Usage:
+
+    mh_linkjars [option]...
+
+Reads the file debian/$package.poms and create links for each jar file 
generated by a POM listed in the .poms file.
+
+Options:
+
+    -h --help: show this text
+    -V --version: show the version
+    -p<package> --package=<package>: name of the Debian package which will 
contain the jar files
+    -e<version>, --set-version=<version>: set the version for the jars, do not 
use the version declared in the POM file.
+    -r<rules> --rules=<rules>: path to the file containing the rules to apply 
when cleaning the POM.
+      Optional, the default location is debian/maven.rules
+    -v --verbose: show more information while running
+    -n --no-act: don't actually do anything, just print the results
+
+The <package>.poms file should contain the list of POM files associated with 
the list of jars to install in the repository, and each pom file should have 
either
+the option --usj-name, giving the name of the jar (without the extension) to 
link to and located in /usr/share/java, or the option --artifact, which should
+contain the full name of the source jar to link to.
+
+For example:
+
+    debian/pom.xml --usj-name=httpunit
+
+or
+
+    debian/pom.xml --artifact=/usr/share/java/httpunit.jar
+
+mh\_linkjars is used also by jh\_maven\_repo\_helper, the DH 7 plugin with 
complements javahelper by installing the jars and the POM metadata into the 
Debian Maven repository.
+

Modified: trunk/maven-repo-helper/doc/ref/mh_patchpom.txt
===================================================================
--- trunk/maven-repo-helper/doc/ref/mh_patchpom.txt     2011-09-06 22:04:38 UTC 
(rev 14735)
+++ trunk/maven-repo-helper/doc/ref/mh_patchpom.txt     2011-09-06 22:36:54 UTC 
(rev 14736)
@@ -1,15 +1,18 @@
 ### mh\_patchpom:
 
 Usage:
+
     mh_patchpom [option]... [pom] [backup]
 
 Patches one POM file using the Maven dependency rules.
 
 Where:
+
     [pom] is the location of the POM file to transform. Default to pom.xml
     [backup] is the backup file for the pom. Default to pom.xml.save
 
 Options:
+
     -h --help: show this text
     -V --version: show the version
     -p<package> --package=<package>: name of the Debian package containing 
this library

Modified: trunk/maven-repo-helper/doc/ref/mh_patchpoms.txt
===================================================================
--- trunk/maven-repo-helper/doc/ref/mh_patchpoms.txt    2011-09-06 22:04:38 UTC 
(rev 14735)
+++ trunk/maven-repo-helper/doc/ref/mh_patchpoms.txt    2011-09-06 22:36:54 UTC 
(rev 14736)
@@ -1,4 +1,4 @@
-### mh_patchpoms:
+### mh\_patchpoms:
 
 Usage: 
 

Modified: trunk/maven-repo-helper/doc/ref/mh_unpatchpoms.txt
===================================================================
--- trunk/maven-repo-helper/doc/ref/mh_unpatchpoms.txt  2011-09-06 22:04:38 UTC 
(rev 14735)
+++ trunk/maven-repo-helper/doc/ref/mh_unpatchpoms.txt  2011-09-06 22:36:54 UTC 
(rev 14736)
@@ -1,4 +1,4 @@
-### mh_unpatchpoms:
+### mh\_unpatchpoms:
 
 Usage: 
 

Modified: trunk/maven-repo-helper/doc/reference3.txt
===================================================================
--- trunk/maven-repo-helper/doc/reference3.txt  2011-09-06 22:04:38 UTC (rev 
14735)
+++ trunk/maven-repo-helper/doc/reference3.txt  2011-09-06 22:36:54 UTC (rev 
14736)
@@ -1,78 +1,8 @@
-### mh_linkjars:
+### mh\_linkrepojar:
 
 TODO
 
-### mh_linkrepojar:
-
-TODO
-
 Working with the build:
 -----------------------
 
-### mh_clean:
 
-Cleans the temporary files created by the other mh_* utilities.
-Add it to the clean: target in debian/rules
-
-### mh_installsite:
-
-TODO
-
-### mh_install:
-
-TODO
-
-Working with the repository:
-----------------------------
-
-### mh_checkrepo:
-
-TODO
-
-Debhelper 7 plugins:
---------------------
-
-### --with maven_repo_helper:
-
-TODO
-
-### --with jh_maven_repo_helper:
-
-TODO
-
------------
-
-A more complex example from the modello package is:
-{{{
-pom.xml --no-parent
-modello-core/pom.xml
-modello-plugins/pom.xml
-modello-plugins/modello-plugin-converters/pom.xml
-modello-plugins/modello-plugin-dom4j/pom.xml
-modello-plugins/modello-plugin-java/pom.xml
-modello-plugins/modello-plugin-jdom/pom.xml
-modello-plugins/modello-plugin-stax/pom.xml
-modello-plugins/modello-plugin-xdoc/pom.xml
-modello-plugins/modello-plugin-xml/pom.xml
-modello-plugins/modello-plugin-xpp3/pom.xml
-modello-plugins/modello-plugin-xsd/pom.xml
-}}}
-
-debian/maven.rules:
-{{{
-junit junit jar s/3\..*/3.x/
-}}}
-This file is taken from the modello package. It specifies that the dependency 
on junit will use the version '3.x' instead of the default 'debian' version if 
the native version starts with '3.'. If the group id of the dependency is 
'junit, the artifact id of the dependency is 'junit', the type of the 
dependency is 'jar' and the version starts with '3.', then this rule is used. 
's/3\..*/3.x/' performs the replacement for the version, the syntax should be 
obvious to any sed user.
-
-This example from the commons-configuration package shows a few more 
possibilities: here, the version for commons-collections is converted to '2.x' 
if it starts with '2.' or '3.x' if it starts with '3.'.
-The line with ant is more interesting: if the group id is 'ant', then it is 
converted to 'org.apache.ant' - great trick for dealing with artifacts which 
are coming from Maven 1. Any artifact id or type will be matched and left 
unchanged, while the version will be converted to 'debian'.
-There is also the line with javax.servlet: this line keeps the version number 
used by this dependency, so if 2.4 is used, then 2.4 is also used in the 
cleaned POM.
-
-{{{
-junit junit jar s/3\..*/3.x/
-commons-collections commons-collections jar s/2\..*/2.x/
-commons-collections commons-collections jar s/3\..*/3.x/
-s/ant/org.apache.ant/ * * s/.*/debian/
-log4j log4j jar s/1\.2\..*/1.2.x/
-javax.servlet servlet-api jar *}}}
-

Added: trunk/maven-repo-helper/doc/reference4.txt
===================================================================
--- trunk/maven-repo-helper/doc/reference4.txt                          (rev 0)
+++ trunk/maven-repo-helper/doc/reference4.txt  2011-09-06 22:36:54 UTC (rev 
14736)
@@ -0,0 +1,4 @@
+Working with the repository:
+----------------------------
+
+

Added: trunk/maven-repo-helper/doc/reference5.txt
===================================================================
--- trunk/maven-repo-helper/doc/reference5.txt                          (rev 0)
+++ trunk/maven-repo-helper/doc/reference5.txt  2011-09-06 22:36:54 UTC (rev 
14736)
@@ -0,0 +1,4 @@
+Debhelper 7 plugins:
+--------------------
+
+

Modified: trunk/maven-repo-helper/pom.xml
===================================================================
--- trunk/maven-repo-helper/pom.xml     2011-09-06 22:04:38 UTC (rev 14735)
+++ trunk/maven-repo-helper/pom.xml     2011-09-06 22:36:54 UTC (rev 14736)
@@ -5,7 +5,7 @@
     <artifactId>maven-repo-helper</artifactId>
     <name>Maven Repo helper</name>
     <packaging>jar</packaging>
-    <version>1.5</version>
+    <version>1.6</version>
     <description>Provides support for managing the Maven repository in a 
Debian distribution.</description>
 
     <inceptionYear>2009</inceptionYear>

Modified: trunk/maven-repo-helper/src/main/bin/mh_install
===================================================================
--- trunk/maven-repo-helper/src/main/bin/mh_install     2011-09-06 22:04:38 UTC 
(rev 14735)
+++ trunk/maven-repo-helper/src/main/bin/mh_install     2011-09-06 22:36:54 UTC 
(rev 14736)
@@ -29,23 +29,30 @@
    echo -e "Options:"
    echo -e "\t-h --help: show this text"
    echo -e "\t-V --version: show the version"
-   echo -e "\t-p<package> --package=<package>: package to act on "
-   echo -e "\t--no-publish-used-rule: don't publish the rule used to transform"
-   echo -e "\t  a POM's own attributes in debian.mavenRules"
-   echo -e "\t-e<version>, --set-version=<version>: set the version for the 
POM,"
-   echo -e "\t  do not use the version declared in the POM file."
-   echo -e "\t-r<rules> --rules=<rules>: gives the location of the rules file 
for"
-   echo -e "\t  special properties. Optional, the default location is"
-   echo -e "\t  debian/maven.rules"
+   echo -e "\t-p<package> --package=<package>: name of the Debian package 
which"
+   echo -e "\t will contain all the files to install"
+   echo -e "\t-e<version>, --set-version=<version>: set the version for all 
artifacts,"
+   echo -e "\t  do not use the version declared in the POM files."
+   echo -e "\t-r<rules> --rules=<rules>: path to the file containing the"
+   echo -e "\t  rules to apply when cleaning the POM files."
+   echo -e "\t  Optional, the default location is debian/maven.rules"
    echo -e "\t-u<rules> --published-rules=<rules>: path to the file containing 
the"
-   echo -e "\t  extra rules to publish in the property debian.mavenRules in 
the cleaned POM"
+   echo -e "\t  extra rules to publish in the property debian.mavenRules in 
the"
+   echo -e "\t  cleaned POM."
    echo -e "\t  Optional, the default location is debian/maven.publishedRules"
    echo -e "\t-i<rules> --ignore-rules=<rules>: path to the file containing 
the"
-   echo -e "\t  extra rules use to remove certain dependencies from the 
cleaned POM"
+   echo -e "\t  rules used to remove certain dependencies from the cleaned POM"
    echo -e "\t  Optional, the default location is debian/maven.ignoreRules"
+   echo -e "\t--no-publish-used-rule: don't publish the rule used to transform"
+   echo -e "\t  a POM's own attributes in debian.mavenRules"
    echo -e "\t-v --verbose: show more information while running"
    echo -e "\t-n --no-act: don't actually do anything, just print the results"
    echo -e ""
+   echo -e "The \$package.poms file must contain enough information to locate"
+   echo -e "the jar files to install, and to associate them with their POM 
file."
+   echo -e "For each POM file associated with a jar, we need to supply at 
least"
+   echo -e "the --artifact parameter."
+   echo -e ""
    echo -e "See also: mh_installpoms(1), mh_installjar(1)"
    exit 1
 }

Modified: trunk/maven-repo-helper/src/main/bin/mh_installjar
===================================================================
--- trunk/maven-repo-helper/src/main/bin/mh_installjar  2011-09-06 22:04:38 UTC 
(rev 14735)
+++ trunk/maven-repo-helper/src/main/bin/mh_installjar  2011-09-06 22:36:54 UTC 
(rev 14736)
@@ -56,7 +56,7 @@
    echo -e "\t-n<name> --usj-name=<name>: Optional, the name to use when 
installing the"
    echo -e "\t  library in /usr/share/java when --java-lib is used."
    echo -e "\t  Defaults to the artifact id found in the POM."
-   echo -e "\t-i<version> --usj-version=<version>: Optional, the version to 
use when"
+   echo -e "\t-j<version> --usj-version=<version>: Optional, the version to 
use when"
    echo -e "\t  installing the library in /usr/share/java when --java-lib is 
used."
    echo -e "\t  Defaults to the version found in the POM."
    echo -e "\t-s --no-usj-versionless: Optional, don't install the versionless 
link"
@@ -74,11 +74,13 @@
    echo -e "\t--skip-clean-pom: don't clean the pom, assume that a previous 
action ran"
    echo -e "\t  mh_cleanpom with the correct options. mh_cleanpom is run only 
to extract"
    echo -e "\t  the groupId, artifactId and version of the jar"
+   echo -e ""
+   echo -e "See also: mh_installpom(1), mh_installsite(1)"
    exit 1
 }
 
 # The following elements are options which just need to be ignored: no-parent 
has-package-version keep-elements ignore-pom
-ARGS="p package e set-version r rules l java-lib n usj-name i usj-version s 
no-usj-versionless d dest-jar c classifier v verbose n no-act skip-clean-pom 
no-parent has-package-version keep-elements ignore-pom" parseargs "$@"
+ARGS="p package e set-version r rules l java-lib n usj-name i j usj-version s 
no-usj-versionless d dest-jar c classifier v verbose n no-act skip-clean-pom 
no-parent has-package-version keep-elements ignore-pom" parseargs "$@"
 
 if [ "$ARGC" -lt "2" ]; then
    syntax
@@ -90,6 +92,7 @@
 PACKAGE=${PACKAGE:?"Package parameter (-p) is mandatory"}
 JAVALIB=$(getarg l java-lib)
 USJ_JAR_NAME=$(getarg n usj-name)
+USJ_JAR_VERSION=$(getarg i j usj-version)
 NO_USJ_VERSIONLESS=$(getarg s no-usj-versionless)
 TARGET_JAR_PATH=$(getarg d dest-jar)
 CLASSIFIER=$(getarg c classifier)
@@ -99,6 +102,10 @@
 POM="${ARGV[0]}"
 JAR="${ARGV[1]}"
 
+if [ -n "$(getarg i)" ]; then
+  echo "WARNING: mh_installjar -i option is deprecated, prefer -j or 
--usj-version instead"
+fi
+
 DH_OPTS="${VERBOSE:+-v} ${NOACT:+-n}"
 CLEAN_ARGS="--package=${PACKAGE} ${SETVERSION:+--set-version=$SETVERSION} 
${RULES:+--rules=$RULES}"
 
@@ -144,7 +151,6 @@
 if [ -n "$JAVALIB" ]; then
     USJ_JAR_NAME=$(getarg n usj-name)
     USJ_JAR_NAME=${USJ_JAR_NAME:-$artifactId}
-    USJ_JAR_VERSION=$(getarg i usj-version)
     USJ_JAR_VERSION=${USJ_JAR_VERSION:-$version}
        USJ_VERSIONED_JAR_NAME=${USJ_JAR_NAME}-${USJ_JAR_VERSION}.jar
     USJ_JAR_NAME=${USJ_JAR_NAME}.jar

Modified: trunk/maven-repo-helper/src/main/bin/mh_installsite
===================================================================
--- trunk/maven-repo-helper/src/main/bin/mh_installsite 2011-09-06 22:04:38 UTC 
(rev 14735)
+++ trunk/maven-repo-helper/src/main/bin/mh_installsite 2011-09-06 22:36:54 UTC 
(rev 14736)
@@ -31,32 +31,34 @@
    echo -e "Options:"
    echo -e "\t-h --help: show this text"
    echo -e "\t-V --version: show the version"
-   echo -e "\t-p<package> --package=<package>: package to act on "
-   echo -e "\t-e<version>, --set-version=<version>: set the version for the 
POM,"
+   echo -e "\t-p<package> --package=<package>: name of the Debian package 
which"
+   echo -e "\t  will contain the site file"
+   echo -e "\t-e<version>, --set-version=<version>: set the version for the 
artifact,"
    echo -e "\t  do not use the version declared in the POM file."
-   echo -e "\t-r<rules> --rules=<rules>: gives the location of the rules file 
for"
-   echo -e "\t  special properties. Optional, the default location is"
-   echo -e "\t  debian/maven.rules"
+   echo -e "\t-r<rules> --rules=<rules>: path to the file containing the"
+   echo -e "\t  rules to apply when cleaning the POM."
+   echo -e "\t  Optional, the default location is debian/maven.rules"
+   echo -e "\t  Maven rules are used here to extract the groupId, artifactId"
+   echo -e "\t  and version from the POM file."
    echo -e "\t-v --verbose: show more information while running"
    echo -e "\t-n --no-act: don't actually do anything, just print the results"
    echo -e "\t--skip-clean-pom: don't clean the pom, assume that a previous 
action ran"
-   echo -e "\t  mh_cleanpom with the correct options."
+   echo -e "\t  mh_cleanpom with the correct options. mh_cleanpom is run only 
to extract"
+   echo -e "\t  the groupId, artifactId and version of the jar"
    echo -e ""
    echo -e "See also: mh_installpom(1), mh_installjar(1)"
    exit 1
 }
 
 # The following elements are options which just need to be ignored: no-parent 
has-package-version keep-elements ignore-pom classifier
-ARGS="p package r rules l java-lib n usj-name i usj-version s 
no-usj-versionless d dest-jar c classifier v verbose n no-act skip-clean-pom 
no-parent has-package-version keep-elements ignore-pom classifier" parseargs 
"$@"
+ARGS="p package e set-version r rules l java-lib n usj-name i usj-version s 
no-usj-versionless d dest-jar c classifier v verbose n no-act skip-clean-pom 
no-parent has-package-version keep-elements ignore-pom classifier" parseargs 
"$@"
 
 if [ "$ARGC" -lt "2" ]; then
    syntax
 fi
 
-NOPARENT=$(getarg o no-parent)
+SETVERSION=$(getarg e set-version)
 RULES=$(getarg r rules)
-IGNORE_RULES=$(getarg i ignore-rules)
-SETVERSION=$(getarg e set-version)
 PACKAGE=$(getarg p package)
 PACKAGE=${PACKAGE:?"Package parameter (-p) is mandatory"}
 VERBOSE=$(getarg v verbose)

Modified: trunk/maven-repo-helper/src/main/bin/mh_linkjar
===================================================================
--- trunk/maven-repo-helper/src/main/bin/mh_linkjar     2011-09-06 22:04:38 UTC 
(rev 14735)
+++ trunk/maven-repo-helper/src/main/bin/mh_linkjar     2011-09-06 22:36:54 UTC 
(rev 14736)
@@ -57,7 +57,7 @@
    echo -e "\t-n<name> --usj-name=<name>: Optional, the name to use when 
installing the"
    echo -e "\t  library in /usr/share/java when --java-lib is used."
    echo -e "\t  Defaults to the artifact id found in the POM."
-   echo -e "\t-i<version> --usj-version=<version>: Optional, the version to 
use when"
+   echo -e "\t-j<version> --usj-version=<version>: Optional, the version to 
use when"
    echo -e "\t  installing the library in /usr/share/java when --java-lib is 
used."
    echo -e "\t  Defaults to the version found in the POM."
    echo -e "\t-s --no-usj-versionless: Optional, don't install the versionless 
link"
@@ -73,7 +73,7 @@
    exit 1
 }
 
-ARGS="p package e set-version r rules l java-lib n usj-name i usj-version s 
no-usj-versionless c classifier v verbose n no-act skip-clean-pom no-parent 
has-package-version keep-elements ignore-pom" parseargs "$@"
+ARGS="p package e set-version r rules l java-lib n usj-name j usj-version s 
no-usj-versionless c classifier v verbose n no-act skip-clean-pom no-parent 
has-package-version keep-elements ignore-pom" parseargs "$@"
 
 if [ "$ARGC" -lt "2" ]; then
    syntax
@@ -85,6 +85,7 @@
 PACKAGE=${PACKAGE:?"Package parameter (-p) is mandatory"}
 JAVALIB=$(getarg l java-lib)
 USJ_JAR_NAME=$(getarg n usj-name)
+USJ_JAR_VERSION=$(getarg j usj-version)
 NO_USJ_VERSIONLESS=$(getarg s no-usj-versionless)
 CLASSIFIER=$(getarg c classifier)
 VERBOSE=$(getarg v verbose)
@@ -130,7 +131,6 @@
 if [ -n "$JAVALIB" ]; then
     USJ_JAR_NAME=$(getarg n usj-name)
     USJ_JAR_NAME=${USJ_JAR_NAME:-$artifactId}
-    USJ_JAR_VERSION=$(getarg i usj-version)
     USJ_JAR_VERSION=${USJ_JAR_VERSION:-$version}
        USJ_VERSIONED_JAR_NAME=${USJ_JAR_NAME}-${USJ_JAR_VERSION}.jar
     USJ_JAR_NAME=${USJ_JAR_NAME}.jar

Modified: trunk/maven-repo-helper/src/main/bin/mh_linkjars
===================================================================
--- trunk/maven-repo-helper/src/main/bin/mh_linkjars    2011-09-06 22:04:38 UTC 
(rev 14735)
+++ trunk/maven-repo-helper/src/main/bin/mh_linkjars    2011-09-06 22:36:54 UTC 
(rev 14736)
@@ -27,20 +27,13 @@
    echo -e "Options:"
    echo -e "\t-h --help: show this text"
    echo -e "\t-V --version: show the version"
-   echo -e "\t-p<package> --package=<package>: package to act on "
-   echo -e "\t--no-publish-used-rule: don't publish the rule used to transform"
-   echo -e "\t  a POM's own attributes in debian.mavenRules"
-   echo -e "\t-e<version>, --set-version=<version>: set the version for the 
POM,"
+   echo -e "\t-p<package> --package=<package>: name of the Debian package 
which"
+   echo -e "\t  will contain the jar files"
+   echo -e "\t-e<version>, --set-version=<version>: set the version for the 
jars,"
    echo -e "\t  do not use the version declared in the POM file."
-   echo -e "\t-r<rules> --rules=<rules>: gives the location of the rules file 
for"
-   echo -e "\t  special properties. Optional, the default location is"
-   echo -e "\t  debian/maven.rules"
-   echo -e "\t-u<rules> --published-rules=<rules>: path to the file containing 
the"
-   echo -e "\t  extra rules to publish in the property debian.mavenRules in 
the cleaned POM"
-   echo -e "\t  Optional, the default location is debian/maven.publishedRules"
-   echo -e "\t-i<rules> --ignore-rules=<rules>: path to the file containing 
the"
-   echo -e "\t  extra rules use to remove certain dependencies from the 
cleaned POM"
-   echo -e "\t  Optional, the default location is debian/maven.ignoreRules"
+   echo -e "\t-r<rules> --rules=<rules>: path to the file containing the"
+   echo -e "\t  rules to apply when cleaning the POM."
+   echo -e "\t  Optional, the default location is debian/maven.rules"
    echo -e "\t-v --verbose: show more information while running"
    echo -e "\t-n --no-act: don't actually do anything, just print the results"
    echo -e ""
@@ -50,18 +43,15 @@
    echo -e "to link to and located in /usr/share/java, or the option 
--artifact, which should"
    echo -e "contain the full name of the source jar to link to."
    echo -e ""
-   echo -e "See also: mh_linkjar(1)"
+   echo -e "See also: mh_linkjar(1), mh_install(1)"
    exit 1
 }
 
-ARGS="p package no-publish-used-rule r rules u published-rules i ignore-rules 
e set-version v verbose n no-act skip-clean-poms" parseargs "$@"
+ARGS="p package e set-version r rules v verbose n no-act skip-clean-poms" 
parseargs "$@"
 
-RULES=$(getarg r rules)
-PUBLISHED_RULES=$(getarg u published-rules)
-IGNORE_RULES=$(getarg i ignore-rules)
 SETVERSION=$(getarg e set-version)
+RULES=$(getarg r rules)
 PACKAGE=$(getarg p package)
-NO_PUBLISH_USED_RULE=$(getarg no-publish-used-rule)
 VERBOSE=$(getarg v verbose)
 NOACT=$(getarg n no-act)
 SKIP_CLEAN_POMS=$(getarg skip-clean-poms)
@@ -71,7 +61,7 @@
   p=$1
 
   DH_OPTS="${VERBOSE:+-v} ${NOACT:+-n}"
-  MH_ARGS="--package=${p} ${VERBOSE:+--verbose} 
${NO_PUBLISH_USED_RULE:+--no-publish-used-rule} 
${SETVERSION:+--set-version=$SETVERSION} ${RULES:+--rules=$RULES} 
${PUBLISHED_RULES:+--published-rules=$PUBLISHED_RULES} 
${IGNORE_RULES:+--ignore-rules=$IGNORE_RULES} 
${SKIP_CLEAN_POMS:+--skip-clean-pom}"
+  MH_ARGS="--package=${p} ${VERBOSE:+--verbose} 
${SETVERSION:+--set-version=$SETVERSION} ${RULES:+--rules=$RULES} 
${SKIP_CLEAN_POMS:+--skip-clean-pom}"
 
   if [ -z "$NOACT" ]; then
     cat debian/$p.poms | while read POM OPT1 OPT2 OPT3 OPT4 OPT5 OPT6 OPT7 
OPT8 OPT9 OPT10; do

Added: trunk/maven-repo-helper/src/main/share/jh_maven_repo_helper.pm
===================================================================
--- trunk/maven-repo-helper/src/main/share/jh_maven_repo_helper.pm              
                (rev 0)
+++ trunk/maven-repo-helper/src/main/share/jh_maven_repo_helper.pm      
2011-09-06 22:36:54 UTC (rev 14736)
@@ -0,0 +1,13 @@
+#!/usr/bin/perl                                                                
                                                
+use warnings;
+use strict;
+use Debian::Debhelper::Dh_Lib;
+
+# To use with javahelper
+# dh $@ --with javahelper --with jh_mavenrepohelper
+
+insert_after("jh_depends", "mh_installpoms");
+insert_after("mh_installpoms", "mh_linkjars --skip-clean-poms");
+insert_before("dh_clean", "mh_clean");
+
+1;

Modified: trunk/maven-repo-helper/src/main/share/mh_lib.sh
===================================================================
--- trunk/maven-repo-helper/src/main/share/mh_lib.sh    2011-09-06 22:04:38 UTC 
(rev 14735)
+++ trunk/maven-repo-helper/src/main/share/mh_lib.sh    2011-09-06 22:36:54 UTC 
(rev 14736)
@@ -4,7 +4,7 @@
 # - package selection
 #
 
-MH_VERSION=${MH_VERSION:-1.5}
+MH_VERSION=${MH_VERSION:-1.6}
 
CLASSPATH=/usr/share/java/stax-api.jar:/usr/share/java/stax.jar:/usr/share/java/xml-apis.jar:/usr/share/java/maven-repo-helper.jar
 
JAVA_OPTIONS="-Djavax.xml.stream.XMLOutputFactory=com.bea.xml.stream.XMLOutputFactoryBase
 -Djavax.xml.stream.XMLInputFactory=com.bea.xml.stream.MXParserFactory"
 


_______________________________________________
pkg-java-commits mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-java-commits

Reply via email to