Bug#640730: maven-repo-helper: mh_installjar --set-version flag doesn't work as expected

Miguel Landaeta miguel at miguel.cc
Tue Sep 6 22:24:07 UTC 2011

Package: maven-repo-helper
Version: 1.5.2
Severity: normal

I was working in a new package and I needed to override the version
of a jar to be installed in the maven repo. I consulted the man page,
I found --set-version flag to do this but it doesn't work as documented:

mh_installjar -plibguice-java --set-version=3.0 -l -v \
                core/pom.xml build/dist/guice-3.0.jar
Invalid option: set_version
Usage: mh_installjar [option]... [pom] [jar] [link]...
Installs the jar file in /usr/share/maven-repo, at the correct location for
Maven. The jar is copied into the build directory.
It can also create additional links to the jar, usually located in

        [pom] is the location of the POM associated with the jar to install.
          GroupId, artifactId and version will be extracted from this file.
        [jar] is the path to the jar to install, usually located in the build
        [link] is an additional link to the jar to install, usually there should
          be a link to usr/share/java/$jar.jar and
          usr/share/java/$jar-$version.jar to comply with the Java packaging
          guidelines. Note that there is no need to specify those particular
          links if the --java-lib option is used.
        -h --help: show this text
        -V --version: show the version
        -p<package> --package=<package>: package to act on
        -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>: gives the location of the rules file for
          special properties. Optional, the default location is
        -l --java-lib: Optional, if given it will install the jar into
          /usr/share/java to comply with the Debian Java specification.
          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.
          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.
        -d<path> --dest-jar=<path>: Optional, the destination for the real jar.
          The other places where the jar appears, in the repository or in the
          list of links, will be symlinks to this jar.
          Defaults to /usr/share/java/$name-$version.jar if --java-lib is used,
          otherwise it goes to the versioned path in the Maven repository.
        -c<classifier> --classifier=<classifier>: Optional, the classifier for
          the jar. Empty by default.
        -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.

I inspected the source of mh_installjar and --set-version doesn't appear
in the list of valid args:

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" parseargs "$@"

However, --set-version appears in the version of mh_installjar committed to
trunk in svn.

-- System Information:
Debian Release: wheezy/sid
  APT prefers unstable
  APT policy: (800, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.0.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages maven-repo-helper depends on:
ii  default-jre-headless [java2-runtime-headless]    1:1.6-43   
ii  gcj-4.4-jre-headless [java2-runtime-headless]    4.4.6-10   
ii  gcj-4.6-jre-headless [java2-runtime-headless]    4.6.1-4    
ii  gcj-jre-headless [java2-runtime-headless]        4:4.6.1-2  
ii  libstax-java                                     1.2.0-2    
ii  openjdk-6-jre-headless [java2-runtime-headless]  6b23~pre9-1

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

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

-- no debconf information

Miguel Landaeta, miguel at miguel.cc
secure email with PGP 0x7D8967E9 available at http://keyserver.pgp.com/
"Faith means not wanting to know what is true." -- Nietzsche
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-java-maintainers/attachments/20110906/cccac22a/attachment.pgp>

More information about the pkg-java-maintainers mailing list