[pkg-java] r13128 - in trunk/maven-repo-helper: . debian src/main/bin src/main/java/org/debian/maven/repo src/main/share src/test/java/org/debian/maven/repo src/test/resources
Ludovic Claude
ludovicc-guest at alioth.debian.org
Thu Dec 2 22:18:16 UTC 2010
Author: ludovicc-guest
Date: 2010-12-02 22:18:15 +0000 (Thu, 02 Dec 2010)
New Revision: 13128
Added:
trunk/maven-repo-helper/src/main/bin/mh_installsite
trunk/maven-repo-helper/src/main/share/maven_repo_helper.pm
trunk/maven-repo-helper/src/test/resources/maven-packager-utils.pom
trunk/maven-repo-helper/src/test/resources/maven-packager-utils.transformed
trunk/maven-repo-helper/src/test/resources/mojo-parent.cleaned
trunk/maven-repo-helper/src/test/resources/mojo-parent.pom
Modified:
trunk/maven-repo-helper/debian/README.Debian
trunk/maven-repo-helper/debian/changelog
trunk/maven-repo-helper/debian/rules
trunk/maven-repo-helper/pom.xml
trunk/maven-repo-helper/src/main/bin/mh_checkrepo
trunk/maven-repo-helper/src/main/bin/mh_clean
trunk/maven-repo-helper/src/main/bin/mh_cleanpom
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_installpom
trunk/maven-repo-helper/src/main/bin/mh_installpoms
trunk/maven-repo-helper/src/main/bin/mh_linkjar
trunk/maven-repo-helper/src/main/bin/mh_linkrepojar
trunk/maven-repo-helper/src/main/bin/mh_patchpom
trunk/maven-repo-helper/src/main/bin/mh_unpatchpoms
trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/Dependency.java
trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/DependencyNotFoundException.java
trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/DependencyRule.java
trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/DependencyRuleSet.java
trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/ListOfPOMs.java
trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/POMCleaner.java
trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/POMHandler.java
trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/POMInfo.java
trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/POMReader.java
trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/POMTransformer.java
trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/Repository.java
trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/Rule.java
trunk/maven-repo-helper/src/main/share/mh_lib.sh
trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/DependencyRuleTest.java
trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/ListOfPOMsTest.java
trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/POMCleanerTest.java
trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/POMReaderTest.java
trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/POMTransformerTest.java
trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/RepositoryTest.java
trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/RuleTest.java
trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/TestBase.java
Log:
* New release
Modified: trunk/maven-repo-helper/debian/README.Debian
===================================================================
--- trunk/maven-repo-helper/debian/README.Debian 2010-12-01 04:55:49 UTC (rev 13127)
+++ trunk/maven-repo-helper/debian/README.Debian 2010-12-02 22:18:15 UTC (rev 13128)
@@ -47,6 +47,9 @@
* Template debian/rules for installing a single artifact into the Maven repository:
=======================
+
+#!/usr/bin/make -f
+
include /usr/share/cdbs/1/rules/debhelper.mk
PACKAGE := $(DEB_SOURCE_PACKAGE)
@@ -70,9 +73,25 @@
pom.xml
=======================
+* Template debian/rules for installing a single artifact into the Maven repository using dh 7:
+=======================
+#!/usr/bin/make -f
+
+%:
+ dh $@ --with maven_repo_helper
+=======================
+
+You will need also at least a file called debian/<package>.poms (where <package> is the name of the binary package) and containing:
+=======================
+pom.xml --java-lib --artifact=build/module-*.jar
+=======================
+
* Template debian/rules for installing multiple artifacts into the Maven repository:
=======================
+
+#!/usr/bin/make -f
+
include /usr/share/cdbs/1/rules/debhelper.mk
PACKAGE := $(DEB_SOURCE_PACKAGE)
@@ -100,6 +119,22 @@
module2/pom.xml
=======================
+* Template debian/rules for installing multiple artifacts into the Maven repository using dh 7:
+
+#!/usr/bin/make -f
+
+%:
+ dh $@ --with maven_repo_helper
+=======================
+
+You will need also at least a file called debian/<package>.poms (where <package> is the name of the binary package) and containing:
+=======================
+# Remove the <parent> tag from the multiproject POM
+pom.xml --no-parent
+module1/pom.xml --java-lib --artifact=module1/target/module1-*.jar
+module2/pom.xml --java-lib --artifact=module2/target/module2-*.jar
+=======================
+
* debian/<package>.poms (where <package> is the name of the binary package):
This file lists the POM files in the source tree which need to be installed in the repository, and you provide options for each POMs:
@@ -128,6 +163,9 @@
--usj-version=<version>: version to use when installing the library in /usr/share/java
--no-usj-versionless: don't install the versionless link in /usr/share/java
--dest-jar=<path>: the destination for the real jar
+--classifier=<classifier>: the classifier for the jar, empty by default.
+--ignore-pom: don't install the POM with mh_install or mh_installpoms. To use with POM files that are created temporarily
+ for certain artifacts such as Javadoc jars.
Other configuration files are used by mh_installjar and mh_installpoms. All those files are optional.
Modified: trunk/maven-repo-helper/debian/changelog
===================================================================
--- trunk/maven-repo-helper/debian/changelog 2010-12-01 04:55:49 UTC (rev 13127)
+++ trunk/maven-repo-helper/debian/changelog 2010-12-02 22:18:15 UTC (rev 13128)
@@ -1,3 +1,18 @@
+maven-repo-helper (1.5) unstable; urgency=low
+
+ * Create mh_installsite to install site.xml into the Maven repository,
+ and integrate it with mh_install
+ * Avoid duplication between rules in maven.rules and maven.publishedRules,
+ as well as between maven.ignoreRules and maven.cleanIgnoreRules
+ * Fix ignore modules, make it work in more cases.
+ * mh_clean: clean also files listed in .mh_clean, similar to what jh_clean
+ does.
+ * add support for dh 7 and ant builds: use the following line in your
+ rules file:
+ dh $@ --with ant --with mavenrepohelper
+
+ -- Ludovic Claude <ludovic.claude at laposte.net> Thu, 11 Nov 2010 18:49:49 +0100
+
maven-repo-helper (1.4) experimental; urgency=low
* Better support for inserting properties in the transformed or cleaned
Modified: trunk/maven-repo-helper/debian/rules
===================================================================
--- trunk/maven-repo-helper/debian/rules 2010-12-01 04:55:49 UTC (rev 13127)
+++ trunk/maven-repo-helper/debian/rules 2010-12-02 22:18:15 UTC (rev 13128)
@@ -24,6 +24,7 @@
mh_installjar_description = "Installs a jar into /usr/share/maven-repo."
mh_installpom_description = "Installs a POM file into /usr/share/maven-repo."
mh_installpoms_description = "Installs all POMs for the package into /usr/share/maven-repo."
+mh_installsite_description = "Installs site.xml into /usr/share/maven-repo."
mh_linkjar_description = "Installs a link to the jar into /usr/share/maven-repo."
mh_linkrepojar_description = "Installs a link from the jar in /usr/share/maven-repo."
mh_lspoms_description = "Generates a list of POMs for the package."
@@ -49,6 +50,7 @@
dh_install -p$(PACKAGE) build/$(PACKAGE)-debian.jar /usr/share/maven-repo/org/debian/maven/$(PACKAGE)/debian
dh_install -p$(PACKAGE) src/main/bin/mh_* /usr/bin
dh_install -p$(PACKAGE) src/main/share/mh_* /usr/share/$(PACKAGE)
+ dh_install -p$(PACKAGE) src/main/share/maven_repo_helper.pm /usr/share/perl5/Debian/Debhelper/Sequence
dh_link -p$(PACKAGE) /usr/share/maven-repo/org/debian/maven/$(PACKAGE)/debian/$(PACKAGE)-debian.jar /usr/share/java/$(PACKAGE).jar
dh_installman $(MAN_PAGES)
mkdir -p debian/.mh
Modified: trunk/maven-repo-helper/pom.xml
===================================================================
--- trunk/maven-repo-helper/pom.xml 2010-12-01 04:55:49 UTC (rev 13127)
+++ trunk/maven-repo-helper/pom.xml 2010-12-02 22:18:15 UTC (rev 13128)
@@ -5,7 +5,7 @@
<artifactId>maven-repo-helper</artifactId>
<name>Maven Repo helper</name>
<packaging>jar</packaging>
- <version>1.4</version>
+ <version>1.5</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_checkrepo
===================================================================
--- trunk/maven-repo-helper/src/main/bin/mh_checkrepo 2010-12-01 04:55:49 UTC (rev 13127)
+++ trunk/maven-repo-helper/src/main/bin/mh_checkrepo 2010-12-02 22:18:15 UTC (rev 13128)
@@ -1,5 +1,19 @@
#!/bin/bash --
+# Copyright 2009 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.
+
set -e
. /usr/share/maven-repo-helper/mh_lib.sh
Modified: trunk/maven-repo-helper/src/main/bin/mh_clean
===================================================================
--- trunk/maven-repo-helper/src/main/bin/mh_clean 2010-12-01 04:55:49 UTC (rev 13127)
+++ trunk/maven-repo-helper/src/main/bin/mh_clean 2010-12-02 22:18:15 UTC (rev 13128)
@@ -1,5 +1,19 @@
#!/bin/bash --
+# Copyright 2009 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.
+
set -e
. /usr/share/maven-repo-helper/mh_lib.sh
@@ -14,5 +28,8 @@
parseargs "$@"
+if [ -f "debian/.mh_clean" ]; then
+ rm -f `cat debian/.mh_clean` debian/.mh_clean
+fi
rm -rf debian/.mh
Modified: trunk/maven-repo-helper/src/main/bin/mh_cleanpom
===================================================================
--- trunk/maven-repo-helper/src/main/bin/mh_cleanpom 2010-12-01 04:55:49 UTC (rev 13127)
+++ trunk/maven-repo-helper/src/main/bin/mh_cleanpom 2010-12-02 22:18:15 UTC (rev 13128)
@@ -1,5 +1,19 @@
#!/bin/bash --
+# Copyright 2009 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.
+
set -e
. /usr/share/maven-repo-helper/mh_lib.sh
Modified: trunk/maven-repo-helper/src/main/bin/mh_install
===================================================================
--- trunk/maven-repo-helper/src/main/bin/mh_install 2010-12-01 04:55:49 UTC (rev 13127)
+++ trunk/maven-repo-helper/src/main/bin/mh_install 2010-12-02 22:18:15 UTC (rev 13128)
@@ -1,5 +1,19 @@
#!/bin/bash --
+# Copyright 2009 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.
+
set -e
. /usr/share/maven-repo-helper/mh_lib.sh
@@ -36,57 +50,75 @@
exit 1
}
-ARGS="p package no-publish-used-rule r rules v u published-rules i ignore-rules e set-version verbose n no-act" parseargs "$@"
+ARGS="p package no-publish-used-rule r rules u published-rules i ignore-rules e set-version v verbose n no-act" parseargs "$@"
RULES=$(getarg r rules)
PUBLISHED_RULES=$(getarg u published-rules)
IGNORE_RULES=$(getarg i ignore-rules)
SETVERSION=$(getarg e set-version)
PACKAGE=$(getarg p package)
-PACKAGE=${PACKAGE:?"Package parameter (-p) is mandatory"}
NO_PUBLISH_USED_RULE=$(getarg no-publish-used-rule)
VERBOSE=$(getarg v verbose)
NOACT=$(getarg n no-act)
-DH_OPTS="${VERBOSE:+-v} ${NOACT:+-n}"
-MH_ARGS="--package=${PACKAGE} ${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}"
+function installpackage()
+{
+ 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}"
-if [ -z "$NOACT" ]; then
- cat debian/$PACKAGE.poms | while read POM OPT1 OPT2 OPT3 OPT4 $OPT5 $OPT6 $OPT7 $OPT8 $OPT9 $OPT10; do
- # Remove comments
- POM=${POM##\#*}
- if [[ -n "$POM" ]]; then
- ARTIFACT=
- C=1
+ cat debian/$p.poms | while read POM OPT1 OPT2 OPT3 OPT4 OPT5 OPT6 OPT7 OPT8 OPT9 OPT10; do
+ # Remove comments
+ POM=${POM##\#*}
+ if [[ -n "$POM" ]]; then
+ POM_DIR=$(dirname $POM)
+ ARTIFACT=
+ C=1
+ _opt=$(eval echo '$OPT'$C)
+ while [ -n "$_opt" ]; do
+ if [ "--artifact" = "${_opt%%=*}" ]; then
+ export ARTIFACT=${_opt##--artifact=}
+ # Unset the option where we found the artifact
+ eval OPT$C=
+ # shift all following options
+ while [ -n "$_opt" ]; do
+ C1=$(( $C + 1 ))
+ eval OPT$C='$OPT'$C1
+ C=$C1
_opt=$(eval echo '$OPT'$C)
- while [ -n "$_opt" ]; do
- if [ "--artifact" = "${_opt%%=*}" ]; then
- export ARTIFACT=${_opt##--artifact=}
- # Unset the option where we found the artifact
- eval OPT$C=
- # shift all following options
- while [ -n "$_opt" ]; do
- C1=$(( $C + 1 ))
- eval OPT$C='$OPT'$C1
- C=$C1
- _opt=$(eval echo '$OPT'$C)
- done
- fi
- C=$(( $C + 1 ))
- _opt=$(eval echo '$OPT'$C)
- done
- if [[ ! "--ignore" == "$OPT1" ]]; then
- if [[ ! -z "$VERBOSE" || "$DH_VERBOSE" = "1" ]]; then
- echo -e "\tmh_installpom $DH_OPTS $MH_ARGS $OPT1 $OPT2 $OPT3 $OPT4 $OPT5 $OPT6 $OPT7 $OPT8 $OPT9 $OPT10 $POM"
- fi
- mh_installpom $DH_OPTS $MH_ARGS $OPT1 $OPT2 $OPT3 $OPT4 $OPT5 $OPT6 $OPT7 $OPT8 $OPT9 $OPT10 $POM
- if [[ -n "$ARTIFACT" ]]; then
- if [[ ! -z "$VERBOSE" || "$DH_VERBOSE" = "1" ]]; then
- echo -e "\tmh_installjar $DH_OPTS $MH_ARGS $OPT1 $OPT2 $OPT3 $OPT4 $OPT5 $OPT6 $OPT7 $OPT8 $OPT9 $OPT10 $POM $ARTIFACT"
- fi
- mh_installjar $DH_OPTS $MH_ARGS $OPT1 $OPT2 $OPT3 $OPT4 $OPT5 $OPT6 $OPT7 $OPT8 $OPT9 $OPT10 $POM $ARTIFACT
- fi
- fi
+ done
+ fi
+ C=$(( $C + 1 ))
+ _opt=$(eval echo '$OPT'$C)
+ done
+ if [[ ! "--ignore" == "$OPT1" ]]; then
+ if [[ ! -z "$VERBOSE" || "$DH_VERBOSE" = "1" ]]; then
+ echo -e "\tmh_installpom $OPT1 $OPT2 $OPT3 $OPT4 $OPT5 $OPT6 $OPT7 $OPT8 $OPT9 $OPT10 $DH_OPTS $MH_ARGS $POM"
fi
- done
+ mh_installpom $OPT1 $OPT2 $OPT3 $OPT4 $OPT5 $OPT6 $OPT7 $OPT8 $OPT9 $OPT10 $DH_OPTS $MH_ARGS $POM
+ if [[ -n "$ARTIFACT" ]]; then
+ if [[ ! -z "$VERBOSE" || "$DH_VERBOSE" = "1" ]]; then
+ echo -e "\tmh_installjar --skip-clean-pom $OPT1 $OPT2 $OPT3 $OPT4 $OPT5 $OPT6 $OPT7 $OPT8 $OPT9 $OPT10 $DH_OPTS $MH_ARGS $POM $ARTIFACT"
+ fi
+ mh_installjar --skip-clean-pom $OPT1 $OPT2 $OPT3 $OPT4 $OPT5 $OPT6 $OPT7 $OPT8 $OPT9 $OPT10 $DH_OPTS $MH_ARGS $POM $ARTIFACT
+ fi
+ if [[ -f $POM_DIR/src/site/site.xml ]]; then
+ if [[ ! -z "$VERBOSE" || "$DH_VERBOSE" = "1" ]]; then
+ echo mh_installsite --skip-clean-pom $OPT1 $OPT2 $OPT3 $OPT4 $OPT5 $OPT6 $OPT7 $OPT8 $OPT9 $OPT10 $DH_OPTS $MH_ARGS $POM $POM_DIR/src/site/site.xml
+ fi
+ mh_installsite --skip-clean-pom $OPT1 $OPT2 $OPT3 $OPT4 $OPT5 $OPT6 $OPT7 $OPT8 $OPT9 $OPT10 $DH_OPTS $MH_ARGS $POM $POM_DIR/src/site/site.xml
+ fi
+ fi
+ fi
+ done
+}
+
+if [ -n "$PACKAGE" ]; then
+ installpackage $PACKAGE
+else
+ for p in `findpackages`; do
+ if [ -f debian/$p.poms ]; then
+ installpackage $p
+ fi
+ done
fi
Modified: trunk/maven-repo-helper/src/main/bin/mh_installjar
===================================================================
--- trunk/maven-repo-helper/src/main/bin/mh_installjar 2010-12-01 04:55:49 UTC (rev 13127)
+++ trunk/maven-repo-helper/src/main/bin/mh_installjar 2010-12-02 22:18:15 UTC (rev 13128)
@@ -1,5 +1,19 @@
#!/bin/bash --
+# Copyright 2009 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.
+
set -e
. /usr/share/maven-repo-helper/mh_lib.sh
@@ -59,8 +73,8 @@
exit 1
}
-# The following elements are options which just need to be ignored: no-parent has-package-version keep-elements
-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" parseargs "$@"
+# The following elements are options which just need to be ignored: no-parent has-package-version keep-elements ignore-pom
+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 "$@"
if [ "$ARGC" -lt "2" ]; then
syntax
@@ -159,9 +173,9 @@
fi
cp ${srcJar} debian/.mh/${destJar}
if [[ ! -z "$VERBOSE" || "$DH_VERBOSE" = "1" ]]; then
- echo -e "\tinstall -m 644 -D ${srcJar} debian/${PACKAGE}/${destDir}/${destJar}"
+ echo -e "\tinstall -m 644 -D debian/.mh/${destJar} debian/${PACKAGE}/${destDir}/${destJar}"
fi
- install -m 644 -D ${srcJar} debian/${PACKAGE}/${destDir}/${destJar}
+ install -m 644 -D debian/.mh/${destJar} debian/${PACKAGE}/${destDir}/${destJar}
JAR_INSTALLED=done
else
Modified: trunk/maven-repo-helper/src/main/bin/mh_installpom
===================================================================
--- trunk/maven-repo-helper/src/main/bin/mh_installpom 2010-12-01 04:55:49 UTC (rev 13127)
+++ trunk/maven-repo-helper/src/main/bin/mh_installpom 2010-12-02 22:18:15 UTC (rev 13128)
@@ -1,5 +1,19 @@
#!/bin/bash --
+# Copyright 2009 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.
+
set -e
. /usr/share/maven-repo-helper/mh_lib.sh
@@ -45,13 +59,14 @@
echo -e "\t Optional, the default location is debian/maven.ignoreRules"
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-ignore-pom: read the POM but don't install it"
echo -e ""
echo -e "See also: mh_installpoms(1), mh_cleanpom(1)"
exit 1
}
-# The following elements are options which just need to be ignored: artifact java-lib usj-name usj-version no-usj-versionless dest-jar
-ARGS="p package o no-parent no-publish-used-rule r rules u published-rules i ignore-rules e set-version v verbose n no-act h has-package-version keep-elements artifact java-lib usj-name usj-version no-usj-versionless dest-jar" parseargs "$@"
+# The following elements are options which just need to be ignored: artifact java-lib usj-name usj-version no-usj-versionless dest-jar classifier
+ARGS="p package o no-parent no-publish-used-rule r rules u published-rules i ignore-rules e set-version v verbose n no-act h has-package-version keep-elements artifact java-lib usj-name usj-version no-usj-versionless dest-jar ignore-pom classifier" parseargs "$@"
if [ "$ARGC" -lt "1" ]; then
syntax
@@ -69,6 +84,7 @@
NOACT=$(getarg n no-act)
HAS_PACKAGE_VERSION=$(getarg h has-package-version)
KEEP_ELEMENTS=$(getarg keep-elements)
+IGNORE_POM=$(getarg ignore-pom)
POM="${ARGV[0]}"
DH_OPTS="${VERBOSE:+-v} ${NOACT:+-n}"
@@ -90,6 +106,10 @@
echo -e "\tmv debian/.mh/pom.xml debian/.mh/${artifactId}-${debianVersion}.pom"
fi
+if [ -n "${IGNORE_POM}" ]; then
+ exit
+fi
+
mv debian/.mh/pom.xml.keep debian/.mh/${artifactId}-${version}.pom
mv debian/.mh/pom.xml debian/.mh/${artifactId}-${debianVersion}.pom
Modified: trunk/maven-repo-helper/src/main/bin/mh_installpoms
===================================================================
--- trunk/maven-repo-helper/src/main/bin/mh_installpoms 2010-12-01 04:55:49 UTC (rev 13127)
+++ trunk/maven-repo-helper/src/main/bin/mh_installpoms 2010-12-02 22:18:15 UTC (rev 13128)
@@ -1,5 +1,19 @@
#!/bin/bash --
+# Copyright 2009 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.
+
set -e
. /usr/share/maven-repo-helper/mh_lib.sh
@@ -34,7 +48,7 @@
exit 1
}
-ARGS="p package no-publish-used-rule r rules v u published-rules i ignore-rules e set-version verbose n no-act" parseargs "$@"
+ARGS="p package no-publish-used-rule r rules u published-rules i ignore-rules e set-version v verbose n no-act" parseargs "$@"
RULES=$(getarg r rules)
PUBLISHED_RULES=$(getarg u published-rules)
@@ -50,15 +64,15 @@
MH_ARGS="--package=${PACKAGE} ${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}"
if [ -z "$NOACT" ]; then
- cat debian/$PACKAGE.poms | while read POM OPT1 OPT2 OPT3 OPT4 $OPT5 $OPT6 $OPT7 $OPT8 $OPT9 $OPT10; do
+ cat debian/$PACKAGE.poms | while read POM OPT1 OPT2 OPT3 OPT4 OPT5 OPT6 OPT7 OPT8 OPT9 OPT10; do
# Remove comments
POM=${POM##\#*}
if [[ ! -z "$POM" ]]; then
if [[ ! -z "$VERBOSE" || "$DH_VERBOSE" = "1" ]]; then
- echo -e "\tmh_installpom $DH_OPTS $MH_ARGS $OPT1 $OPT2 $OPT3 $OPT4 $OPT5 $OPT6 $OPT7 $OPT8 $OPT9 $OPT10 $POM"
+ echo -e "\tmh_installpom $OPT1 $OPT2 $OPT3 $OPT4 $OPT5 $OPT6 $OPT7 $OPT8 $OPT9 $OPT10 $DH_OPTS $MH_ARGS $POM"
fi
if [[ ! "--ignore" == "$OPT1" ]]; then
- mh_installpom $DH_OPTS $MH_ARGS $OPT1 $OPT2 $OPT3 $OPT4 $OPT5 $OPT6 $OPT7 $OPT8 $OPT9 $OPT10 $POM
+ mh_installpom $OPT1 $OPT2 $OPT3 $OPT4 $OPT5 $OPT6 $OPT7 $OPT8 $OPT9 $OPT10 $DH_OPTS $MH_ARGS $POM
fi
fi
done
Added: trunk/maven-repo-helper/src/main/bin/mh_installsite
===================================================================
--- trunk/maven-repo-helper/src/main/bin/mh_installsite (rev 0)
+++ trunk/maven-repo-helper/src/main/bin/mh_installsite 2010-12-02 22:18:15 UTC (rev 13128)
@@ -0,0 +1,119 @@
+#!/bin/bash --
+
+# Copyright 2009 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.
+
+set -e
+
+. /usr/share/maven-repo-helper/mh_lib.sh
+
+syntax()
+{
+ echo -e "Usage: mh_installsite [option]... [pom] [site-file]"
+ echo -e "Installs the site.xml file in /usr/share/maven-repo, at the correct location for"
+ echo -e "Maven."
+ echo -e ""
+ echo -e "Where"
+ echo -e "\t[pom] is the location of the POM associated with the site.xml file to install."
+ echo -e "\t GroupId, artifactId and version will be extracted from this file."
+ echo -e "\t[site-file] is the location of the site.xml to install."
+ 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 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-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 ""
+ 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 "$@"
+
+if [ "$ARGC" -lt "2" ]; then
+ syntax
+fi
+
+NOPARENT=$(getarg o no-parent)
+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)
+NOACT=$(getarg n no-act)
+SKIP_CLEAN_POM=$(getarg skip-clean-pom)
+POM="${ARGV[0]}"
+SITE_FILE="${ARGV[1]}"
+
+DH_OPTS="${VERBOSE:+-v} ${NOACT:+-n}"
+CLEAN_ARGS="--package=${PACKAGE} ${SETVERSION:+--set-version=$SETVERSION} ${RULES:+--rules=$RULES}"
+
+mkdir -p debian/.mh 2> /dev/null
+
+if [ -z "$SKIP_CLEAN_POM" ]; then
+ if [[ ! -z "$VERBOSE" || "$DH_VERBOSE" = "1" ]]; then
+ echo -e "\tmh_cleanpom $DH_OPTS $CLEAN_ARGS $POM debian/.mh/pom.xml debian/.mh/pom.properties"
+ fi
+
+ mh_cleanpom $DH_OPTS $CLEAN_ARGS $POM debian/.mh/pom.xml debian/.mh/pom.properties
+fi
+
+source debian/.mh/pom.properties
+
+groupPath=$(echo $groupId | tr . / )
+
+if [ ! -e $SITE_FILE ]; then
+ echo "Cannot find the site.xml file to install: $SITE_FILE"
+ exit 2
+fi
+
+VERSIONED_SITE_NAME="${artifactId}-${version}-site.xml"
+DEBIAN_SITE_NAME="${artifactId}-${debianVersion}-site.xml"
+
+MVN_VERSIONED_DIR=usr/share/maven-repo/${groupPath}/${artifactId}/${version}
+MVN_DEBIAN_DIR=usr/share/maven-repo/${groupPath}/${artifactId}/${debianVersion}
+
+install_site ()
+{
+ local srcSite=$1
+ local destDir=$2
+ local destSite=$3
+
+ if [[ ! -z "$VERBOSE" || "$DH_VERBOSE" = "1" ]]; then
+ echo "mh_installsite: Install $srcSite to $destDir $destSite"
+ fi
+
+ cp ${srcSite} debian/.mh/${destSite}
+ if [[ ! -z "$VERBOSE" || "$DH_VERBOSE" = "1" ]]; then
+ echo -e "\tinstall -m 644 -D debian/.mh/${destSite} debian/${PACKAGE}/${destDir}/${destSite}"
+ fi
+ install -m 644 -D debian/.mh/${destSite} debian/${PACKAGE}/${destDir}/${destSite}
+}
+
+# Install site.xml in the Maven repository
+install_site "$SITE_FILE" "$MVN_VERSIONED_DIR" "$VERSIONED_SITE_NAME"
+
+if [[ "${version}" != "${debianVersion}" ]]; then
+ install_site "$SITE_FILE" "$MVN_DEBIAN_DIR" "$DEBIAN_SITE_NAME"
+fi
+
Modified: trunk/maven-repo-helper/src/main/bin/mh_linkjar
===================================================================
--- trunk/maven-repo-helper/src/main/bin/mh_linkjar 2010-12-01 04:55:49 UTC (rev 13127)
+++ trunk/maven-repo-helper/src/main/bin/mh_linkjar 2010-12-02 22:18:15 UTC (rev 13128)
@@ -1,5 +1,19 @@
#!/bin/bash --
+# Copyright 2009 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.
+
set -e
. /usr/share/maven-repo-helper/mh_lib.sh
Modified: trunk/maven-repo-helper/src/main/bin/mh_linkrepojar
===================================================================
--- trunk/maven-repo-helper/src/main/bin/mh_linkrepojar 2010-12-01 04:55:49 UTC (rev 13127)
+++ trunk/maven-repo-helper/src/main/bin/mh_linkrepojar 2010-12-02 22:18:15 UTC (rev 13128)
@@ -1,5 +1,19 @@
#!/bin/bash --
+# Copyright 2009 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.
+
set -e
. /usr/share/maven-repo-helper/mh_lib.sh
Modified: trunk/maven-repo-helper/src/main/bin/mh_patchpom
===================================================================
--- trunk/maven-repo-helper/src/main/bin/mh_patchpom 2010-12-01 04:55:49 UTC (rev 13127)
+++ trunk/maven-repo-helper/src/main/bin/mh_patchpom 2010-12-02 22:18:15 UTC (rev 13128)
@@ -1,5 +1,19 @@
#!/bin/bash --
+# Copyright 2009 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.
+
set -e
. /usr/share/maven-repo-helper/mh_lib.sh
Modified: trunk/maven-repo-helper/src/main/bin/mh_unpatchpoms
===================================================================
--- trunk/maven-repo-helper/src/main/bin/mh_unpatchpoms 2010-12-01 04:55:49 UTC (rev 13127)
+++ trunk/maven-repo-helper/src/main/bin/mh_unpatchpoms 2010-12-02 22:18:15 UTC (rev 13128)
@@ -1,5 +1,19 @@
#!/bin/bash --
+# Copyright 2009 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.
+
set -e
. /usr/share/maven-repo-helper/mh_lib.sh
Modified: trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/Dependency.java
===================================================================
--- trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/Dependency.java 2010-12-01 04:55:49 UTC (rev 13127)
+++ trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/Dependency.java 2010-12-02 22:18:15 UTC (rev 13128)
@@ -1,8 +1,20 @@
+package org.debian.maven.repo;
+
/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
+ * Copyright 2009 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.
*/
-package org.debian.maven.repo;
import java.util.*;
@@ -10,7 +22,7 @@
*
* @author Ludovic Claude <ludovicc at users.sourceforge.net>
*/
-public class Dependency implements Comparable {
+public class Dependency implements Comparable, Cloneable {
private String groupId;
private String artifactId;
@@ -199,6 +211,15 @@
return 0;
}
+ public Object clone() {
+ try {
+ return super.clone();
+ } catch (CloneNotSupportedException e) {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
public Dependency applyRules(Collection rules) {
for (Iterator i = rules.iterator(); i.hasNext();) {
DependencyRule rule = (DependencyRule) i.next();
Modified: trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/DependencyNotFoundException.java
===================================================================
--- trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/DependencyNotFoundException.java 2010-12-01 04:55:49 UTC (rev 13127)
+++ trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/DependencyNotFoundException.java 2010-12-02 22:18:15 UTC (rev 13128)
@@ -1,5 +1,21 @@
package org.debian.maven.repo;
+/*
+ * Copyright 2009 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.
+ */
+
/**
* @author Ludovic Claude <ludovicc at users.sourceforge.net>
*/
Modified: trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/DependencyRule.java
===================================================================
--- trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/DependencyRule.java 2010-12-01 04:55:49 UTC (rev 13127)
+++ trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/DependencyRule.java 2010-12-02 22:18:15 UTC (rev 13128)
@@ -1,5 +1,21 @@
package org.debian.maven.repo;
+/*
+ * Copyright 2009 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.util.StringTokenizer;
/**
Modified: trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/DependencyRuleSet.java
===================================================================
--- trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/DependencyRuleSet.java 2010-12-01 04:55:49 UTC (rev 13127)
+++ trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/DependencyRuleSet.java 2010-12-02 22:18:15 UTC (rev 13128)
@@ -1,5 +1,21 @@
package org.debian.maven.repo;
+/*
+ * Copyright 2009 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.*;
import java.util.*;
import java.util.logging.Level;
@@ -18,6 +34,7 @@
private boolean warnRulesFileNotFound = true;
private String name;
private String description;
+ private DependencyRuleSet dontDuplicate;
public DependencyRuleSet(String name) {
this.name = name;
@@ -73,6 +90,14 @@
this.warnRulesFileNotFound = warnRulesFileNotFound;
}
+ public DependencyRuleSet getDontDuplicate() {
+ return dontDuplicate;
+ }
+
+ public void setDontDuplicate(DependencyRuleSet dontDuplicate) {
+ this.dontDuplicate = dontDuplicate;
+ }
+
public Iterator iterator() {
return getRules().iterator();
}
@@ -103,6 +128,10 @@
}
}
+ public void remove(DependencyRule rule) {
+ getRules().remove(rule);
+ }
+
public Set findMatchingRules(Dependency dependency) {
Set matchingRules = new HashSet();
for (Iterator i = rules.iterator(); i.hasNext();) {
@@ -121,7 +150,9 @@
for (Iterator i = getRules().iterator(); i.hasNext();) {
DependencyRule rule = (DependencyRule) i.next();
- out.println(rule.toString());
+ if (dontDuplicate == null || !dontDuplicate.getRules().contains(rule)) {
+ out.println(rule.toString());
+ }
}
out.flush();
out.close();
@@ -130,6 +161,16 @@
}
}
+ public void dump() {
+ if (rules != null) {
+ System.out.println(name + ":");
+ for (Iterator i = rules.iterator(); i.hasNext();) {
+ System.out.println(" " + i.next());
+ }
+ System.out.println("---------");
+ }
+ }
+
private void readRules() {
rules = new TreeSet();
if (rulesFile == null) {
@@ -168,5 +209,4 @@
log.log(Level.SEVERE, null, ex);
}
}
-
}
Modified: trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/ListOfPOMs.java
===================================================================
--- trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/ListOfPOMs.java 2010-12-01 04:55:49 UTC (rev 13127)
+++ trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/ListOfPOMs.java 2010-12-02 22:18:15 UTC (rev 13128)
@@ -1,5 +1,21 @@
package org.debian.maven.repo;
+/*
+ * Copyright 2009 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.*;
import java.util.*;
import java.util.logging.Level;
@@ -13,7 +29,7 @@
private static final Logger log = Logger.getLogger(ListOfPOMs.class.getName());
private boolean verbose;
- private File baseDir;
+ private File baseDir = new File(".");
private File poms;
private List pomList;
private Map pomOptions;
@@ -175,6 +191,8 @@
options.setNoParent(true);
} else if (option.startsWith("--package=")) {
options.setDestPackage(option.substring("--package=".length()));
+ } else if ("--has-package-version".equals(option)) {
+ options.setHasPackageVersion(true);
} else if (option.startsWith("--keep-elements=")) {
options.setKeepElements(option.substring("--keep-elements=".length()));
} else if (option.startsWith("--artifact=")) {
@@ -189,6 +207,10 @@
options.setNoUsjVersionless(true);
} else if (option.startsWith("--dest-jar=")) {
options.setDestJar(option.substring("--dest-jar=".length()));
+ } else if (option.startsWith("--classifier=")) {
+ options.setUsjName(option.substring("--classifier=".length()));
+ } else if ("--ignore-pom".equals(option)) {
+ options.setIgnorePOM(true);
}
}
if (verbose) {
@@ -202,8 +224,11 @@
}
public void save() {
- if (poms != null && !poms.exists()) {
+ if (poms != null) {
try {
+ if (pomList == null) {
+ readPomsFile();
+ }
PrintWriter out = new PrintWriter(new FileWriter(poms));
out.println("# List of POM files for the package");
out.println("# Format of this file is:");
@@ -213,6 +238,8 @@
out.println("# --no-parent: remove the <parent> tag from the POM");
out.println("# --package=<package>: an alternative package to use when installing this POM");
out.println("# and its artifact");
+ out.println("# --has-package-version: to indicate that the original version of the POM is the same as the upstream part");
+ out.println("# of the version for the package.");
out.println("# --keep-elements=<elem1,elem2>: a list of XML elements to keep in the POM");
out.println("# during a clean operation with mh_cleanpom or mh_installpom");
out.println("# --artifact=<path>: path to the build artifact associated with this POM,");
@@ -223,6 +250,10 @@
out.println("# --usj-version=<version>: version to use when installing the library in /usr/share/java");
out.println("# --no-usj-versionless: don't install the versionless link in /usr/share/java");
out.println("# --dest-jar=<path>: the destination for the real jar");
+ out.println("# it will be installed with mh_install.");
+ out.println("# --classifier=<classifier>: Optional, the classifier for the jar. Empty by default.");
+ out.println("# --ignore-pom: don't install the POM with mh_install or mh_installpoms. To use with POM files that are created");
+ out.println("# temporarily for certain artifacts such as Javadoc jars.");
out.println("#");
for (Iterator i = pomList.iterator(); i.hasNext();) {
String pomPath = (String) i.next();
@@ -238,6 +269,7 @@
public static class POMOptions {
private boolean ignore;
+ private boolean ignorePOM;
private boolean noParent;
private boolean hasPackageVersion;
private String destPackage;
@@ -248,6 +280,7 @@
private String usjVersion;
private String destJar;
private boolean noUsjVersionless;
+ private String classifier;
public boolean isIgnore() {
return ignore;
@@ -257,6 +290,14 @@
this.ignore = ignore;
}
+ public boolean isIgnorePOM() {
+ return ignorePOM;
+ }
+
+ public void setIgnorePOM(boolean ignorePOM) {
+ this.ignorePOM = ignorePOM;
+ }
+
public boolean isNoParent() {
return noParent;
}
@@ -337,6 +378,14 @@
this.noUsjVersionless = noUsjVersionless;
}
+ public String getClassifier() {
+ return classifier;
+ }
+
+ public void setClassifier(String classifier) {
+ this.classifier = classifier;
+ }
+
public String toString() {
if (ignore) {
return " --ignore";
@@ -372,6 +421,12 @@
if (noUsjVersionless) {
options += " --no-usj-versionless";
}
+ if (classifier != null) {
+ options += " --classifier=" + classifier;
+ }
+ if (ignorePOM) {
+ options += " --ignore-pom";
+ }
return options;
}
}
Modified: trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/POMCleaner.java
===================================================================
--- trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/POMCleaner.java 2010-12-01 04:55:49 UTC (rev 13127)
+++ trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/POMCleaner.java 2010-12-02 22:18:15 UTC (rev 13128)
@@ -1,5 +1,21 @@
package org.debian.maven.repo;
+/*
+ * Copyright 2009 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.FileOutputStream;
import java.io.IOException;
@@ -97,13 +113,16 @@
if (path.size() > 2 && keepElements.contains(path.get(1))) {
if ("version".equals(element)) {
String parent = (String) path.get(path.size() - 1);
- if ("plugin".equals(parent) || "extension".equals(parent) || "dependency".equals(parent)) {
+ if ("plugin".equals(parent)) {
return true;
}
}
}
- return WRITE_IGNORED_ELEMENTS.contains(element);
+// if (WRITE_IGNORED_ELEMENTS.contains(element)) {
+// System.out.println("Write ignored " + element + " " + printPath(path) + " for " + dependency);
+// }
+ return path.size() == 1 && WRITE_IGNORED_ELEMENTS.contains(element);
}
protected boolean acceptDependency(Dependency dependency, POMInfo info) {
Modified: trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/POMHandler.java
===================================================================
--- trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/POMHandler.java 2010-12-01 04:55:49 UTC (rev 13127)
+++ trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/POMHandler.java 2010-12-02 22:18:15 UTC (rev 13128)
@@ -1,5 +1,21 @@
package org.debian.maven.repo;
+/*
+ * Copyright 2009 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;
/**
Modified: trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/POMInfo.java
===================================================================
--- trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/POMInfo.java 2010-12-01 04:55:49 UTC (rev 13127)
+++ trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/POMInfo.java 2010-12-02 22:18:15 UTC (rev 13128)
@@ -1,12 +1,28 @@
package org.debian.maven.repo;
+/*
+ * Copyright 2009 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.util.*;
/**
*
* @author Ludovic Claude <ludovicc at users.sourceforge.net>
*/
-public class POMInfo {
+public class POMInfo implements Cloneable {
public static final String DEPENDENCY_MANAGEMENT_LIST = "DependencyManagement";
public static final String PROFILE_DEPENDENCY_MANAGEMENT_LIST = "ProfileDependencyManagement";
@@ -16,9 +32,11 @@
public static final String REPORTING_PLUGINS = "ReportingDependencies";
public static final String PROFILE_PLUGINS = "ProfilePlugins";
public static final String PROFILE_PLUGIN_DEPENDENCIES = "ProfilePluginDependencies";
+ public static final String PROFILE_PLUGIN_MANAGEMENT = "ProfilePluginManagement";
public static final String PROFILE_REPORTING_PLUGINS = "ProfileReportingPlugins";
public static final String PLUGINS = "Plugins";
public static final String PLUGIN_MANAGEMENT = "PluginManagement";
+ public static final String PLUGIN_MANAGEMENT_DEPENDENCIES = "PluginManagementDependencies";
public static final String EXTENSIONS = "Extensions";
public static final String MODULES = "Modules";
public static final String PARENT = "Parent";
@@ -34,11 +52,13 @@
private List plugins;
private List pluginManagement;
private List pluginDependencies;
+ private List pluginManagementDependencies;
private List reportingPlugins;
private List profileDependencies;
private List profileDependencyManagement;
private List profilePlugins;
private List profilePluginDependencies;
+ private List profilePluginManagement;
private List profileReportingPlugins;
private Map properties;
private POMInfo parentPOM;
@@ -154,6 +174,14 @@
this.pluginManagement = pluginManagement;
}
+ public List getPluginManagementDependencies() {
+ return pluginManagementDependencies;
+ }
+
+ public void setPluginManagementDependencies(List pluginManagementDependencies) {
+ this.pluginManagementDependencies = pluginManagementDependencies;
+ }
+
public List getProfileDependencies() {
return profileDependencies;
}
@@ -210,6 +238,14 @@
this.profilePluginDependencies = profilePluginDependencies;
}
+ public List getProfilePluginManagement() {
+ return profilePluginManagement;
+ }
+
+ public void setProfilePluginManagement(List profilePluginManagement) {
+ this.profilePluginManagement = profilePluginManagement;
+ }
+
public List getProfileReportingPlugins() {
return profileReportingPlugins;
}
@@ -226,12 +262,8 @@
return parentList;
}
- public Set getPublishedRules(boolean includeDefault) {
+ public Set getPublishedRules() {
Set rules = new TreeSet();
- if (includeDefault) {
- rules.add(DependencyRule.MAVEN_PLUGINS_KEEP_VERSION_RULE);
- rules.add(DependencyRule.TO_DEBIAN_VERSION_RULE);
- }
if (getProperties() == null) {
return rules;
}
@@ -265,10 +297,12 @@
result.setPlugins(Dependency.applyRules(getPlugins(), rules));
result.setPluginDependencies(Dependency.applyRules(getPluginDependencies(), rules));
result.setPluginManagement(Dependency.applyRules(getPluginManagement(), rules));
+ result.setPluginManagementDependencies(Dependency.applyRules(getPluginManagementDependencies(), rules));
result.setReportingPlugins(Dependency.applyRules(getReportingPlugins(), rules));
result.setProfileDependencies(Dependency.applyRules(getProfileDependencies(), rules));
result.setProfilePlugins(Dependency.applyRules(getProfilePlugins(), rules));
result.setProfilePluginDependencies(Dependency.applyRules(getProfilePluginDependencies(), rules));
+ result.setProfilePluginManagement(Dependency.applyRules(getProfilePluginManagement(), rules));
result.setProfileDependencyManagement(Dependency.applyRules(getProfileDependencyManagement(), rules));
result.setProfileReportingPlugins(Dependency.applyRules(getProfileReportingPlugins(), rules));
@@ -287,8 +321,8 @@
setOriginalParentVersion(getParent().getVersion());
setParent(getParent().applyRules(rules));
if (repository != null) {
- POMInfo parentPOM = repository.getPOM(getParent());
- mergeManagement(parentPOM);
+ POMInfo newParentPOM = repository.getPOM(getParent());
+ mergeManagement(newParentPOM);
} else {
// Always apply rules
//System.out.println(this.getThisPom() + ": Parent is not registered in repository, apply rules anyway");
@@ -303,10 +337,12 @@
setPlugins(Dependency.applyRules(getPlugins(), rules));
setPluginDependencies(Dependency.applyRules(getPluginDependencies(), rules));
setPluginManagement(Dependency.applyRules(getPluginManagement(), rules));
+ setPluginManagementDependencies(Dependency.applyRules(getPluginManagementDependencies(), rules));
setReportingPlugins(Dependency.applyRules(getReportingPlugins(), rules));
setProfileDependencies(Dependency.applyRules(getProfileDependencies(), rules));
setProfilePlugins(Dependency.applyRules(getProfilePlugins(), rules));
setProfilePluginDependencies(Dependency.applyRules(getProfilePluginDependencies(), rules));
+ setProfilePluginManagement(Dependency.applyRules(getProfilePluginManagement(), rules));
setProfileDependencyManagement(Dependency.applyRules(getProfileDependencyManagement(), rules));
setProfileReportingPlugins(Dependency.applyRules(getProfileReportingPlugins(), rules));
}
@@ -318,10 +354,12 @@
setPlugins(Dependency.applyIgnoreRules(getPlugins(), rules));
setPluginDependencies(Dependency.applyIgnoreRules(getPluginDependencies(), rules));
setPluginManagement(Dependency.applyIgnoreRules(getPluginManagement(), rules));
+ setPluginManagementDependencies(Dependency.applyIgnoreRules(getPluginManagementDependencies(), rules));
setReportingPlugins(Dependency.applyIgnoreRules(getReportingPlugins(), rules));
setProfileDependencies(Dependency.applyIgnoreRules(getProfileDependencies(), rules));
setProfilePlugins(Dependency.applyIgnoreRules(getProfilePlugins(), rules));
setProfilePluginDependencies(Dependency.applyIgnoreRules(getProfilePluginDependencies(), rules));
+ setProfilePluginManagement(Dependency.applyIgnoreRules(getProfilePluginManagement(), rules));
setProfileDependencyManagement(Dependency.applyIgnoreRules(getProfileDependencyManagement(), rules));
setProfileReportingPlugins(Dependency.applyIgnoreRules(getProfileReportingPlugins(), rules));
}
@@ -334,8 +372,11 @@
}
resolveVersions(dependencies, dependencyManagement);
resolveVersions(pluginDependencies, dependencyManagement);
+ resolveVersions(pluginDependencies, pluginManagementDependencies);
resolveVersions(plugins, pluginManagement);
resolveVersions(reportingPlugins, pluginManagement);
+ resolveVersions(profileDependencies, profileDependencyManagement);
+ resolveVersions(profilePlugins, profilePluginManagement);
}
private void mergeManagement(List target, List management) {
@@ -356,6 +397,7 @@
List allManagementLists = new ArrayList();
allManagementLists.addAll(getDependencyList(DEPENDENCY_MANAGEMENT_LIST));
allManagementLists.addAll(getDependencyList(PLUGIN_MANAGEMENT));
+ allManagementLists.addAll(getDependencyList(PLUGIN_MANAGEMENT_DEPENDENCIES));
for (Iterator i = allManagementLists.iterator(); i.hasNext();) {
Dependency mgtDep = (Dependency)i.next();
if (mgtDep.getGroupId().equals(dependency.getGroupId()) &&
@@ -411,6 +453,9 @@
if (PROFILE_PLUGIN_DEPENDENCIES.equals(listSelector)) {
return getProfilePluginDependencies();
}
+ if (PROFILE_PLUGIN_MANAGEMENT.equals(listSelector)) {
+ return getProfilePluginManagement();
+ }
if (PROFILE_REPORTING_PLUGINS.equals(listSelector)) {
return getProfileReportingPlugins();
}
@@ -420,6 +465,9 @@
if (PLUGIN_MANAGEMENT.equals(listSelector)) {
return getPluginManagement();
}
+ if (PLUGIN_MANAGEMENT_DEPENDENCIES.equals(listSelector)) {
+ return getPluginManagementDependencies();
+ }
if (REPORTING_PLUGINS.equals(listSelector)) {
return getReportingPlugins();
}
@@ -436,11 +484,37 @@
}
public List getAllDependencies(String listType) {
- List dependencies = new ArrayList(getDependencyList(listType));
+ List allDependencies = new ArrayList(getDependencyList(listType));
if (getParent() != null) {
List parentDependencies = parentPOM.getAllDependencies(listType);
- dependencies.addAll(parentDependencies);
+ allDependencies.addAll(parentDependencies);
}
- return dependencies;
+ return allDependencies;
}
+
+ public Object clone() {
+ POMInfo clone = new POMInfo();
+ clone.originalParentVersion = originalParentVersion;
+ clone.originalPom = originalPom;
+ clone.parent = parent;
+ clone.thisPom = (Dependency) thisPom.clone();
+ clone.modules = modules;
+ clone.dependencies = dependencies;
+ clone.dependencyManagement = dependencyManagement;
+ clone.extensions = extensions;
+ clone.plugins = plugins;
+ clone.pluginManagement = pluginManagement;
+ clone.pluginDependencies = pluginDependencies;
+ clone.pluginManagementDependencies = pluginManagementDependencies;
+ clone.reportingPlugins = reportingPlugins;
+ clone.profileDependencies = profileDependencies;
+ clone.profileDependencyManagement = profileDependencyManagement;
+ clone.profilePlugins = profilePlugins;
+ clone.profilePluginDependencies = profilePluginDependencies;
+ clone.profilePluginManagement = profilePluginManagement;
+ clone.profileReportingPlugins = profileReportingPlugins;
+ clone.properties = properties;
+ clone.parentPOM = parentPOM;
+ return clone;
+ }
}
Modified: trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/POMReader.java
===================================================================
--- trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/POMReader.java 2010-12-01 04:55:49 UTC (rev 13127)
+++ trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/POMReader.java 2010-12-02 22:18:15 UTC (rev 13128)
@@ -1,5 +1,21 @@
package org.debian.maven.repo;
+/*
+ * Copyright 2009 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.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
@@ -44,12 +60,14 @@
List extensions = new ArrayList();
List plugins = new ArrayList();
List pluginManagement = new ArrayList();
+ List pluginManagementDependencies = new ArrayList();
List pluginDependencies = new ArrayList();
List reportingPlugins = new ArrayList();
List profileDependencies = new ArrayList();
List profileDependencyManagement = new ArrayList();
List profilePlugins = new ArrayList();
List profilePluginDependencies = new ArrayList();
+ List profilePluginManagement = new ArrayList();
List profileReportingPlugins = new ArrayList();
List modules = new ArrayList();
@@ -63,6 +81,7 @@
int inDependency = 0;
int inExtension = 0;
int inPlugin = 0;
+ int inExclusion = 0;
int inParent = 0;
int inProperties = 0;
String element = null;
@@ -80,7 +99,9 @@
} else {
inLevel++;
path.add(element);
- if ("dependency".equals(element)) {
+ if ("exclusions".equals(element) || inExclusion > 0) {
+ inExclusion++;
+ } else if ("dependency".equals(element)) {
inDependency++;
currentDependency = new Dependency(null, null, "jar", null);
String parentElement = (String) path.get(path.size() - 2);
@@ -101,6 +122,8 @@
String p5Element = (String) path.get(path.size() - 6);
if ("project".equals(p5Element)) {
pluginDependencies.add(currentDependency);
+ } else if ("build".equals(p5Element)) {
+ pluginManagementDependencies.add(currentDependency);
} else if ("profile".equals(p5Element)) {
profilePluginDependencies.add(currentDependency);
}
@@ -115,13 +138,21 @@
String parentElement = (String) path.get(path.size() - 2);
String parentParentElement = (String) path.get(path.size() - 3);
String parentParentParentElement = null;
+ String p4Element = null;
if (path.size() > 4) {
parentParentParentElement = (String) path.get(path.size() - 4);
}
+ if (path.size() > 5) {
+ p4Element = (String) path.get(path.size() - 5);
+ }
currentDependency = new Dependency("org.apache.maven.plugins", null, "maven-plugin", null);
if ("plugins".equals(parentElement)) {
if ("pluginManagement".equals(parentParentElement)) {
- pluginManagement.add(currentDependency);
+ if ("profile".equals(p4Element)) {
+ profilePluginManagement.add(currentDependency);
+ } else {
+ pluginManagement.add(currentDependency);
+ }
} else if ("reporting".equals(parentParentElement)) {
if ("profile".equals(parentParentParentElement)) {
profileReportingPlugins.add(currentDependency);
@@ -169,7 +200,9 @@
} else {
inLevel--;
path.remove(path.size() - 1);
- if (inDependency > 0) {
+ if (inExclusion > 0) {
+ inExclusion--;
+ } else if (inDependency > 0) {
inDependency--;
} else if (inPlugin > 0) {
inPlugin--;
@@ -189,7 +222,9 @@
case XMLStreamConstants.CHARACTERS: {
String value = parser.getText().trim();
- if (inDependency > 1 || inPlugin > 1 || inExtension > 1) {
+ if (inIgnoredElement > 0 || inExclusion > 0) {
+ // ignore
+ } else if (inDependency > 1 || inPlugin > 1 || inExtension > 1) {
if ("groupId".equals(element)) {
currentDependency.setGroupId(value);
} else if ("artifactId".equals(element)) {
@@ -279,11 +314,13 @@
expendProperties(plugins, inferedProperties);
expendProperties(pluginManagement, inferedProperties);
expendProperties(pluginDependencies, inferedProperties);
+ expendProperties(pluginManagementDependencies, inferedProperties);
expendProperties(reportingPlugins, inferedProperties);
expendProperties(profileDependencies, inferedProperties);
expendProperties(profileDependencyManagement, inferedProperties);
expendProperties(profilePlugins, inferedProperties);
expendProperties(profilePluginDependencies, inferedProperties);
+ expendProperties(profilePluginManagement, inferedProperties);
expendProperties(profileReportingPlugins, inferedProperties);
POMInfo info = new POMInfo();
@@ -302,11 +339,13 @@
info.setPlugins(plugins);
info.setPluginManagement(pluginManagement);
info.setPluginDependencies(pluginDependencies);
+ info.setPluginManagementDependencies(pluginManagementDependencies);
info.setReportingPlugins(reportingPlugins);
info.setProfileDependencies(profileDependencies);
info.setProfileDependencyManagement(profileDependencyManagement);
info.setProfilePlugins(profilePlugins);
info.setProfilePluginDependencies(profilePluginDependencies);
+ info.setProfilePluginManagement(profilePluginManagement);
info.setProfileReportingPlugins(profileReportingPlugins);
info.setProperties(properties);
return info;
Modified: trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/POMTransformer.java
===================================================================
--- trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/POMTransformer.java 2010-12-01 04:55:49 UTC (rev 13127)
+++ trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/POMTransformer.java 2010-12-02 22:18:15 UTC (rev 13128)
@@ -1,5 +1,21 @@
package org.debian.maven.repo;
+/*
+ * Copyright 2009 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.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
@@ -50,6 +66,7 @@
private ListOfPOMs listOfPOMs;
public POMTransformer() {
+ publishedRules.setDontDuplicate(rules);
}
public Repository getRepository() {
@@ -113,7 +130,8 @@
for (Iterator i = repository.resolvedPomsIterator(); i.hasNext();) {
POMInfo pom = (POMInfo) i.next();
if (pom.getThisPom().getType().equals("maven-plugin")) {
- Set pomRules = pom.getPublishedRules(true);
+ Set pomRules = pom.getPublishedRules();
+ rules.add(DependencyRule.MAVEN_PLUGINS_KEEP_VERSION_RULE);
boolean found = false;
for (Iterator j = pomRules.iterator(); j.hasNext();) {
DependencyRule rule = (DependencyRule) j.next();
@@ -162,13 +180,13 @@
ignoredModules.put(pomFile, modules);
}
modules.add(module);
+ System.out.println("Ignore module " + module + " in POM " + pomFile);
}
- public void keepPomVersions() {
+ public void discoverModulesToIgnore() {
listOfPOMs.foreachPoms(new POMHandler() {
public void handlePOM(File pomFile, boolean noParent, boolean hasPackageVersion) throws Exception {
- keepPomVersion(pomFile);
}
public void ignorePOM(File pomFile) throws Exception {
@@ -178,6 +196,18 @@
});
}
+ public void keepPomVersions() {
+ listOfPOMs.foreachPoms(new POMHandler() {
+
+ public void handlePOM(File pomFile, boolean noParent, boolean hasPackageVersion) throws Exception {
+ keepPomVersion(pomFile);
+ }
+
+ public void ignorePOM(File pomFile) throws Exception {
+ }
+ });
+ }
+
public void keepPomVersion(File pomFile) throws XMLStreamException, FileNotFoundException {
Dependency pom = readPom(pomFile).getThisPom();
addRule(new DependencyRule(pom.getGroupId() + " " + pom.getArtifactId() + " " + pom.getType() + " " + pom.getVersion()));
@@ -197,6 +227,7 @@
public void transformPoms(final String debianPackage, final boolean keepPomVersion,
final String setVersion) {
+ discoverModulesToIgnore();
listOfPOMs.foreachPoms(new POMHandler() {
public void handlePOM(File pomFile, boolean noParent, boolean hasPackageVersion) throws Exception {
@@ -371,6 +402,8 @@
String p5Element = (String) path.get(path.size() - 6);
if ("project".equals(p5Element)) {
listSelector = POMInfo.PLUGIN_DEPENDENCIES;
+ } else if ("build".equals(p5Element)) {
+ listSelector = POMInfo.PLUGIN_MANAGEMENT_DEPENDENCIES;
} else if ("profile".equals(p5Element)) {
listSelector = POMInfo.PROFILE_PLUGIN_DEPENDENCIES;
}
@@ -388,14 +421,22 @@
String parentElement = (String) path.get(path.size() - 2);
String parentParentElement = (String) path.get(path.size() - 3);
String parentParentParentElement = null;
+ String p4Element = null;
if (path.size() > 4) {
parentParentParentElement = (String) path.get(path.size() - 4);
}
+ if (path.size() > 5) {
+ p4Element = (String) path.get(path.size() - 5);
+ }
if ("plugins".equals(parentElement)) {
sawVersion = false;
String listSelector = POMInfo.PLUGINS;
if ("pluginManagement".equals(parentParentElement)) {
- listSelector = POMInfo.PLUGIN_MANAGEMENT;
+ if ("profile".equals(p4Element)) {
+ listSelector = POMInfo.PROFILE_PLUGIN_MANAGEMENT;
+ } else {
+ listSelector = POMInfo.PLUGIN_MANAGEMENT;
+ }
} else if ("reporting".equals(parentParentElement)) {
if ("profile".equals(parentParentParentElement)) {
listSelector = POMInfo.PROFILE_REPORTING_PLUGINS;
@@ -728,11 +769,29 @@
}
protected boolean isWriteIgnoredElement(String element, List path, Dependency dependency) {
- return (isDebianBuild() && DEBIAN_BUILD_IGNORED_ELEMENTS.contains(element))
+// if (isDebianBuild() && DEBIAN_BUILD_IGNORED_ELEMENTS.contains(element)) {
+// System.out.println("Build ignored " + element + " " + printPath(path) + " for " + dependency);
+// }
+// if (isBuildWithoutDoc() && DEBIAN_DOC_IGNORED_ELEMENTS.contains(element)) {
+// System.out.println("Doc ignored " + element + " " + printPath(path) + " for " + dependency);
+// }
+// if (WRITE_IGNORED_ELEMENTS.contains(element)) {
+// System.out.println("Write ignored " + element + " " + printPath(path) + " for " + dependency);
+// }
+ return path.size() == 1 && (isDebianBuild() && DEBIAN_BUILD_IGNORED_ELEMENTS.contains(element))
|| (isBuildWithoutDoc() && DEBIAN_DOC_IGNORED_ELEMENTS.contains(element))
|| WRITE_IGNORED_ELEMENTS.contains(element);
}
+// String printPath(List path) {
+// StringBuilder sb = new StringBuilder();
+// for (Iterator i = path.iterator(); i.hasNext(); ) {
+// sb.append(i.next());
+// if (i.hasNext()) sb.append("/");
+// }
+// return sb.toString();
+// }
+
protected boolean isInfoElement(String element) {
return INFO_ELEMENTS.contains(element);
}
Modified: trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/Repository.java
===================================================================
--- trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/Repository.java 2010-12-01 04:55:49 UTC (rev 13127)
+++ trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/Repository.java 2010-12-02 22:18:15 UTC (rev 13128)
@@ -4,6 +4,22 @@
*/
package org.debian.maven.repo;
+/*
+ * Copyright 2009 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.FileNotFoundException;
import java.io.InputStream;
@@ -97,7 +113,10 @@
Map potentialMatches = new TreeMap();
for (Iterator i = getAllPoms().iterator(); i.hasNext();) {
POMInfo testPom = (POMInfo) i.next();
- Set rules = testPom.getPublishedRules(true);
+ Set rules = testPom.getPublishedRules();
+ rules.add(DependencyRule.MAVEN_PLUGINS_KEEP_VERSION_RULE);
+ rules.add(DependencyRule.TO_DEBIAN_VERSION_RULE);
+
for (Iterator j = rules.iterator(); j.hasNext();) {
DependencyRule rule = (DependencyRule) j.next();
if (rule.matches(dependency) && rule.apply(dependency).equals(testPom.getThisPom())) {
@@ -401,4 +420,5 @@
repository.report();
System.out.println("Done.");
}
+
}
Modified: trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/Rule.java
===================================================================
--- trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/Rule.java 2010-12-01 04:55:49 UTC (rev 13127)
+++ trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/Rule.java 2010-12-02 22:18:15 UTC (rev 13128)
@@ -1,5 +1,21 @@
package org.debian.maven.repo;
+/*
+ * Copyright 2009 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.util.StringTokenizer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
Added: trunk/maven-repo-helper/src/main/share/maven_repo_helper.pm
===================================================================
--- trunk/maven-repo-helper/src/main/share/maven_repo_helper.pm (rev 0)
+++ trunk/maven-repo-helper/src/main/share/maven_repo_helper.pm 2010-12-02 22:18:15 UTC (rev 13128)
@@ -0,0 +1,11 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+use Debian::Debhelper::Dh_Lib;
+
+# dh $@ --with maven_repo_helper
+
+insert_before("dh_compress", "mh_install");
+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 2010-12-01 04:55:49 UTC (rev 13127)
+++ trunk/maven-repo-helper/src/main/share/mh_lib.sh 2010-12-02 22:18:15 UTC (rev 13128)
@@ -4,7 +4,7 @@
# - package selection
#
-MH_VERSION=${MH_VERSION:-1.4}
+MH_VERSION=${MH_VERSION:-1.5}
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"
@@ -37,16 +37,19 @@
elif [ "-" = "${1:0:1}" ]; then
# short opt
optn="${1:1:1}"
- if [ -z "$optn" ] || ! echo $ARGS | sed 's/-/_/g' | grep $optn >/dev/null; then
+ if [ "$optn" = "O" ]; then
+ : # skip -O options passed by dh 7
+ elif [ -z "$optn" ] || ! echo $ARGS | sed 's/-/_/g' | grep $optn >/dev/null; then
echo "Invalid option: $optn"
syntax
+ else
+ optv="${1:2}"
+ if [ -z "$optv" ]; then
+ optv=true
+ fi
+ export -a opt_$optn
+ eval opt_$optn'+=("$optv")'
fi
- optv="${1:2}"
- if [ -z "$optv" ]; then
- optv=true
- fi
- export -a opt_$optn
- eval opt_$optn'+=("$optv")'
else
# not-opt arg
ARGV[$ARGC]="$1"
@@ -82,3 +85,24 @@
done
echo ')'
}
+
+findpackages()
+{
+ if [ -n "$opt_p" ]; then
+ echo $opt_p
+ elif [ -n "$opt_package" ]; then
+ echo $opt_package
+ elif [ -n "$opt_i" ] || [ -n "$opt_indep" ]; then
+ egrep '^(Package|Architecture)' debian/control | grep -B1 'Architecture: all'|sed -n '/^Package:/s/^[^:]*: *//p'
+ elif [ -n "$opt_a" ] || [ -n "$opt_arch" ]; then
+ egrep '^(Package|Architecture)' debian/control | grep -v 'Architecture: all' | grep -B1 Architecture|sed -n '/^Package:/s/^[^:]*: *//p'
+ else
+ sed -n '/^Package:/s/^[^:]*: *//p' debian/control
+ fi
+}
+
+firstpackage()
+{
+ findpackages | head -n1
+}
+
Modified: trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/DependencyRuleTest.java
===================================================================
--- trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/DependencyRuleTest.java 2010-12-01 04:55:49 UTC (rev 13127)
+++ trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/DependencyRuleTest.java 2010-12-02 22:18:15 UTC (rev 13128)
@@ -1,16 +1,23 @@
+package org.debian.maven.repo;
+
/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
+ * Copyright 2009 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.
*/
-package org.debian.maven.repo;
-
import junit.framework.TestCase;
-/**
- *
- * @author ludo
- */
public class DependencyRuleTest extends TestCase {
/**
Modified: trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/ListOfPOMsTest.java
===================================================================
--- trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/ListOfPOMsTest.java 2010-12-01 04:55:49 UTC (rev 13127)
+++ trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/ListOfPOMsTest.java 2010-12-02 22:18:15 UTC (rev 13128)
@@ -1,8 +1,21 @@
package org.debian.maven.repo;
-/**
- * @author ludo
+/*
+ * Copyright 2009 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.
*/
+
public class ListOfPOMsTest extends TestBase {
public void testRead() throws Exception {
Modified: trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/POMCleanerTest.java
===================================================================
--- trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/POMCleanerTest.java 2010-12-01 04:55:49 UTC (rev 13127)
+++ trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/POMCleanerTest.java 2010-12-02 22:18:15 UTC (rev 13128)
@@ -1,16 +1,25 @@
+package org.debian.maven.repo;
+
/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
+ * Copyright 2009 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.
*/
-package org.debian.maven.repo;
import java.io.File;
import java.io.FileInputStream;
import java.util.Properties;
-/**
- * @author ludo
- */
public class POMCleanerTest extends TestBase {
private File pomProperties;
@@ -268,6 +277,34 @@
assertEquals("2.x", pomInfo.get("debianVersion"));
}
+ public void testCleanMojoParentPom() throws Exception {
+ pomProperties = new File(testDir, "pom.properties");
+ usePom("mojo-parent.pom");
+ boolean noParent = false;
+ instance.addDefaultRules();
+ instance.addRule(new DependencyRule("junit junit jar s/3\\..*/3.x/ * *"));
+ instance.addRule(new DependencyRule("org.codehaus codehaus-parent pom s/.*/debian/ * *"));
+ instance.addRule(new DependencyRule("org.codehaus.mojo mojo-parent pom s/.*/debian/ * *"));
+ instance.addRule(new DependencyRule("org.apache.maven maven-plugin-api jar s/2\\..*/2.x/ * *"));
+ instance.addRule(new DependencyRule("org.apache.maven.doxia doxia-module-xhtml jar s/1\\..*/1.x/ * *"));
+ instance.addIgnoreRule(new DependencyRule("org.apache.maven.plugins maven-checkstyle-plugin * * * *"));
+ instance.addIgnoreRule(new DependencyRule("org.apache.maven.plugins maven-jxr-plugin * * * *"));
+ instance.addIgnoreRule(new DependencyRule("org.apache.maven.plugins maven-pmd-plugin * * * *"));
+ instance.addIgnoreRule(new DependencyRule("org.apache.maven.wagon wagon-webdav * * * *"));
+ instance.addIgnoreRule(new DependencyRule("org.codehaus.mojo cobertura-maven-plugin * * * *"));
+ instance.addElementToKeep("build");
+ instance.addElementToKeep("reporting");
+ instance.cleanPom(pom, updatedPom, pomProperties, noParent, true, false, false, null, "libmojo-parent-java");
+ assertXMLEqual(read("mojo-parent.cleaned"), read(updatedPom));
+ Properties pomInfo = new Properties();
+ pomInfo.load(new FileInputStream(pomProperties));
+ assertEquals("org.codehaus.mojo", pomInfo.get("groupId"));
+ assertEquals("mojo-parent", pomInfo.get("artifactId"));
+ assertEquals("pom", pomInfo.get("type"));
+ assertEquals("27", pomInfo.get("version"));
+ assertEquals("debian", pomInfo.get("debianVersion"));
+ }
+
public void testMain() throws Exception {
specialDependencies = new File(testDir, "special-cases.txt");
pomProperties = new File(testDir, "pom.properties");
Modified: trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/POMReaderTest.java
===================================================================
--- trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/POMReaderTest.java 2010-12-01 04:55:49 UTC (rev 13127)
+++ trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/POMReaderTest.java 2010-12-02 22:18:15 UTC (rev 13128)
@@ -1,15 +1,23 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
package org.debian.maven.repo;
import java.util.Iterator;
-/**
+/*
+ * Copyright 2009 Ludovic Claude.
*
- * @author ludo
+ * 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.
*/
+
public class POMReaderTest extends TestBase {
/**
@@ -264,4 +272,78 @@
assertEquals(0, info.getModules().size());
}
+ public void testReadMojoParent() throws Exception {
+ usePom("mojo-parent.pom");
+ POMReader instance = new POMReader();
+ POMInfo info = instance.readPom(pom);
+ assertNotNull(info.getParent());
+ assertEquals("org.codehaus", info.getParent().getGroupId());
+ assertEquals("codehaus-parent", info.getParent().getArtifactId());
+ assertEquals("3", info.getParent().getVersion());
+ assertEquals("pom", info.getParent().getType());
+
+ assertEquals("org.codehaus.mojo", info.getThisPom().getGroupId());
+ assertEquals("mojo-parent", info.getThisPom().getArtifactId());
+ assertEquals("27", info.getThisPom().getVersion());
+ assertEquals("pom", info.getThisPom().getType());
+
+ assertEquals(0, info.getDependencies().size());
+ assertEquals(2, info.getDependencyManagement().size());
+ Dependency dependency = (Dependency) info.getDependencyManagement().get(0);
+ assertEquals("org.apache.maven", dependency.getGroupId());
+ assertEquals("maven-plugin-api", dependency.getArtifactId());
+ assertEquals("2.0", dependency.getVersion());
+ assertEquals("jar", dependency.getType());
+
+ assertEquals(1, info.getExtensions().size());
+
+ assertEquals(24, info.getPluginManagement().size());
+ dependency = (Dependency) info.getPluginManagement().get(17);
+ assertEquals("org.apache.maven.plugins", dependency.getGroupId());
+ assertEquals("maven-site-plugin", dependency.getArtifactId());
+ assertEquals("2.1.1", dependency.getVersion());
+ assertEquals("maven-plugin", dependency.getType());
+ dependency = (Dependency) info.getPluginManagement().get(18);
+ assertEquals("org.apache.maven.plugins", dependency.getGroupId());
+ assertEquals("maven-source-plugin", dependency.getArtifactId());
+ assertEquals("2.1.2", dependency.getVersion());
+ assertEquals("maven-plugin", dependency.getType());
+
+ assertEquals(1, info.getPluginManagementDependencies().size());
+ dependency = (Dependency) info.getPluginManagementDependencies().get(0);
+ assertEquals("org.apache.maven.doxia", dependency.getGroupId());
+ assertEquals("doxia-module-xhtml", dependency.getArtifactId());
+ assertEquals("1.1.3", dependency.getVersion());
+ assertEquals("jar", dependency.getType());
+
+ assertEquals(2, info.getPlugins().size());
+ dependency = (Dependency) info.getPlugins().get(1);
+ assertEquals("org.codehaus.mojo", dependency.getGroupId());
+ assertEquals("cobertura-maven-plugin", dependency.getArtifactId());
+ assertEquals(null, dependency.getVersion());
+ assertEquals("maven-plugin", dependency.getType());
+
+ assertEquals(2, info.getReportingPlugins().size());
+ dependency = (Dependency) info.getReportingPlugins().get(1);
+ assertEquals("org.apache.maven.plugins", dependency.getGroupId());
+ assertEquals("maven-project-info-reports-plugin", dependency.getArtifactId());
+ assertEquals("2.2", dependency.getVersion());
+ assertEquals("maven-plugin", dependency.getType());
+
+ assertEquals(6, info.getProfilePlugins().size());
+ assertEquals(8, info.getProfileReportingPlugins().size());
+ assertEquals(1, info.getProfilePluginManagement().size());
+ assertEquals(0, info.getProfileDependencies().size());
+ assertEquals(0, info.getProfileDependencyManagement().size());
+
+ assertEquals(5, info.getProperties().size());
+ assertEquals("UTF-8", info.getProperties().get("project.build.sourceEncoding"));
+ assertEquals("UTF-8", info.getProperties().get("project.reporting.outputEncoding"));
+ assertEquals("1.4", info.getProperties().get("mojo.java.target"));
+ assertEquals("true", info.getProperties().get("surefire.redirectTestOutputToFile"));
+ assertEquals("true", info.getProperties().get("netbeans.checkstyle.format"));
+
+ assertEquals(0, info.getModules().size());
+ }
+
}
\ No newline at end of file
Modified: trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/POMTransformerTest.java
===================================================================
--- trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/POMTransformerTest.java 2010-12-01 04:55:49 UTC (rev 13127)
+++ trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/POMTransformerTest.java 2010-12-02 22:18:15 UTC (rev 13128)
@@ -1,15 +1,23 @@
+package org.debian.maven.repo;
+
/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
+ * Copyright 2009 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.
*/
-package org.debian.maven.repo;
import org.custommonkey.xmlunit.XMLUnit;
-/**
- *
- * @author ludo
- */
public class POMTransformerTest extends TestBase {
private POMTransformer instance;
@@ -92,8 +100,15 @@
instance.addRule(new DependencyRule("org.antlr antlr3-maven-plugin maven-plugin s/.*/3.2/"));
instance.addRule(new DependencyRule("org.antlr stringtemplate jar s/3\\..*/3.x/ *"));
instance.addIgnoreRule(new DependencyRule("org.codehaus.mojo findbugs-maven-plugin maven-plugin *"));
- instance.transformPom(pom, updatedPom, noParent, true, true, true, null, "libantlr3-java");
+ POMInfo transformedPOM = instance.transformPom(pom, updatedPom, noParent, true, true, true, null, "libantlr3-java");
assertXMLEqual(read("antlr3.transformed"), read(updatedPom));
+ assertEquals("3.2", transformedPOM.getParent().getVersion());
+ assertEquals(1, transformedPOM.getDependencies().size());
+ assertTrue(transformedPOM.getDependencies().contains(new Dependency("org.antlr", "stringtemplate", "jar", "3.x")));
+ assertEquals(1, transformedPOM.getExtensions().size());
+ assertTrue(transformedPOM.getExtensions().contains(new Dependency("org.apache.maven.wagon", "wagon-ssh-external", "jar", "debian")));
+ assertEquals(1, transformedPOM.getPlugins().size());
+ assertTrue(transformedPOM.getPlugins().contains(new Dependency("org.apache.maven.plugins", "maven-compiler-plugin", "maven-plugin", "2.0.2")));
}
public void testTransformAntlr3ParentPom() throws Exception {
@@ -175,7 +190,7 @@
instance.addRule(new DependencyRule("org.codehaus.plexus plexus pom s/2\\..*/2.x/ * *"));
instance.addIgnoreRule(new DependencyRule("org.apache.maven.plugins maven-release-plugin * *"));
- POMInfo transformedPOM = instance.transformPom(pom, updatedPom, noParent, true, true, true, null, "libplexus-utils2-java");
+ POMInfo transformedPOM = instance.transformPom(pom, updatedPom, noParent, true, true, false, null, "libplexus-utils2-java");
assertXMLEqual(read("plexus-utils2.transformed"), read(updatedPom));
assertEquals("2.x", transformedPOM.getParent().getVersion());
}
@@ -197,6 +212,19 @@
assertEquals("2.3", ((Dependency) transformedPom.getPluginManagement().get(2)).getVersion());
}
+ public void testTransformMavenPackagerUtilsPom() throws Exception {
+ usePom("maven-packager-utils.pom");
+ boolean noParent = false;
+
+ instance.addDefaultRules();
+ instance.addRule(new DependencyRule("junit junit jar s/3\\..*/3.x/"));
+ instance.addRule(new DependencyRule("org.codehaus.plexus plexus-container-default jar s/1\\.0-alpha-.*/1.0-alpha/"));
+
+ POMInfo transformedPOM = instance.transformPom(pom, updatedPom, noParent, true, true, true, null, "maven-repo-helper");
+ assertXMLEqual(read("maven-packager-utils.transformed"), read(updatedPom));
+ assertEquals("1.2", transformedPOM.getParent().getVersion());
+ }
+
private Repository getRepository() {
Repository repo = new Repository(getFileInClasspath("repository/root.dir").getParentFile());
repo.scan();
Modified: trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/RepositoryTest.java
===================================================================
--- trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/RepositoryTest.java 2010-12-01 04:55:49 UTC (rev 13127)
+++ trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/RepositoryTest.java 2010-12-02 22:18:15 UTC (rev 13128)
@@ -1,5 +1,22 @@
package org.debian.maven.repo;
+/*
+ * Copyright 2009 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 javax.xml.stream.XMLStreamException;
import java.io.File;
import java.io.IOException;
@@ -8,13 +25,6 @@
import java.util.Iterator;
import java.util.Map;
-/**
- * Created by IntelliJ IDEA.
- * User: ludo
- * Date: 5 juil. 2010
- * Time: 23:50:05
- * To change this template use File | Settings | File Templates.
- */
public class RepositoryTest extends TestBase {
public void testScan() throws Exception {
Modified: trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/RuleTest.java
===================================================================
--- trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/RuleTest.java 2010-12-01 04:55:49 UTC (rev 13127)
+++ trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/RuleTest.java 2010-12-02 22:18:15 UTC (rev 13128)
@@ -1,14 +1,21 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
package org.debian.maven.repo;
-/**
+/*
+ * Copyright 2009 Ludovic Claude.
*
- * @author ludo
+ * 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.
*/
+
public class RuleTest extends TestBase {
/**
Modified: trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/TestBase.java
===================================================================
--- trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/TestBase.java 2010-12-01 04:55:49 UTC (rev 13127)
+++ trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/TestBase.java 2010-12-02 22:18:15 UTC (rev 13128)
@@ -1,8 +1,20 @@
+package org.debian.maven.repo;
+
/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
+ * Copyright 2009 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.
*/
-package org.debian.maven.repo;
import java.io.File;
import java.io.FileNotFoundException;
@@ -23,10 +35,6 @@
import org.custommonkey.xmlunit.XMLTestCase;
import org.custommonkey.xmlunit.XMLUnit;
-/**
- *
- * @author ludo
- */
public class TestBase extends XMLTestCase {
protected static File testDir = new File("tmp");
Added: trunk/maven-repo-helper/src/test/resources/maven-packager-utils.pom
===================================================================
--- trunk/maven-repo-helper/src/test/resources/maven-packager-utils.pom (rev 0)
+++ trunk/maven-repo-helper/src/test/resources/maven-packager-utils.pom 2010-12-02 22:18:15 UTC (rev 13128)
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <artifactId>maven-debian</artifactId>
+ <groupId>org.debian.maven</groupId>
+ <version>1.2</version>
+ </parent>
+
+ <artifactId>maven-packager-utils</artifactId>
+ <packaging>maven-plugin</packaging>
+ <name>Maven Packager Utilities</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ <version>2.2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-artifact</artifactId>
+ <version>2.2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.2</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-project</artifactId>
+ <version>2.2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.velocity</groupId>
+ <artifactId>velocity</artifactId>
+ <version>1.6.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.debian.maven</groupId>
+ <artifactId>maven-repo-helper</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>1.4</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added: trunk/maven-repo-helper/src/test/resources/maven-packager-utils.transformed
===================================================================
--- trunk/maven-repo-helper/src/test/resources/maven-packager-utils.transformed (rev 0)
+++ trunk/maven-repo-helper/src/test/resources/maven-packager-utils.transformed 2010-12-02 22:18:15 UTC (rev 13128)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.debian.maven</groupId>
+ <artifactId>maven-packager-utils</artifactId>
+ <version>1.2</version>
+ <packaging>maven-plugin</packaging>
+ <parent>
+ <groupId>org.debian.maven</groupId>
+ <artifactId>maven-debian</artifactId>
+ <version>1.2</version>
+ </parent>
+ <properties>
+ <debian.hasPackageVersion/>
+ <debian.originalVersion>1.2</debian.originalVersion>
+ <debian.package>maven-repo-helper</debian.package>
+ </properties>
+
+ <name>Maven Packager Utilities</name>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ <version>debian</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-artifact</artifactId>
+ <version>debian</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.x</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-project</artifactId>
+ <version>debian</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.velocity</groupId>
+ <artifactId>velocity</artifactId>
+ <version>debian</version>
+ </dependency>
+ <dependency>
+ <groupId>org.debian.maven</groupId>
+ <artifactId>maven-repo-helper</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>debian</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
Added: trunk/maven-repo-helper/src/test/resources/mojo-parent.cleaned
===================================================================
--- trunk/maven-repo-helper/src/test/resources/mojo-parent.cleaned (rev 0)
+++ trunk/maven-repo-helper/src/test/resources/mojo-parent.cleaned 2010-12-02 22:18:15 UTC (rev 13128)
@@ -0,0 +1,303 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE
+ file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
+ to you 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.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>mojo-parent</artifactId>
+ <version>debian</version>
+ <packaging>pom</packaging>
+ <parent>
+ <groupId>org.codehaus</groupId>
+ <artifactId>codehaus-parent</artifactId>
+ <version>debian</version>
+ </parent>
+
+ <name>Codehaus Mojo Parent</name>
+ <url>http://mojo.codehaus.org</url>
+ <organization>
+ <name>Codehaus</name>
+ <url>http://codehaus.org</url>
+ </organization>
+ <mailingLists>
+ <mailingList>
+ <name>Development List</name>
+ <subscribe>dev-subscribe at mojo.codehaus.org</subscribe>
+ <unsubscribe>dev-unsubscribe at mojo.codehaus.org</unsubscribe>
+ <post>dev at mojo.codehaus.org</post>
+ <archive>http://archive.codehaus.org/lists/org.codehaus.mojo.dev</archive>
+ <otherArchives>
+ <otherArchive>http://www.nabble.com/mojo---dev-f11981.html</otherArchive>
+ <otherArchive>http://markmail.org/list/org.codehaus.mojo.dev</otherArchive>
+ </otherArchives>
+ </mailingList>
+ <mailingList>
+ <name>User List</name>
+ <subscribe>user-subscribe at mojo.codehaus.org</subscribe>
+ <unsubscribe>user-unsubscribe at mojo.codehaus.org</unsubscribe>
+ <post>user at mojo.codehaus.org</post>
+ <archive>http://archive.codehaus.org/lists/org.codehaus.mojo.user</archive>
+ <otherArchives>
+ <otherArchive>http://www.nabble.com/mojo---user-f11980.html</otherArchive>
+ <otherArchive>http://markmail.org/list/org.codehaus.mojo.user</otherArchive>
+ </otherArchives>
+ </mailingList>
+ <mailingList>
+ <name>Commits List</name>
+ <subscribe>scm-subscribe at mojo.codehaus.org</subscribe>
+ <unsubscribe>scm-unsubscribe at mojo.codehaus.org</unsubscribe>
+ <archive>http://archive.codehaus.org/lists/org.codehaus.mojo.scm</archive>
+ <otherArchives>
+ <otherArchive>http://markmail.org/list/org.codehaus.mojo.scm</otherArchive>
+ </otherArchives>
+ </mailingList>
+ </mailingLists>
+ <scm>
+ <connection>scm:svn:http://svn.codehaus.org/mojo/tags/mojo-parent-27</connection>
+ <developerConnection>scm:svn:https://svn.codehaus.org/mojo/tags/mojo-parent-27</developerConnection>
+ <url>http://fisheye.codehaus.org/browse/mojo/tags/mojo-parent-27</url>
+ </scm>
+ <issueManagement>
+ <system>jira</system>
+ <url>http://jira.codehaus.org/browse/MOJO</url>
+ </issueManagement>
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <mojo.java.target>1.4</mojo.java.target>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+ <!-- NOTE: We deliberately do not set maven.test.redirectTestOutputToFile here to workaround MNG-1992 -->
+ <surefire.redirectTestOutputToFile>true</surefire.redirectTestOutputToFile>
+ <!-- this property makes sure NetBeans 6.8+ picks up some formatting rules from checkstyle -->
+ <netbeans.checkstyle.format>true</netbeans.checkstyle.format>
+ <debian.hasPackageVersion/>
+ <debian.mavenRules>org.codehaus.mojo mojo-parent pom s/.*/debian/ * *</debian.mavenRules>
+ <debian.originalVersion>27</debian.originalVersion>
+ <debian.package>libmojo-parent-java</debian.package>
+ </properties>
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ <version>2.x</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.x</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+ <build>
+ <extensions>
+ </extensions>
+ <pluginManagement>
+ <plugins>
+ <!-- Apache plugins in alphabetical order -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clean-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <encoding>${project.build.sourceEncoding}</encoding>
+ <source>${mojo.java.target}</source>
+ <target>${mojo.java.target}</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-install-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-invoker-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-plugin-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>help-mojo</id>
+ <goals>
+ <goal>helpmojo</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-project-info-reports-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+ <configuration>
+ <tagBase>https://svn.codehaus.org/mojo/tags</tagBase>
+ <useReleaseProfile>false</useReleaseProfile>
+ <arguments>-Pmojo-release</arguments>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <!-- workaround for MSITE-459 -->
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.doxia</groupId>
+ <artifactId>doxia-module-xhtml</artifactId>
+ <version>1.x</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.apache.maven.doxia</groupId>
+ <artifactId>doxia-module-xhtml</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <redirectTestOutputToFile>${surefire.redirectTestOutputToFile}</redirectTestOutputToFile>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ </plugin>
+ <!-- Codehaus plugins in alphabetical order -->
+ <plugin>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>taglist-maven-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>mojo-enforcer-rules</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <bannedDependencies>
+ <excludes>
+ <exclude>org.codehaus.plexus:plexus-component-api</exclude>
+ </excludes>
+ <message>The plexus-component-api conflicts with the plexus-container-default used by Maven. You probably added a dependency that is missing the exclusions.</message>
+ </bannedDependencies>
+ <requireNoRepositories>
+ <message>Mojo is synchronized with repo1.maven.org. The rules for repo1.maven.org are that pom.xml files should not include repository definitions. If repository definitions are included, they must be limited to SNAPSHOT only repositories.</message>
+ <banRepositories>true</banRepositories>
+ <banPluginRepositories>true</banPluginRepositories>
+ <!-- allow the codehaus and apache snapshot repos -->
+ <allowedRepositories>
+ <allowedRepository>codehaus.org</allowedRepository>
+ <allowedRepository>apache.snapshots</allowedRepository>
+ <allowedRepository>codehaus-snapshots</allowedRepository>
+ </allowedRepositories>
+ <allowedPluginRepositories>
+ <allowedPluginRepository>codehaus.org</allowedPluginRepository>
+ <allowedPluginRepository>apache.snapshots</allowedPluginRepository>
+ </allowedPluginRepositories>
+ </requireNoRepositories>
+ <requirePluginVersions>
+ <message>Best Practice is to always define plugin versions!</message>
+ <banLatest>true</banLatest>
+ <banRelease>true</banRelease>
+ </requirePluginVersions>
+ </rules>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ <reporting>
+ <plugins>
+ <!-- Apache plugins in alphabetical order -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-plugin-plugin</artifactId>
+ <configuration>
+ <requirements>
+ <!--
+ NOTE: Maven 2.x does not interpolate properties of the form project.*|pom.* so the Maven Plugin Plugin
+ gets garbage when manually examining the config of the Maven Compiler Plugin.
+ -->
+ <jdk>${mojo.java.target}</jdk>
+ </requirements>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-project-info-reports-plugin</artifactId>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>cim</report>
+ <report>index</report>
+ <report>issue-tracking</report>
+ <report>mailing-list</report>
+ <report>project-team</report>
+ <report>scm</report>
+ <report>summary</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+ </plugins>
+ </reporting>
+</project>
Added: trunk/maven-repo-helper/src/test/resources/mojo-parent.pom
===================================================================
--- trunk/maven-repo-helper/src/test/resources/mojo-parent.pom (rev 0)
+++ trunk/maven-repo-helper/src/test/resources/mojo-parent.pom 2010-12-02 22:18:15 UTC (rev 13128)
@@ -0,0 +1,683 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+ <!--
+ Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE
+ file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file
+ to you 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.
+ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.codehaus</groupId>
+ <artifactId>codehaus-parent</artifactId>
+ <version>3</version>
+ </parent>
+
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>mojo-parent</artifactId>
+ <version>27</version>
+ <packaging>pom</packaging>
+
+ <name>Codehaus Mojo Parent</name>
+ <url>http://mojo.codehaus.org</url>
+ <organization>
+ <name>Codehaus</name>
+ <url>http://codehaus.org</url>
+ </organization>
+
+ <mailingLists>
+ <mailingList>
+ <name>Development List</name>
+ <subscribe>dev-subscribe at mojo.codehaus.org</subscribe>
+ <unsubscribe>dev-unsubscribe at mojo.codehaus.org</unsubscribe>
+ <post>dev at mojo.codehaus.org</post>
+ <archive>http://archive.codehaus.org/lists/org.codehaus.mojo.dev</archive>
+ <otherArchives>
+ <otherArchive>http://www.nabble.com/mojo---dev-f11981.html</otherArchive>
+ <otherArchive>http://markmail.org/list/org.codehaus.mojo.dev</otherArchive>
+ </otherArchives>
+ </mailingList>
+ <mailingList>
+ <name>User List</name>
+ <subscribe>user-subscribe at mojo.codehaus.org</subscribe>
+ <unsubscribe>user-unsubscribe at mojo.codehaus.org</unsubscribe>
+ <post>user at mojo.codehaus.org</post>
+ <archive>http://archive.codehaus.org/lists/org.codehaus.mojo.user</archive>
+ <otherArchives>
+ <otherArchive>http://www.nabble.com/mojo---user-f11980.html</otherArchive>
+ <otherArchive>http://markmail.org/list/org.codehaus.mojo.user</otherArchive>
+ </otherArchives>
+ </mailingList>
+ <mailingList>
+ <name>Commits List</name>
+ <subscribe>scm-subscribe at mojo.codehaus.org</subscribe>
+ <unsubscribe>scm-unsubscribe at mojo.codehaus.org</unsubscribe>
+ <archive>http://archive.codehaus.org/lists/org.codehaus.mojo.scm</archive>
+ <otherArchives>
+ <otherArchive>http://markmail.org/list/org.codehaus.mojo.scm</otherArchive>
+ </otherArchives>
+ </mailingList>
+ </mailingLists>
+
+ <scm>
+ <connection>scm:svn:http://svn.codehaus.org/mojo/tags/mojo-parent-27</connection>
+ <developerConnection>scm:svn:https://svn.codehaus.org/mojo/tags/mojo-parent-27</developerConnection>
+ <url>http://fisheye.codehaus.org/browse/mojo/tags/mojo-parent-27</url>
+ </scm>
+ <issueManagement>
+ <system>jira</system>
+ <url>http://jira.codehaus.org/browse/MOJO</url>
+ </issueManagement>
+ <ciManagement>
+ <system>hudson</system>
+ <url>https://grid.sonatype.org/ci/job/mojo/</url>
+ </ciManagement>
+ <distributionManagement>
+ <site>
+ <id>codehaus.org</id>
+ <name>Mojo Website</name>
+ <url>dav:https://dav.codehaus.org/mojo/</url>
+ </site>
+ </distributionManagement>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <mojo.java.target>1.4</mojo.java.target>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+ <!-- NOTE: We deliberately do not set maven.test.redirectTestOutputToFile here to workaround MNG-1992 -->
+ <surefire.redirectTestOutputToFile>true</surefire.redirectTestOutputToFile>
+ <!-- this property makes sure NetBeans 6.8+ picks up some formatting rules from checkstyle -->
+ <netbeans.checkstyle.format>true</netbeans.checkstyle.format>
+ </properties>
+
+ <dependencyManagement>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-plugin-api</artifactId>
+ <version>2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.2</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ </dependencyManagement>
+
+ <repositories>
+ <repository>
+ <id>codehaus.org</id>
+ <name>Maven Central Development Repository</name>
+ <url>http://snapshots.repository.codehaus.org</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ </repository>
+ </repositories>
+
+ <pluginRepositories>
+ <pluginRepository>
+ <id>codehaus.org</id>
+ <name>Maven Central Development Plugin Repository</name>
+ <url>http://snapshots.repository.codehaus.org</url>
+ <releases>
+ <enabled>false</enabled>
+ </releases>
+ </pluginRepository>
+ </pluginRepositories>
+
+ <build>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.wagon</groupId>
+ <artifactId>wagon-webdav</artifactId>
+ <version>1.0-beta-2</version>
+ </extension>
+ </extensions>
+
+ <pluginManagement>
+ <plugins>
+ <!-- Apache plugins in alphabetical order -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <version>1.3</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <version>2.2-beta-5</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <version>2.5</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-clean-plugin</artifactId>
+ <version>2.4.1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.3.2</version>
+ <configuration>
+ <encoding>${project.build.sourceEncoding}</encoding>
+ <source>${mojo.java.target}</source>
+ <target>${mojo.java.target}</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <version>2.5</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>1.0-beta-1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-install-plugin</artifactId>
+ <version>2.3.1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-invoker-plugin</artifactId>
+ <version>1.5</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <version>2.3.1</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.7</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jxr-plugin</artifactId>
+ <version>2.2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-plugin-plugin</artifactId>
+ <version>2.6</version>
+ <executions>
+ <execution>
+ <id>help-mojo</id>
+ <goals>
+ <goal>helpmojo</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-pmd-plugin</artifactId>
+ <version>2.5</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-project-info-reports-plugin</artifactId>
+ <version>2.2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+ <version>2.0</version>
+ <configuration>
+ <tagBase>https://svn.codehaus.org/mojo/tags</tagBase>
+ <useReleaseProfile>false</useReleaseProfile>
+ <arguments>-Pmojo-release</arguments>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <version>2.4.3</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>2.1.1</version>
+ <!-- workaround for MSITE-459 -->
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.doxia</groupId>
+ <artifactId>doxia-module-xhtml</artifactId>
+ <version>1.1.3</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <version>2.1.2</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.6</version>
+ <configuration>
+ <redirectTestOutputToFile>${surefire.redirectTestOutputToFile}</redirectTestOutputToFile>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ <version>2.6</version>
+ </plugin>
+ <!-- Codehaus plugins in alphabetical order -->
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>cobertura-maven-plugin</artifactId>
+ <version>2.4</version>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-maven-plugin</artifactId>
+ <version>1.3.8</version>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>taglist-maven-plugin</artifactId>
+ <version>2.4</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+
+ <plugins>
+ <plugin>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>mojo-enforcer-rules</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <bannedDependencies>
+ <excludes>
+ <exclude>org.codehaus.plexus:plexus-component-api</exclude>
+ </excludes>
+ <message>The plexus-component-api conflicts with the plexus-container-default used by Maven. You probably added a dependency that is missing the exclusions.</message>
+ </bannedDependencies>
+ <requireNoRepositories>
+ <message>Mojo is synchronized with repo1.maven.org. The rules for repo1.maven.org are that pom.xml files should not include repository definitions. If repository definitions are included, they must be limited to SNAPSHOT only repositories.</message>
+ <banRepositories>true</banRepositories>
+ <banPluginRepositories>true</banPluginRepositories>
+ <!-- allow the codehaus and apache snapshot repos -->
+ <allowedRepositories>
+ <allowedRepository>codehaus.org</allowedRepository>
+ <allowedRepository>apache.snapshots</allowedRepository>
+ <allowedRepository>codehaus-snapshots</allowedRepository>
+ </allowedRepositories>
+ <allowedPluginRepositories>
+ <allowedPluginRepository>codehaus.org</allowedPluginRepository>
+ <allowedPluginRepository>apache.snapshots</allowedPluginRepository>
+ </allowedPluginRepositories>
+ </requireNoRepositories>
+ <requirePluginVersions>
+ <message>Best Practice is to always define plugin versions!</message>
+ <banLatest>true</banLatest>
+ <banRelease>true</banRelease>
+ </requirePluginVersions>
+ </rules>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>cobertura-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>clean</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ <reporting>
+ <plugins>
+ <!-- Apache plugins in alphabetical order -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-plugin-plugin</artifactId>
+ <version>2.6</version>
+ <configuration>
+ <requirements>
+ <!--
+ NOTE: Maven 2.x does not interpolate properties of the form project.*|pom.* so the Maven Plugin Plugin
+ gets garbage when manually examining the config of the Maven Compiler Plugin.
+ -->
+ <jdk>${mojo.java.target}</jdk>
+ </requirements>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-project-info-reports-plugin</artifactId>
+ <version>2.2</version>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>cim</report>
+ <report>index</report>
+ <report>issue-tracking</report>
+ <report>mailing-list</report>
+ <report>project-team</report>
+ <report>scm</report>
+ <report>summary</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+ </plugins>
+ </reporting>
+
+ <profiles>
+ <profile>
+ <id>mojo-release</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.apache.resources</groupId>
+ <artifactId>apache-source-release-assembly-descriptor</artifactId>
+ <version>1.0.2</version>
+ </dependency>
+ <dependency>
+ <!-- NOTE: The fix for PLXUTILS-120 is crucial for the new assembly descriptor -->
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-utils</artifactId>
+ <version>2.0.1</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <id>attach-source-release-distro</id>
+ <phase>package</phase>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <configuration>
+ <runOnlyAtExecutionRoot>true</runOnlyAtExecutionRoot>
+ <descriptorRefs>
+ <descriptorRef>source-release</descriptorRef>
+ </descriptorRefs>
+ <tarLongFileFormat>gnu</tarLongFileFormat>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <configuration>
+ <updateReleaseInfo>true</updateReleaseInfo>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-source-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-sources</id>
+ <goals>
+ <goal>jar-no-fork</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-javadocs</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-gpg-plugin</artifactId>
+ <version>1.1</version>
+ <executions>
+ <execution>
+ <id>sign-artifacts</id>
+ <phase>verify</phase>
+ <goals>
+ <goal>sign</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>reporting</id>
+ <activation>
+ <property>
+ <name>skipReports</name>
+ <value>!true</value>
+ </property>
+ </activation>
+ <reporting>
+ <plugins>
+ <!-- Apache plugins in alphabetical order -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-checkstyle-plugin</artifactId>
+ <version>2.5</version>
+ <configuration>
+ <configLocation>config/maven_checks.xml</configLocation>
+ <headerLocation>config/maven-header.txt</headerLocation>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-javadoc-plugin</artifactId>
+ <version>2.7</version>
+ <configuration>
+ <quiet>true</quiet>
+ <links>
+ <link>http://download-llnw.oracle.com/javaee/1.4/api/</link>
+ <link>http://download-llnw.oracle.com/javase/1.5.0/docs/api/</link>
+ <link>http://commons.apache.org/collections/apidocs-COLLECTIONS_3_0/</link>
+ <link>http://commons.apache.org/dbcp/apidocs/</link>
+ <link>http://commons.apache.org/fileupload/apidocs/</link>
+ <link>http://commons.apache.org/httpclient/apidocs/</link>
+ <link>http://commons.apache.org/logging/apidocs/</link>
+ <link>http://commons.apache.org/pool/apidocs/</link>
+ <link>http://junit.sourceforge.net/javadoc/</link>
+ <link>http://logging.apache.org/log4j/1.2/apidocs/</link>
+ <link>http://jakarta.apache.org/regexp/apidocs/</link>
+ <link>http://velocity.apache.org/engine/releases/velocity-1.5/apidocs/</link>
+ <link>http://maven.apache.org/ref/current/maven-artifact/apidocs/</link>
+ <link>http://maven.apache.org/ref/current/maven-artifact-manager/apidocs/</link>
+ <link>http://maven.apache.org/ref/current/maven-model/apidocs/</link>
+ <link>http://maven.apache.org/ref/current/maven-plugin-api/apidocs/</link>
+ <link>http://maven.apache.org/ref/current/maven-project/apidocs/</link>
+ <link>http://maven.apache.org/ref/current/maven-reporting/maven-reporting-api/apidocs/</link>
+ <link>http://maven.apache.org/ref/current/maven-settings/apidocs/</link>
+ </links>
+ <tagletArtifacts>
+ <tagletArtifact>
+ <groupId>org.apache.maven.plugin-tools</groupId>
+ <artifactId>maven-plugin-tools-javadoc</artifactId>
+ <version>2.4.2</version>
+ </tagletArtifact>
+ <tagletArtifact>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-component-javadoc</artifactId>
+ <version>1.5.4</version>
+ </tagletArtifact>
+ </tagletArtifacts>
+ </configuration>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>javadoc</report>
+ <report>test-javadoc</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jxr-plugin</artifactId>
+ <version>2.2</version>
+ <configuration>
+ <inputEncoding>${project.build.sourceEncoding}</inputEncoding>
+ <outputEncoding>${project.reporting.outputEncoding}</outputEncoding>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-pmd-plugin</artifactId>
+ <version>2.5</version>
+ <configuration>
+ <targetJdk>${mojo.java.target}</targetJdk>
+ <rulesets>
+ <ruleset>http://svn.codehaus.org/mojo/tags/mojo-parent-22/src/main/config/pmd/mojo_rules.xml</ruleset>
+ </rulesets>
+ <excludeRoots>
+ <excludeRoot>${project.build.directory}/generated-sources/antlr</excludeRoot>
+ <excludeRoot>${project.build.directory}/generated-sources/javacc</excludeRoot>
+ <excludeRoot>${project.build.directory}/generated-sources/modello</excludeRoot>
+ <excludeRoot>${project.build.directory}/generated-sources/plugin</excludeRoot>
+ </excludeRoots>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-project-info-reports-plugin</artifactId>
+ <version>2.2</version>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>cim</report>
+ <report>dependencies</report>
+ <report>dependency-convergence</report>
+ <report>dependency-management</report>
+ <report>index</report>
+ <report>issue-tracking</report>
+ <report>license</report>
+ <report>mailing-list</report>
+ <report>plugin-management</report>
+ <report>project-team</report>
+ <report>scm</report>
+ <report>summary</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-report-plugin</artifactId>
+ <version>2.6</version>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>report</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+ <!-- Codehaus plugins in alphabetical order -->
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>cobertura-maven-plugin</artifactId>
+ <version>2.4</version>
+ <configuration>
+ <instrumentation>
+ <excludes>
+ <exclude>**/HelpMojo.class</exclude>
+ </excludes>
+ </instrumentation>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>taglist-maven-plugin</artifactId>
+ <version>2.4</version>
+ </plugin>
+ </plugins>
+ </reporting>
+ </profile>
+ <profile>
+ <id>maven-3</id>
+ <activation>
+ <file>
+ <!-- This employs that the basedir expression is only recognized by Maven 3.x (see MNG-2363) -->
+ <exists>${basedir}</exists>
+ </file>
+ </activation>
+ <properties>
+ <sitePluginVersion>3.0-beta-2</sitePluginVersion>
+ </properties>
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>${sitePluginVersion}</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <!-- if releasing current pom with maven 3 site descriptor must be attached -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>${sitePluginVersion}</version>
+ <inherited>false</inherited>
+ <executions>
+ <execution>
+ <id>attach-descriptor</id>
+ <goals>
+ <goal>attach-descriptor</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+
+ </profile>
+ </profiles>
+</project>
+
\ No newline at end of file
More information about the pkg-java-commits
mailing list