[pkg-java] r13057 - in trunk/maven-repo-helper/src: main/java/org/debian/maven/repo test/java/org/debian/maven/repo test/resources

Ludovic Claude ludovicc-guest at alioth.debian.org
Wed Nov 3 22:17:14 UTC 2010


Author: ludovicc-guest
Date: 2010-11-03 22:17:05 +0000 (Wed, 03 Nov 2010)
New Revision: 13057

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/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/POMTransformer.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/POMTransformerTest.java
   trunk/maven-repo-helper/src/test/resources/antlr3-tools.transformed
   trunk/maven-repo-helper/src/test/resources/antlr3.transformed
Log:
* release version 1.4



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-11-02 03:57:47 UTC (rev 13056)
+++ trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/DependencyRuleSet.java	2010-11-03 22:17:05 UTC (rev 13057)
@@ -15,6 +15,7 @@
     private File rulesFile;
     private Set rules;
     private boolean verbose;
+    private boolean warnRulesFileNotFound = true;
     private String name;
     private String description;
 
@@ -56,6 +57,22 @@
         this.description = description;
     }
 
+    public boolean isVerbose() {
+        return verbose;
+    }
+
+    public void setVerbose(boolean verbose) {
+        this.verbose = verbose;
+    }
+
+    public boolean isWarnRulesFileNotFound() {
+        return warnRulesFileNotFound;
+    }
+
+    public void setWarnRulesFileNotFound(boolean warnRulesFileNotFound) {
+        this.warnRulesFileNotFound = warnRulesFileNotFound;
+    }
+
     public Iterator iterator() {
         return getRules().iterator();
     }
@@ -97,15 +114,6 @@
         return matchingRules;
     }
 
-
-    public boolean isVerbose() {
-        return verbose;
-    }
-
-    public void setVerbose(boolean verbose) {
-        this.verbose = verbose;
-    }
-
     public void save() {
         try {
             PrintWriter out = new PrintWriter(new FileWriter(getRulesFile()));
@@ -128,8 +136,12 @@
             return;
         }
         if (!rulesFile.exists()) {
-            if (verbose) {
-                System.out.println("Rules file does not exist: " + rulesFile.getAbsolutePath());
+            if (verbose && warnRulesFileNotFound) {
+                String descr = description;
+                if (description == null || description.isEmpty()) {
+                    descr = "Rules";
+                }
+                System.out.println(descr + " file does not exist: " + rulesFile.getAbsolutePath());
             }
             return;
         }

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-11-02 03:57:47 UTC (rev 13056)
+++ trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/ListOfPOMs.java	2010-11-03 22:17:05 UTC (rev 13057)
@@ -135,6 +135,13 @@
         return options;
     }
 
+    public boolean contains(File pomFile) {
+        if (pomFile.getAbsolutePath().startsWith(baseDir.getAbsolutePath())) {
+            return getPOMOptions(pomFile) != null;
+        }
+        return false;
+    }
+
     private void readPomsFile() {
         if (pomList == null) {
             pomList = new ArrayList();

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-11-02 03:57:47 UTC (rev 13056)
+++ trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/POMCleaner.java	2010-11-03 22:17:05 UTC (rev 13057)
@@ -44,7 +44,7 @@
 
     public void cleanPom(File originalPom, File targetPom, File pomProperties,
             boolean noParent, boolean hasPackageVersion, boolean keepPomVersion,
-            String setVersion, String debianPackage) {
+            boolean keepParentVersion, String setVersion, String debianPackage) {
 
         if (targetPom.getParentFile() != null) {
             targetPom.getParentFile().mkdirs();
@@ -54,7 +54,7 @@
         }
 
         try {
-            POMInfo info = transformPom(originalPom, targetPom, noParent, hasPackageVersion, keepPomVersion, setVersion, debianPackage);
+            POMInfo info = transformPom(originalPom, targetPom, noParent, hasPackageVersion, keepPomVersion, keepParentVersion, setVersion, debianPackage);
 
             Properties pomProps = new Properties();
             pomProps.put("groupId", info.getThisPom().getGroupId());
@@ -159,8 +159,10 @@
             System.out.println("    a POM's own attributes in debian.mavenRules");
             System.out.println("  -e<version>, --set-version=<version>: set the version for the POM,");
             System.out.println("    do not use the version declared in the POM file.");
-            System.out.println("  --keep-pom-version: keep the original version of the POM but, ");
+            System.out.println("  --keep-pom-version: keep the original version of the POM but");
             System.out.println("    convert all other versions in dependencies and plugins");
+            System.out.println("  --keep-parent-version: keep the version of the parent in the POM but");
+            System.out.println("    convert all other versions in dependencies and plugins");
             System.out.println("  --keep-all-elements: keep all elements in the POM, do a version");
             System.out.println("    transformation only, don't delete the build and other elements.");
             System.out.println("  --keep-elements=<elem1,elem2>: keep the elements listed here");
@@ -240,6 +242,7 @@
         boolean noRules = false;
         boolean hasPackageVersion = false;
         boolean keepPomVersion = false;
+        boolean keepParentVersion = false;
         boolean keepAllElements = false;
         String debianPackage = "";
         String setVersion = null;
@@ -264,6 +267,8 @@
                 hasPackageVersion = true;
             } else if ("--keep-pom-version".equals(arg)) {
                 keepPomVersion = true;
+            } else if ("--keep-parent-version".equals(arg)) {
+                keepParentVersion = true;
             } else if ("--keep-all-elements".equals(arg)) {
                 keepAllElements = true;
             } else if (arg.startsWith("--keep-elements=")) {
@@ -370,7 +375,7 @@
 
         cleaner.setKeepAllElements(keepAllElements);
         cleaner.cleanPom(originalPom, targetPom, pomProperties, noParent, hasPackageVersion,
-                keepPomVersion, setVersion, debianPackage);
+                keepPomVersion, keepParentVersion, setVersion, debianPackage);
     }
 
     private static int inc(int i, String[] args) {

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-11-02 03:57:47 UTC (rev 13056)
+++ trunk/maven-repo-helper/src/main/java/org/debian/maven/repo/POMTransformer.java	2010-11-03 22:17:05 UTC (rev 13057)
@@ -183,13 +183,26 @@
         addRule(new DependencyRule(pom.getGroupId() + " " + pom.getArtifactId() + " " + pom.getType() + " " + pom.getVersion()));
     }
 
+    public boolean keepParentVersion(File pomFile, boolean noParent, boolean keepPomVersion) throws Exception {
+        boolean keepParentVersion = !noParent && keepPomVersion;
+        if (keepParentVersion && repository != null) {
+            POMInfo pom = readPom(pomFile);
+            if (pom.getThisPom().getType().equals("pom") && pom.getParent() != null) {
+                keepParentVersion = listOfPOMs.contains(pomFile) ||
+                        repository.searchMatchingPOM(pom.getParent()) == null;
+            }
+        }
+        return keepParentVersion;
+    }
+
     public void transformPoms(final String debianPackage, final boolean keepPomVersion,
             final String setVersion) {
         listOfPOMs.foreachPoms(new POMHandler() {
 
             public void handlePOM(File pomFile, boolean noParent, boolean hasPackageVersion) throws Exception {
                 File targetFile = new File(pomFile.getAbsolutePath() + ".new");
-                transformPom(pomFile, targetFile, noParent, hasPackageVersion, keepPomVersion, setVersion, debianPackage);
+                boolean keepParentVersion = keepParentVersion(pomFile, noParent, keepPomVersion);
+                transformPom(pomFile, targetFile, noParent, hasPackageVersion, keepPomVersion, keepParentVersion, setVersion, debianPackage);
                 pomFile.delete();
                 targetFile.renameTo(pomFile);
             }
@@ -200,16 +213,16 @@
     }
 
     public POMInfo transformPom(File originalPom, File targetPom) throws XMLStreamException, IOException {
-        return transformPom(originalPom, targetPom, false, false, false, null, null);
+        return transformPom(originalPom, targetPom, false, false, false, false, null, null);
     }
 
     public POMInfo transformPom(File originalPom, File targetPom,
-            boolean noParent, boolean hasPackageVersion, boolean keepPomVersion, String setVersion, String debianPackage) throws XMLStreamException, IOException {
-        return transformPom(originalPom, targetPom, noParent, hasPackageVersion, keepPomVersion, setVersion, debianPackage, false);
+            boolean noParent, boolean hasPackageVersion, boolean keepPomVersion, boolean keepParentVersion, String setVersion, String debianPackage) throws XMLStreamException, IOException {
+        return transformPom(originalPom, targetPom, noParent, hasPackageVersion, keepPomVersion, keepParentVersion, setVersion, debianPackage, false);
     }
 
     public POMInfo transformPom(File originalPom, File targetPom,
-            boolean noParent, boolean hasPackageVersion, boolean keepPomVersion, String setVersion, String debianPackage,
+            boolean noParent, boolean hasPackageVersion, boolean keepPomVersion, boolean keepParentVersion, String setVersion, String debianPackage,
             boolean ignoreRegisterErrors) throws XMLStreamException, IOException {
 
         if (targetPom.getParentFile() != null) {
@@ -226,6 +239,12 @@
                 original.getThisPom().setVersion(setVersion);
             }
 
+            if (keepParentVersion && original.getParent() != null) {
+                // Add a rule to also keep the parent version
+                automaticRules.add(new DependencyRule(original.getParent().getGroupId() + " "
+                    + original.getParent().getArtifactId() + " * * * *"));
+            }
+            /*
             if (original.getParent() != null && !noParent) {
                 if (repository == null && keepPomVersion) {
                     // Add a rule to also keep the parent version
@@ -246,7 +265,7 @@
                         }
                     }
                 }
-            }
+            } */
 
             transformingPom(original);
 
@@ -256,6 +275,9 @@
             if (hasPackageVersion) {
                 info.getProperties().put("debian.hasPackageVersion", "true");
             }
+            if (noParent) {
+                info.setParent(null);
+            }
 
             if (repository != null) {
                 try {

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-11-02 03:57:47 UTC (rev 13056)
+++ trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/POMCleanerTest.java	2010-11-03 22:17:05 UTC (rev 13057)
@@ -45,7 +45,7 @@
         boolean noParent = true;
         instance.addDefaultRules();
         instance.addRule(new DependencyRule("org.codehaus.plexus plexus-container-default jar s/1\\.0-alpha-.*/1.0-alpha/"));
-        instance.cleanPom(pom, updatedPom, pomProperties, noParent, true, false, null, "maven2");
+        instance.cleanPom(pom, updatedPom, pomProperties, noParent, true, false, false, null, "maven2");
         assertXMLEqual(read("maven.cleaned"), read(updatedPom));
         Properties pomInfo = new Properties();
         pomInfo.load(new FileInputStream(pomProperties));
@@ -61,7 +61,7 @@
         usePom("modello-core.xml");
         boolean noParent = false;
         instance.addDefaultRules();
-        instance.cleanPom(pom, updatedPom, pomProperties, noParent, true, false, null, "libmodello-java");
+        instance.cleanPom(pom, updatedPom, pomProperties, noParent, true, false, false, null, "libmodello-java");
         assertXMLEqual(read("modello-core.cleaned"), read(updatedPom));
         Properties pomInfo = new Properties();
         pomInfo.load(new FileInputStream(pomProperties));
@@ -71,7 +71,7 @@
         assertEquals("1.0-alpha-22", pomInfo.get("version"));
         assertEquals("debian", pomInfo.get("debianVersion"));
 
-        instance.cleanPom(pom, updatedPom, pomProperties, noParent, false, true, null, "libmodello-java");
+        instance.cleanPom(pom, updatedPom, pomProperties, noParent, false, true, true, null, "libmodello-java");
         assertXMLEqual(read("modello-core.keep.cleaned"), read(updatedPom));
         pomInfo = new Properties();
         pomInfo.load(new FileInputStream(pomProperties));
@@ -88,7 +88,7 @@
         usePom("wagon-http-lightweight.xml");
         boolean noParent = false;
         instance.addDefaultRules();
-        instance.cleanPom(pom, updatedPom, pomProperties, noParent, true, false, null, "libwagon-java");
+        instance.cleanPom(pom, updatedPom, pomProperties, noParent, true, false, false, null, "libwagon-java");
         assertXMLEqual(read("wagon-http-lightweight.cleaned"), read(updatedPom));
         Properties pomInfo = new Properties();
         pomInfo.load(new FileInputStream(pomProperties));
@@ -105,7 +105,7 @@
         boolean noParent = true;
         instance.addDefaultRules();
         instance.addRule(new DependencyRule("org.codehaus.plexus plexus-container-default jar s/1\\.0-alpha-.*/1.0-alpha/"));
-        instance.cleanPom(pom, updatedPom, pomProperties, noParent, true, false, null, "libplexus-container-default-java");
+        instance.cleanPom(pom, updatedPom, pomProperties, noParent, true, false, false, null, "libplexus-container-default-java");
         assertXMLEqual(read("plexus-container-default.cleaned"), read(updatedPom));
         Properties pomInfo = new Properties();
         pomInfo.load(new FileInputStream(pomProperties));
@@ -124,7 +124,7 @@
         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/"));
         instance.addRule(new DependencyRule("org.codehaus.plexus plexus-maven-plugin maven-plugin s/.*/1.3.8/"));
-        instance.cleanPom(pom, updatedPom, pomProperties, noParent, true, false, null, "libplexus-active-collections-java");
+        instance.cleanPom(pom, updatedPom, pomProperties, noParent, true, false, false, null, "libplexus-active-collections-java");
         assertXMLEqual(read("plexus-active-collections.cleaned"), read(updatedPom));
         Properties pomInfo = new Properties();
         pomInfo.load(new FileInputStream(pomProperties));
@@ -140,7 +140,7 @@
         usePom("plexus-archiver.pom");
         boolean noParent = true;
         instance.addDefaultRules();
-        instance.cleanPom(pom, updatedPom, pomProperties, noParent, true, false, null, "libplexus-archiver-java");
+        instance.cleanPom(pom, updatedPom, pomProperties, noParent, true, false, false, null, "libplexus-archiver-java");
         assertXMLEqual(read("plexus-archiver.cleaned"), read(updatedPom));
         Properties pomInfo = new Properties();
         pomInfo.load(new FileInputStream(pomProperties));
@@ -156,7 +156,7 @@
         usePom("slf4j.xml");
         boolean noParent = true;
         instance.addDefaultRules();
-        instance.cleanPom(pom, updatedPom, pomProperties, noParent, true, false, null, "libslf4j-java");
+        instance.cleanPom(pom, updatedPom, pomProperties, noParent, true, false, false, null, "libslf4j-java");
         assertXMLEqual(read("slf4j.cleaned"), read(updatedPom));
         Properties pomInfo = new Properties();
         pomInfo.load(new FileInputStream(pomProperties));
@@ -173,7 +173,7 @@
         boolean noParent = true;
         instance.addDefaultRules();
         instance.addRule(new DependencyRule("junit junit jar s/3\\..*/3.x/"));
-        instance.cleanPom(pom, updatedPom, pomProperties, noParent, true, false, null, "libcommons-validator-java");
+        instance.cleanPom(pom, updatedPom, pomProperties, noParent, true, false, false, null, "libcommons-validator-java");
         assertXMLEqual(read("commons-validator.cleaned"), read(updatedPom));
         Properties pomInfo = new Properties();
         pomInfo.load(new FileInputStream(pomProperties));
@@ -190,7 +190,7 @@
         boolean noParent = true;
         instance.addDefaultRules();
         instance.addRule(new DependencyRule("s/org.apache.tomcat/javax.servlet/ servlet-api jar s/.*/2.5/"));
-        instance.cleanPom(pom, updatedPom, pomProperties, noParent, true, false, null, "libservlet2.5-java");
+        instance.cleanPom(pom, updatedPom, pomProperties, noParent, true, false, false, null, "libservlet2.5-java");
         assertXMLEqual(read("servlet-api.cleaned"), read(updatedPom));
         Properties pomInfo = new Properties();
         pomInfo.load(new FileInputStream(pomProperties));
@@ -208,7 +208,7 @@
         instance.addDefaultRules();
         instance.addIgnoreRule(new DependencyRule("org.apache.maven.wagon wagon-webdav jar *"));
         instance.addIgnoreRule(new DependencyRule("org.jboss.maven.plugins maven-jdocbook-plugin maven-plugin *"));
-        instance.cleanPom(pom, updatedPom, pomProperties, noParent, true, false, null, "libhibernate-validator-java");
+        instance.cleanPom(pom, updatedPom, pomProperties, noParent, true, false, false, null, "libhibernate-validator-java");
         assertXMLEqual(read("hibernate-validator-parent.cleaned"), read(updatedPom));
         Properties pomInfo = new Properties();
         pomInfo.load(new FileInputStream(pomProperties));
@@ -238,7 +238,7 @@
         instance.addIgnoreRule(new DependencyRule("org.apache.maven.plugins maven-source-plugin * *"));
         instance.addElementToKeep("build");
         instance.addElementToKeep("reporting");
-        instance.cleanPom(pom, updatedPom, pomProperties, noParent, false, false, null, "libmaven-parent-poms");
+        instance.cleanPom(pom, updatedPom, pomProperties, noParent, false, false, false, null, "libmaven-parent-poms");
         assertXMLEqual(read("apache.cleaned"), read(updatedPom));
         Properties pomInfo = new Properties();
         pomInfo.load(new FileInputStream(pomProperties));
@@ -257,7 +257,7 @@
         instance.addRule(new DependencyRule("org.codehaus.plexus plexus-utils jar s/2\\..*/2.x/ * *"));
         instance.addRule(new DependencyRule("org.codehaus.plexus plexus pom s/2\\..*/2.x/ * *"));        
         instance.addIgnoreRule(new DependencyRule("org.apache.maven.plugins maven-release-plugin * *"));
-        instance.cleanPom(pom, updatedPom, pomProperties, noParent, true, false, null, "libplexus-utils2-java");
+        instance.cleanPom(pom, updatedPom, pomProperties, noParent, true, false, false, null, "libplexus-utils2-java");
         assertXMLEqual(read("plexus-utils2.cleaned"), read(updatedPom));
         Properties pomInfo = new Properties();
         pomInfo.load(new FileInputStream(pomProperties));

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-11-02 03:57:47 UTC (rev 13056)
+++ trunk/maven-repo-helper/src/test/java/org/debian/maven/repo/POMTransformerTest.java	2010-11-03 22:17:05 UTC (rev 13057)
@@ -28,7 +28,7 @@
         instance.addDefaultRules();
         instance.addRule(new DependencyRule("org.codehaus.plexus plexus-container-default jar s/1\\.0-alpha-.*/1.0-alpha/"));
         instance.addRule(new DependencyRule("org.apache.maven.plugins maven-assembly-plugin maven-plugin s/.*/2.2/"));
-        instance.transformPom(pom, updatedPom, noParent, true, false, null, null);
+        instance.transformPom(pom, updatedPom, noParent, true, false, false, null, null);
         assertXMLEqual(read("maven.transformed"), read(updatedPom));
     }
 
@@ -37,7 +37,7 @@
         boolean noParent = false;
         instance.addDefaultRules();
         instance.addRule(new DependencyRule("org.codehaus.plexus plexus-container-default jar s/1\\.0-alpha-.*/1.0-alpha/"));
-        instance.transformPom(pom, updatedPom, noParent, true, false, null, "maven2");
+        instance.transformPom(pom, updatedPom, noParent, true, false, false, null, "maven2");
         assertXMLEqual(read("maven-core.transformed"), read(updatedPom));
     }
 
@@ -51,15 +51,16 @@
         instance.addRule(new DependencyRule("org.codehaus.mojo clirr-maven-plugin * *"));
         instance.addRule(new DependencyRule("org.apache.bcel bcel jar s/5\\..*/5.x/"));
         instance.addRule(new DependencyRule("* maven-plugin-plugin maven-plugin s/.*/2.5/"));
-        instance.transformPom(pom, updatedPom, noParent, true, false, null, null);
+        POMInfo transformedPOM = instance.transformPom(pom, updatedPom, noParent, true, false, false, null, null);
         assertXMLEqual(read("maven-javadoc-plugin.transformed"), read(updatedPom));
+        assertNull(transformedPOM.getParent());
     }
 
     public void testTransformModelloPom() throws Exception {
         usePom("modello-core.xml");
         boolean noParent = false;
         instance.addDefaultRules();
-        instance.transformPom(pom, updatedPom, noParent, true, false, null, "libmodello-java");
+        instance.transformPom(pom, updatedPom, noParent, true, false, false, null, "libmodello-java");
         assertXMLEqual(read("modello-core.transformed"), read(updatedPom));
     }
 
@@ -76,7 +77,7 @@
         boolean noParent = false;
         instance.setRepository(getRepository());
         instance.addDefaultRules();
-        instance.transformPom(pom, updatedPom, noParent, true, true, null, "libdoxia-java");
+        instance.transformPom(pom, updatedPom, noParent, true, true, false, null, "libdoxia-java");
         assertXMLEqual(read("doxia-module-fml.transformed"), read(updatedPom));
     }
 
@@ -91,7 +92,7 @@
         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, null, "libantlr3-java");
+        instance.transformPom(pom, updatedPom, noParent, true, true, true, null, "libantlr3-java");
         assertXMLEqual(read("antlr3.transformed"), read(updatedPom));
     }
 
@@ -111,7 +112,7 @@
         instance.addIgnoreModule(pom, "gunit");
         instance.addIgnoreModule(pom, "gunit-maven-plugin");
 
-        instance.transformPom(pom, updatedPom, noParent, true, true, null, "libantlr3-java");
+        instance.transformPom(pom, updatedPom, noParent, true, true, false, null, "libantlr3-java");
         assertXMLEqual(read("antlr3-parent.transformed"), read(updatedPom));
     }
 
@@ -137,7 +138,7 @@
         instance.addIgnoreModule(pom, "gunit");
         instance.addIgnoreModule(pom, "gunit-maven-plugin");
 
-        instance.transformPom(pom, updatedPom, noParent, true, true, null, "libantlr3-java");
+        instance.transformPom(pom, updatedPom, noParent, true, true, true, null, "libantlr3-java");
         assertXMLEqual(read("antlr3-tools.transformed"), read(updatedPom));
     }
 
@@ -149,7 +150,7 @@
         instance.addDefaultRules();
         instance.usePluginVersionsFromRepository();
 
-        instance.transformPom(pom, updatedPom, noParent, true, true, null, "libhibernate-validator-java");
+        instance.transformPom(pom, updatedPom, noParent, true, true, true, null, "libhibernate-validator-java");
         assertXMLEqual(read("hibernate-validator-tck-runner.transformed"), read(updatedPom));
     }
 
@@ -161,7 +162,7 @@
         instance.addDefaultRules();
         instance.usePluginVersionsFromRepository();
 
-        instance.transformPom(pom, updatedPom, noParent, true, true, null, "libhibernate-validator-java");
+        instance.transformPom(pom, updatedPom, noParent, true, true, true, null, "libhibernate-validator-java");
         assertXMLEqual(read("hibernate-validator.transformed"), read(updatedPom));
     }
 
@@ -174,8 +175,9 @@
         instance.addRule(new DependencyRule("org.codehaus.plexus plexus pom s/2\\..*/2.x/ * *"));
         instance.addIgnoreRule(new DependencyRule("org.apache.maven.plugins maven-release-plugin * *"));
 
-        instance.transformPom(pom, updatedPom, noParent, true, true, null, "libplexus-utils2-java");
+        POMInfo transformedPOM = instance.transformPom(pom, updatedPom, noParent, true, true, true, null, "libplexus-utils2-java");
         assertXMLEqual(read("plexus-utils2.transformed"), read(updatedPom));
+        assertEquals("2.x", transformedPOM.getParent().getVersion());
     }
 
     public void testTransformAntlrMavenPluginPom() throws Exception {
@@ -190,7 +192,7 @@
         instance.addRule(new DependencyRule("s/org.apache.maven.shared/org.apache.maven.plugin-testing/ maven-plugin-testing-tools * s/.*/debian/ *"));
         instance.addRule(new DependencyRule("s/org.apache.maven.shared/org.apache.maven.plugin-testing/ maven-test-tools * s/.*/debian/ *"));
 
-        POMInfo transformedPom = instance.transformPom(pom, updatedPom, noParent, true, true, null, "libantlr-maven-plugin-java");
+        POMInfo transformedPom = instance.transformPom(pom, updatedPom, noParent, true, true, false, null, "libantlr-maven-plugin-java");
         assertXMLEqual(read("antlr-maven-plugin.transformed"), read(updatedPom));
         assertEquals("2.3", ((Dependency) transformedPom.getPluginManagement().get(2)).getVersion());
     }

Modified: trunk/maven-repo-helper/src/test/resources/antlr3-tools.transformed
===================================================================
--- trunk/maven-repo-helper/src/test/resources/antlr3-tools.transformed	2010-11-02 03:57:47 UTC (rev 13056)
+++ trunk/maven-repo-helper/src/test/resources/antlr3-tools.transformed	2010-11-03 22:17:05 UTC (rev 13057)
@@ -8,7 +8,7 @@
 	<parent>
 		<groupId>org.antlr</groupId>
 		<artifactId>antlr-master</artifactId>
-		<version>3.x</version>
+		<version>3.2</version>
 	</parent>
 	<properties>
 		<debian.hasPackageVersion/>

Modified: trunk/maven-repo-helper/src/test/resources/antlr3.transformed
===================================================================
--- trunk/maven-repo-helper/src/test/resources/antlr3.transformed	2010-11-02 03:57:47 UTC (rev 13056)
+++ trunk/maven-repo-helper/src/test/resources/antlr3.transformed	2010-11-03 22:17:05 UTC (rev 13057)
@@ -8,7 +8,7 @@
 	<parent>
 		<groupId>org.antlr</groupId>
 		<artifactId>antlr-master</artifactId>
-		<version>3.x</version>
+		<version>3.2</version>
 	</parent>
 	
 	<properties>




More information about the pkg-java-commits mailing list