[pkg-java] r12604 - in trunk/maven-debian-helper: . bin debian maven-build-nodocs maven-debian-helper maven-debian-plugin maven-debian-plugin/src/main/java/org/debian/maven/plugin maven-packager-utils maven-packager-utils/src/main/java/org/debian/maven/packager maven-packager-utils/src/main/resources maven-packager-utils/src/test/java/org/debian/maven/packager maven-packager-utils/src/test/resources share/cdbs/1/class

Ludovic Claude ludovicc-guest at alioth.debian.org
Sun Jun 20 20:13:36 UTC 2010


Author: ludovicc-guest
Date: 2010-06-20 20:13:32 +0000 (Sun, 20 Jun 2010)
New Revision: 12604

Added:
   trunk/maven-debian-helper/maven-packager-utils/src/main/resources/format.vm
Modified:
   trunk/maven-debian-helper/bin/mh_make
   trunk/maven-debian-helper/debian/changelog
   trunk/maven-debian-helper/debian/control
   trunk/maven-debian-helper/maven-build-nodocs/pom.xml
   trunk/maven-debian-helper/maven-debian-helper/pom.xml
   trunk/maven-debian-helper/maven-debian-plugin/pom.xml
   trunk/maven-debian-helper/maven-debian-plugin/src/main/java/org/debian/maven/plugin/InstallDocMojo.java
   trunk/maven-debian-helper/maven-debian-plugin/src/main/java/org/debian/maven/plugin/InstallMojo.java
   trunk/maven-debian-helper/maven-debian-plugin/src/main/java/org/debian/maven/plugin/SysInstallMojo.java
   trunk/maven-debian-helper/maven-packager-utils/pom.xml
   trunk/maven-debian-helper/maven-packager-utils/src/main/java/org/debian/maven/packager/DependenciesSolver.java
   trunk/maven-debian-helper/maven-packager-utils/src/main/java/org/debian/maven/packager/GenerateDebianFilesMojo.java
   trunk/maven-debian-helper/maven-packager-utils/src/main/resources/control.vm
   trunk/maven-debian-helper/maven-packager-utils/src/main/resources/copyright.vm
   trunk/maven-debian-helper/maven-packager-utils/src/main/resources/rules.vm
   trunk/maven-debian-helper/maven-packager-utils/src/test/java/org/debian/maven/packager/DependenciesSolverTest.java
   trunk/maven-debian-helper/maven-packager-utils/src/test/resources/libplexus-active-collections-java.rules
   trunk/maven-debian-helper/pom.xml
   trunk/maven-debian-helper/share/cdbs/1/class/maven-vars.mk
   trunk/maven-debian-helper/share/cdbs/1/class/maven.mk
Log:
* New release



Modified: trunk/maven-debian-helper/bin/mh_make
===================================================================
--- trunk/maven-debian-helper/bin/mh_make	2010-06-20 19:52:49 UTC (rev 12603)
+++ trunk/maven-debian-helper/bin/mh_make	2010-06-20 20:13:32 UTC (rev 12604)
@@ -72,7 +72,7 @@
 if [ -z "$PACKAGE" ]; then
     PACKAGE="$(basename $(pwd) | sed 's/-[0-9\.].*//')"
 	if [ -n "$FROM_SVN" ]; then
-		PACKAGE=$(basename $FROM_SVN | sed 's/-[0-9\.].*//' )
+		PACKAGE=$(basename ${FROM_SVN%%/tags/*} | sed 's/-[0-9\.].*//' )
 	fi
     echo "Enter the name of the new Debian source package. If empty, it will defaults to $PACKAGE"
     read -p ">" USER_PACKAGE
@@ -107,7 +107,12 @@
 fi
 
 if [ -n "$FROM_SVN" ]; then
-	svn export $FROM_SVN $PACKAGE
+	SVN_OPTIONS=
+	if [[ "$FROM_SVN" =~ https://.*\.dev\.java\.net/.* ]]; then
+		echo "Press enter if a password is asked"
+		SVN_OPTIONS="--username guest"
+	fi
+	svn export $FROM_SVN $PACKAGE $SVN_OPTIONS
 	cd $PACKAGE
 fi
 

Modified: trunk/maven-debian-helper/debian/changelog
===================================================================
--- trunk/maven-debian-helper/debian/changelog	2010-06-20 19:52:49 UTC (rev 12603)
+++ trunk/maven-debian-helper/debian/changelog	2010-06-20 20:13:32 UTC (rev 12604)
@@ -1,3 +1,36 @@
+maven-debian-helper (1.0) unstable; urgency=low
+
+  * debian/control:
+     - replace Depends: on openjdk-6-jre | java2-runtime by default-jdk
+     - remove Conflits: on old maven-debian-helper as there is already
+       a version constraint for a new version of this package.
+  * mh_make:
+      - supports checking out code from the svn of dev.java.net
+      - use upstream copyright when available for debian/* files
+      - update Standards version, generate with source 3.0 (quilt) package
+        format
+      - mh_make --from-svn: improve package name proposal for URLs
+        containing /tags/
+      - ask to ignore missing dependencies
+  * maven.mk: 
+      - add before-mvn-build:: and after-mvn-build:: targets
+        to be able to insert custom actions before and after running the Maven
+        build
+      - add DEB_MAVEN_INSTALL_TO_USJ variable. Set this variable to false to
+        prevent maven.mk to install the jars in /usr/share/java. This
+        variable defaults to true.
+      - add call to mh_clean to remove temporary files
+  * Add -Duse.maven.repo.local option to maven-debian-plugin:install
+    and install-doc to give the option to deploy artifacts on the
+    local (and temporary) Maven repository used by the Debian build
+    Typical use-case: bootstrapping the build of a project with 
+    some artifacts of the project pre-built and installed in the tmp repo
+    before the normal build is executed. See the antlr3 package for an example
+  * SysInstallMojo: clean the target directory before an installation if the
+    directory is a symlink that was created by copy-repo.sh
+
+ -- Ludovic Claude <ludovic.claude at laposte.net>  Sun, 16 May 2010 14:42:29 +0200
+
 maven-debian-helper (0.12) unstable; urgency=low
 
   * SysInstallDocMojo: Fix methods override to install -javadoc JAR flavors.

Modified: trunk/maven-debian-helper/debian/control
===================================================================
--- trunk/maven-debian-helper/debian/control	2010-06-20 19:52:49 UTC (rev 12603)
+++ trunk/maven-debian-helper/debian/control	2010-06-20 20:13:32 UTC (rev 12604)
@@ -15,13 +15,12 @@
 
 Package: maven-debian-helper
 Architecture: all
-Depends: ${misc:Depends}, openjdk-6-jre | java2-runtime, maven-repo-helper (>> 0.5), maven2,
+Depends: ${misc:Depends}, default-jdk, maven-repo-helper (>= 1.1), maven2 (>= 2.2.1-5),
  libmaven-clean-plugin-java, libmaven-resources-plugin-java,
  libmaven-compiler-plugin-java, libmaven-jar-plugin-java, libmaven-site-plugin-java,
  libsurefire-java, velocity, libplexus-velocity-java
 Recommends: apt-file
 Suggests: libmaven-javadoc-plugin-java
-Conflicts: maven-repo-helper (<= 0.5)
 Description: Helper tools for building Debian packages with Maven
  Maven is a software project management and comprehension tool. Based on the
  concept of a project object model (POM), Maven can manage a project's build,

Modified: trunk/maven-debian-helper/maven-build-nodocs/pom.xml
===================================================================
--- trunk/maven-debian-helper/maven-build-nodocs/pom.xml	2010-06-20 19:52:49 UTC (rev 12603)
+++ trunk/maven-debian-helper/maven-build-nodocs/pom.xml	2010-06-20 20:13:32 UTC (rev 12604)
@@ -5,7 +5,7 @@
   <parent>
     <groupId>org.debian.maven</groupId>
     <artifactId>maven-debian</artifactId>
-    <version>0.8</version>
+    <version>1.0</version>
   </parent>
 
   <artifactId>maven-build-nodocs</artifactId>

Modified: trunk/maven-debian-helper/maven-debian-helper/pom.xml
===================================================================
--- trunk/maven-debian-helper/maven-debian-helper/pom.xml	2010-06-20 19:52:49 UTC (rev 12603)
+++ trunk/maven-debian-helper/maven-debian-helper/pom.xml	2010-06-20 20:13:32 UTC (rev 12604)
@@ -5,7 +5,7 @@
   <parent>
     <groupId>org.debian.maven</groupId>
     <artifactId>maven-debian</artifactId>
-    <version>0.8</version>
+    <version>1.0</version>
   </parent>
 
   <artifactId>maven-debian-helper</artifactId>

Modified: trunk/maven-debian-helper/maven-debian-plugin/pom.xml
===================================================================
--- trunk/maven-debian-helper/maven-debian-plugin/pom.xml	2010-06-20 19:52:49 UTC (rev 12603)
+++ trunk/maven-debian-helper/maven-debian-plugin/pom.xml	2010-06-20 20:13:32 UTC (rev 12604)
@@ -5,7 +5,7 @@
   <parent>
     <artifactId>maven-debian</artifactId>
     <groupId>org.debian.maven</groupId>
-    <version>0.8</version>
+    <version>1.0</version>
   </parent>
   
   <artifactId>maven-debian-plugin</artifactId>
@@ -16,7 +16,7 @@
     <dependency>
       <groupId>org.debian.maven</groupId>
       <artifactId>maven-repo-helper</artifactId>
-      <version>0.5</version>
+      <version>1.1</version>
     </dependency>
   </dependencies>
 </project>
\ No newline at end of file

Modified: trunk/maven-debian-helper/maven-debian-plugin/src/main/java/org/debian/maven/plugin/InstallDocMojo.java
===================================================================
--- trunk/maven-debian-helper/maven-debian-plugin/src/main/java/org/debian/maven/plugin/InstallDocMojo.java	2010-06-20 19:52:49 UTC (rev 12603)
+++ trunk/maven-debian-helper/maven-debian-plugin/src/main/java/org/debian/maven/plugin/InstallDocMojo.java	2010-06-20 20:13:32 UTC (rev 12604)
@@ -1,5 +1,7 @@
 package org.debian.maven.plugin;
 
+import java.io.File;
+
 /**
  * Install the javadoc jar files into the debian/ directory
  *
@@ -10,6 +12,20 @@
 public class InstallDocMojo extends SysInstallDocMojo
 {
 
+    /**
+      * Maven repository root
+      *
+      * @parameter expression="${maven.repo.local}"
+      */
+    private File mavenRepoLocal;
+
+      /**
+        * If true, use local Maven repository for installation
+        *
+        * @parameter expression="${use.maven.repo.local}"
+        */
+      private boolean useMavenRepoLocal;
+
   // ----------------------------------------------------------------------
   // Public methods
   // ----------------------------------------------------------------------
@@ -23,7 +39,11 @@
 
   protected String packagePath()
   {
-    return getDebianDir() + "/" + getDebianPackage();
+      if (useMavenRepoLocal) {
+          return mavenRepoLocal.getAbsolutePath();
+      } else {
+          return getDebianDir() + "/" + getDebianPackage();
+      }
   }
 
 }

Modified: trunk/maven-debian-helper/maven-debian-plugin/src/main/java/org/debian/maven/plugin/InstallMojo.java
===================================================================
--- trunk/maven-debian-helper/maven-debian-plugin/src/main/java/org/debian/maven/plugin/InstallMojo.java	2010-06-20 19:52:49 UTC (rev 12603)
+++ trunk/maven-debian-helper/maven-debian-plugin/src/main/java/org/debian/maven/plugin/InstallMojo.java	2010-06-20 20:13:32 UTC (rev 12604)
@@ -1,5 +1,7 @@
 package org.debian.maven.plugin;
 
+import java.io.File;
+
 /**
  * Install pom and jar files into the debian/ directory
  *
@@ -7,6 +9,21 @@
  */
 public class InstallMojo extends SysInstallMojo
 {
+
+  /**
+    * Maven repository root
+    *
+    * @parameter expression="${maven.repo.local}"
+    */
+  private File mavenRepoLocal;
+
+    /**
+      * If true, use local Maven repository for installation
+      *
+      * @parameter expression="${use.maven.repo.local}"
+      */
+    private boolean useMavenRepoLocal;
+
   // ----------------------------------------------------------------------
   // Public methods
   // ----------------------------------------------------------------------
@@ -20,6 +37,36 @@
 
   protected String packagePath()
   {
-    return getDebianDir() + "/" + getDebianPackage();
+    if (useMavenRepoLocal) {
+        return mavenRepoLocal.getAbsolutePath();
+    } else {
+        return getDebianDir() + "/" + getDebianPackage();
+    }
   }
+
+    /**
+     * absolute path to destination dir
+     */
+    protected String fullRepoPath()
+    {
+        if (useMavenRepoLocal) {
+            return packagePath() + destRepoPath();
+        } else {
+            return super.fullRepoPath();
+        }
+    }
+
+    /**
+     * absolute path to destination dir
+     */
+    protected String debianFullRepoPath()
+    {
+        if (useMavenRepoLocal) {
+            return packagePath() + debianRepoPath();
+        } else {
+            return super.debianFullRepoPath();
+        }
+    }
+
+
 }

Modified: trunk/maven-debian-helper/maven-debian-plugin/src/main/java/org/debian/maven/plugin/SysInstallMojo.java
===================================================================
--- trunk/maven-debian-helper/maven-debian-plugin/src/main/java/org/debian/maven/plugin/SysInstallMojo.java	2010-06-20 19:52:49 UTC (rev 12603)
+++ trunk/maven-debian-helper/maven-debian-plugin/src/main/java/org/debian/maven/plugin/SysInstallMojo.java	2010-06-20 20:13:32 UTC (rev 12604)
@@ -120,6 +120,12 @@
    */
   private File repoDir;
 
+    /**
+     * Install the jar to /usr/share/java if true. Default is true
+     * @parameter expression="${install.to.usj}" default-value="true"
+     */
+  private boolean installToUsj = true;
+
   // ----------------------------------------------------------------------
   // Public methods
   // ----------------------------------------------------------------------
@@ -182,7 +188,7 @@
   /**
    * returns e.g. /org/debian/maven/maven-debian-plugin/0.1/
    */
-  private String repoPath()
+  protected final String repoPath()
   {
     return "/" + groupId.replace( '.', '/' ) + "/" + artifactId + "/" + version + "/";
   }
@@ -190,7 +196,7 @@
   /**
    * returns e.g. /org/debian/maven/maven-debian-plugin/0.1/
    */
-  private String destRepoPath()
+  protected final String destRepoPath()
   {
     return "/" + destGroupId.replace( '.', '/' ) + "/" + destArtifactId + "/" + version + "/";
   }
@@ -198,7 +204,7 @@
   /**
    * returns e.g. /org/debian/maven/maven-debian-plugin/debian/
    */
-  private String debianRepoPath()
+  protected final String debianRepoPath()
   {
     return "/" + destGroupId.replace( '.', '/' ) + "/" + destArtifactId + "/" + debianVersion + "/";
   }
@@ -284,22 +290,22 @@
     return destArtifactId + "-" + debianVersion + ".jar";
   }
 
-  private String fullJarName()
+  protected final String fullJarName()
   {
     return jarDir + "/" + jarName();
   }
 
-  private String jarDestPath()
+  protected final String jarDestPath()
   {
     return fullRepoPath() + destJarName();
   }
 
-  private String jarDestRelPath()
+  protected final String jarDestRelPath()
   {
     return "../" + version + "/" + destJarName();
   }
 
-  private String debianJarDestPath()
+  protected final String debianJarDestPath()
   {
     return debianFullRepoPath() + debianJarName();
   }
@@ -307,17 +313,17 @@
   /** 
    * jar file name without version number
    */
-  private String compatName()
+  protected final String compatName()
   {
     return destArtifactId + ".jar";
   }
 
-  private String compatSharePath()
+  protected final String compatSharePath()
   {
     return packagePath() + "/usr/share/java/";
   }
 
-  private String compatRelPath()
+  protected final String compatRelPath()
   {
     return "../maven-repo" + destRepoPath() + destJarName();
   }
@@ -484,14 +490,27 @@
   }
 
   /**
+     * Prepare the destination  directories: remove the directory symlinks that were created
+     * by copy-repo.sh if they exist as they point to a directory owned by root and that cannot
+     * be modified.
+     */
+  protected void prepareDestDirs() {
+      // Simply try to delete the path. If it's a symlink, it will work, otherwise delete() returns false
+      new File(fullRepoPath()).delete();
+      new File(debianFullRepoPath()).delete();
+  }
+  /**
    * do the actual work
    */
   protected void runMojo() throws IOException
   {
     //initProperties();
     cleanPom();
+    prepareDestDirs();
     copyPom();
     copyJar();
-    symlinkJar();
+    if (installToUsj) {
+      symlinkJar();
+    }
   }
 }

Modified: trunk/maven-debian-helper/maven-packager-utils/pom.xml
===================================================================
--- trunk/maven-debian-helper/maven-packager-utils/pom.xml	2010-06-20 19:52:49 UTC (rev 12603)
+++ trunk/maven-debian-helper/maven-packager-utils/pom.xml	2010-06-20 20:13:32 UTC (rev 12604)
@@ -5,7 +5,7 @@
     <parent>
       <artifactId>maven-debian</artifactId>
       <groupId>org.debian.maven</groupId>
-      <version>0.8</version>
+      <version>1.0</version>
     </parent>
 
     <artifactId>maven-packager-utils</artifactId>
@@ -47,7 +47,7 @@
         <dependency>
             <groupId>org.debian.maven</groupId>
             <artifactId>maven-repo-helper</artifactId>
-            <version>1.0.1</version>
+            <version>1.1</version>
         </dependency>
         <dependency>
             <groupId>commons-io</groupId>

Modified: trunk/maven-debian-helper/maven-packager-utils/src/main/java/org/debian/maven/packager/DependenciesSolver.java
===================================================================
--- trunk/maven-debian-helper/maven-packager-utils/src/main/java/org/debian/maven/packager/DependenciesSolver.java	2010-06-20 19:52:49 UTC (rev 12603)
+++ trunk/maven-debian-helper/maven-packager-utils/src/main/java/org/debian/maven/packager/DependenciesSolver.java	2010-06-20 20:13:32 UTC (rev 12604)
@@ -257,6 +257,12 @@
         if (listOfPoms != null && !listOfPoms.exists()) {
             try {
                 PrintWriter out = new PrintWriter(new FileWriter(listOfPoms));
+                out.println("# List of POM files for the package");
+                out.println("# Format of this file is:");
+                out.println("# <path to pom file> [option]");
+                out.println("# where option can be:");
+                out.println("#   --ignore: ignore this POM or");
+                out.println("#   --no-parent: remove the <parent> tag from the POM");
                 for (Iterator i = pomsConfig.iterator(); i.hasNext();) {
                     String config = (String) i.next();
                     out.println(config);
@@ -654,7 +660,7 @@
 
             if (ignoreDependency) {
                 ignoredDependencies.add(dependency);
-                ignoreRules.add(dependency.getGroupId() + " " + dependency.getArtifactId() + " maven-plugin *");
+                ignoreRules.add(dependency.getGroupId() + " " + dependency.getArtifactId() + " * *");
                 continue;
             }
 
@@ -675,7 +681,14 @@
                 if (!management) {
                     issues.add(sourcePomLoc + ": Dependency is not packaged in the Maven repository for Debian: " + dependency.getGroupId() + ":"
                             + dependency.getArtifactId() + ":" + dependency.getVersion());
+                    ignoreDependency = askIgnoreDependency(dependency, "This dependency cannot be found in the Debian Maven repository. Ignore this dependency?");
+                    if (ignoreDependency) {
+                        ignoredDependencies.add(dependency);
+                        ignoreRules.add(dependency.getGroupId() + " " + dependency.getArtifactId() + " * *");
+                        continue;
+                    }
                 }
+
                 return;
             }
 

Modified: trunk/maven-debian-helper/maven-packager-utils/src/main/java/org/debian/maven/packager/GenerateDebianFilesMojo.java
===================================================================
--- trunk/maven-debian-helper/maven-packager-utils/src/main/java/org/debian/maven/packager/GenerateDebianFilesMojo.java	2010-06-20 19:52:49 UTC (rev 12603)
+++ trunk/maven-debian-helper/maven-packager-utils/src/main/java/org/debian/maven/packager/GenerateDebianFilesMojo.java	2010-06-20 20:13:32 UTC (rev 12604)
@@ -318,71 +318,47 @@
                         downloadUrl + ").");
             }
 
-            FileWriter out = new FileWriter(new File(outputDirectory, "README.source"));
-            Velocity.mergeTemplate("README.source.vm", "UTF8", context, out);
-            out.flush();
-            out.close();
+            generateFile(context, "README.source.vm", outputDirectory, "README.source");
+            generateFile(context, "copyright.vm", outputDirectory, "copyright");
+            generateFile(context, "compat.vm", outputDirectory, "compat");
+            generateFile(context, rulesTemplate, outputDirectory, "rules");
 
-            out = new FileWriter(new File(outputDirectory, "copyright"));
-            Velocity.mergeTemplate("copyright.vm", "UTF8", context, out);
-            out.flush();
-            out.close();
-
-            out = new FileWriter(new File(outputDirectory, "compat"));
-            Velocity.mergeTemplate("compat.vm", "UTF8", context, out);
-            out.flush();
-            out.close();
-
-            out = new FileWriter(new File(outputDirectory, "rules"));
-            Velocity.mergeTemplate(rulesTemplate, "UTF8", context, out);
-            out.flush();
-            out.close();
-
             makeExecutable("debian/rules");
 
             String debianVersion = projectVersion.replace("-alpha-", "~alpha");
             debianVersion = debianVersion.replace("-beta-", "~beta");
             debianVersion += "-1";
-            context.put("debianVersion", debianVersion);
-            out = new FileWriter(".debianVersion");
-            Velocity.mergeTemplate("version.vm", "UTF8", context, out);
-            out.flush();
-            out.close();
+            context.put("version.vm", debianVersion);
 
-            if (generateJavadoc) {
-                out = new FileWriter(new File(outputDirectory, binPackageName + "-doc.doc-base.api"));
-                Velocity.mergeTemplate("java-doc.doc-base.api.vm", "UTF8", context, out);
-                out.flush();
-                out.close();
+            generateFile(context, rulesTemplate, new File("."), ".debianVersion");
 
-                out = new FileWriter(new File(outputDirectory, binPackageName + "-doc.install"));
-                Velocity.mergeTemplate("java-doc.install.vm", "UTF8", context, out);
-                out.flush();
-                out.close();
+            if (generateJavadoc) {
+                generateFile(context, "java-doc.doc-base.api.vm", outputDirectory, binPackageName + "-doc.doc-base.api");
+                generateFile(context, "java-doc.install.vm", outputDirectory, binPackageName + "-doc.install");
             }
 
             if ("ant".equals(packageType)) {
-                out = new FileWriter(new File(outputDirectory, "build.properties"));
-                Velocity.mergeTemplate("build.properties.ant.vm", "UTF8", context, out);
-                out.flush();
-                out.close();
+                generateFile(context, "build.properties.ant.vm", outputDirectory, "build.properties");
             } else {
-                out = new FileWriter(new File(outputDirectory, "maven.properties"));
-                Velocity.mergeTemplate("maven.properties.vm", "UTF8", context, out);
-                out.flush();
-                out.close();
+                generateFile(context, "maven.properties.vm", outputDirectory, "maven.properties");
             }
 
-            out = new FileWriter(new File(outputDirectory, "control"));
-            Velocity.mergeTemplate(controlTemplate, "UTF8", context, out);
-            out.flush();
-            out.close();
+            generateFile(context, controlTemplate, outputDirectory, "control");
+            generateFile(context, "format.vm", new File(outputDirectory, "source"), "format");
 
         } catch (Exception ex) {
             ex.printStackTrace();
         }
     }
 
+    private void generateFile(VelocityContext context, String templateName, File destDir, String fileName) throws Exception {
+        destDir.mkdirs();
+        FileWriter out = new FileWriter(new File(destDir, fileName));
+        Velocity.mergeTemplate(templateName, "UTF8", context, out);
+        out.flush();
+        out.close();
+    }
+
     private List listSharedJars(String library) {
         final List jars = new ArrayList();
         DependenciesSolver.executeProcess(new String[]{"/usr/bin/dpkg", "--listfiles", library},

Modified: trunk/maven-debian-helper/maven-packager-utils/src/main/resources/control.vm
===================================================================
--- trunk/maven-debian-helper/maven-packager-utils/src/main/resources/control.vm	2010-06-20 19:52:49 UTC (rev 12603)
+++ trunk/maven-debian-helper/maven-packager-utils/src/main/resources/control.vm	2010-06-20 20:13:32 UTC (rev 12604)
@@ -20,7 +20,7 @@
 Uploaders: ${packager} <${packagerEmail}>
 Build-Depends: debhelper (>= 7), cdbs, default-jdk, maven-debian-helper
 Build-Depends-Indep:#printDependencies($compileDependencies)$space
-Standards-Version: 3.8.3
+Standards-Version: 3.8.4
 Vcs-Svn: svn://svn.debian.org/svn/pkg-java/trunk/${package}
 Vcs-Browser: http://svn.debian.org/wsvn/pkg-java/trunk/${package}
 Homepage:#if(${project.Url}) ${project.Url} #else TODO #end

Modified: trunk/maven-debian-helper/maven-packager-utils/src/main/resources/copyright.vm
===================================================================
--- trunk/maven-debian-helper/maven-packager-utils/src/main/resources/copyright.vm	2010-06-20 19:52:49 UTC (rev 12603)
+++ trunk/maven-debian-helper/maven-packager-utils/src/main/resources/copyright.vm	2010-06-20 20:13:32 UTC (rev 12604)
@@ -48,7 +48,7 @@
 #elseif ($licenseName.indexOf("3") >= 0 || $licenseUrl.indexOf("3") >= 0)
 #set ($x = $licenses.add("GPL-3"))
 #else
-#if ($licenseName)#set ($x = $licenses.add("$licenseName"))
+#if ($licenseName)#set ($x = $licenses.add("$licenseName"))#set ($packagerLicense="$licenseName")
 #elseif($licenseUrl)#set ($x = $licenses.add("$licenseUrl"))
 #else#set ($x = $licenses.add("UNKNOWN-LICENSE"))
 #end

Added: trunk/maven-debian-helper/maven-packager-utils/src/main/resources/format.vm
===================================================================
--- trunk/maven-debian-helper/maven-packager-utils/src/main/resources/format.vm	                        (rev 0)
+++ trunk/maven-debian-helper/maven-packager-utils/src/main/resources/format.vm	2010-06-20 20:13:32 UTC (rev 12604)
@@ -0,0 +1 @@
+3.0 (quilt)

Modified: trunk/maven-debian-helper/maven-packager-utils/src/main/resources/rules.vm
===================================================================
--- trunk/maven-debian-helper/maven-packager-utils/src/main/resources/rules.vm	2010-06-20 19:52:49 UTC (rev 12603)
+++ trunk/maven-debian-helper/maven-packager-utils/src/main/resources/rules.vm	2010-06-20 20:13:32 UTC (rev 12604)
@@ -4,6 +4,9 @@
 include /usr/share/cdbs/1/class/maven.mk
 
 JAVA_HOME := /usr/lib/jvm/default-java
+#if ($project.Packaging == "pom")
+DEB_MAVEN_DOC_TARGET := javadoc:jar javadoc:aggregate
+#end
 
 get-orig-source:
 	uscan --download-version $(DEB_UPSTREAM_VERSION) --force-download --rename

Modified: trunk/maven-debian-helper/maven-packager-utils/src/test/java/org/debian/maven/packager/DependenciesSolverTest.java
===================================================================
--- trunk/maven-debian-helper/maven-packager-utils/src/test/java/org/debian/maven/packager/DependenciesSolverTest.java	2010-06-20 19:52:49 UTC (rev 12603)
+++ trunk/maven-debian-helper/maven-packager-utils/src/test/java/org/debian/maven/packager/DependenciesSolverTest.java	2010-06-20 20:13:32 UTC (rev 12604)
@@ -61,6 +61,8 @@
         solver.setExploreProjects(true);
         solver.setPackageName("libplexus-active-collections-java");
         solver.setPackageType("maven");
+        solver.setListOfPoms(new File(testDir, "libplexus-active-collections-java.poms"));
+        solver.setNonInteractive(true);
 
         solver.solveDependencies();
 
@@ -81,13 +83,24 @@
         LineNumberReader fileReader = new LineNumberReader(new FileReader(file));
         LineNumberReader refReader = new LineNumberReader(read(resource));
 
+        String ref, test = null;
+        boolean skipReadTest = false;
         while (true) {
-            String test = fileReader.readLine();
-            String ref = refReader.readLine();
+            if (!skipReadTest) {
+                test = fileReader.readLine();
+
+                if (test != null && test.startsWith("#")) {
+                    continue;
+                }
+            }
+            skipReadTest = false;
+
+            ref = refReader.readLine();
             if (ref == null) {
                 return;
             }
             if (ref.startsWith("#")) {
+                skipReadTest = true;
                 continue;
             }
             assertEquals("Error in " + fileName, ref, test);

Modified: trunk/maven-debian-helper/maven-packager-utils/src/test/resources/libplexus-active-collections-java.rules
===================================================================
--- trunk/maven-debian-helper/maven-packager-utils/src/test/resources/libplexus-active-collections-java.rules	2010-06-20 19:52:49 UTC (rev 12603)
+++ trunk/maven-debian-helper/maven-packager-utils/src/test/resources/libplexus-active-collections-java.rules	2010-06-20 20:13:32 UTC (rev 12604)
@@ -1,2 +1 @@
-junit junit jar s/3\..*/3.x/
-org.codehaus.plexus plexus-maven-plugin maven-plugin s/.*/1.3.8/
+junit junit jar s/3\..*/3.x/ *

Modified: trunk/maven-debian-helper/pom.xml
===================================================================
--- trunk/maven-debian-helper/pom.xml	2010-06-20 19:52:49 UTC (rev 12603)
+++ trunk/maven-debian-helper/pom.xml	2010-06-20 20:13:32 UTC (rev 12604)
@@ -4,14 +4,14 @@
 
   <groupId>org.debian.maven</groupId>
   <artifactId>maven-debian</artifactId>
-  <version>0.8</version>
+  <version>1.0</version>
   <packaging>pom</packaging>
   <name>helper tools for using Maven to build Debian packages</name>
 
   <modules>
     <module>maven-debian-helper</module>
     <module>maven-debian-plugin</module>
-    <module>maven-build-no-docs</module>
+    <module>maven-build-nodocs</module>
     <module>maven-packager-utils</module>
   </modules>
   

Modified: trunk/maven-debian-helper/share/cdbs/1/class/maven-vars.mk
===================================================================
--- trunk/maven-debian-helper/share/cdbs/1/class/maven-vars.mk	2010-06-20 19:52:49 UTC (rev 12603)
+++ trunk/maven-debian-helper/share/cdbs/1/class/maven-vars.mk	2010-06-20 20:13:32 UTC (rev 12604)
@@ -28,7 +28,7 @@
 
 # Declare Build-Deps for packages using this file
 CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), cdbs (>= 0.4.43)
-CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), maven-debian-helper (>> 0.7)
+CDBS_BUILD_DEPENDS := $(CDBS_BUILD_DEPENDS), maven-debian-helper (>= 1.1)
 
 # Maven home directory.  Doesn't need to be changed except when using
 # nonstandard Maven installations.
@@ -65,8 +65,11 @@
 DEB_MAVEN_ARGS = 
 
 # Extra arguments for the mh_patchpoms command line
-DEB_PATCHPOMS_ARGS=
+DEB_PATCHPOMS_ARGS =
 
+# If true, install the Maven jars to /usr/share/java automatically
+DEB_MAVEN_INSTALL_TO_USJ = true
+
 # The name of the binary package that gets the jar files installed. The
 # first package by default.
 DEB_JAR_PACKAGE = $(firstword $(shell dh_listpackages))
@@ -86,10 +89,10 @@
 # MAVEN_ARGS_<package> for each individual package.
 DEB_MAVEN_INVOKE = cd $(DEB_BUILDDIR) && $(JAVACMD) -noverify -cp $(DEB_CLASSPATH) \
 		 $(JAVA_OPTS) -Dclassworlds.conf=$(MAVEN_CLASSCONF) \
-		 org.codehaus.classworlds.Launcher $(DEB_MAVEN_ARGS) \
+		 org.codehaus.classworlds.Launcher \
 		 -s/etc/maven2/settings-debian.xml \
 		 -Dmaven.repo.local=$(DEB_MAVEN_REPO) \
-		 $(if $(MAVEN_ARGS_$(cdbs_curpkg)),$(MAVEN_ARGS_$(cdbs_curpkg)),$(MAVEN_ARGS))
+		 $(if $(DEB_MAVEN_ARGS_$(cdbs_curpkg)),$(DEB_MAVEN_ARGS_$(cdbs_curpkg)),$(DEB_MAVEN_ARGS))
 
 # Targets to invoke for building, installing, testing and cleaning up.
 # Building uses the default target from build.xml, installing and testing is

Modified: trunk/maven-debian-helper/share/cdbs/1/class/maven.mk
===================================================================
--- trunk/maven-debian-helper/share/cdbs/1/class/maven.mk	2010-06-20 19:52:49 UTC (rev 12603)
+++ trunk/maven-debian-helper/share/cdbs/1/class/maven.mk	2010-06-20 20:13:32 UTC (rev 12604)
@@ -78,11 +78,16 @@
 post-patches:: patch-poms
 
 clean:: unpatch-poms
+	mh_clean
 
 common-build-arch common-build-indep:: debian/stamp-maven-build maven-sanity-check
-debian/stamp-maven-build: debian/maven-repo
+debian/stamp-maven-build: debian/maven-repo before-mvn-build mvn-build after-mvn-build
+mvn-build:
 	$(DEB_MAVEN_INVOKE) $(DEB_MAVEN_BUILD_TARGET)
 	touch $@
+# Placeholders to insert custom processing before and after a Maven build
+before-mvn-build::
+after-mvn-build::
 
 cleanbuilddir:: DEB_PATCHPOMS_ARGS += --clean-ignore-rules=debian/maven.cleanIgnoreRules
 cleanbuilddir:: maven-sanity-check post-patches debian/maven-repo
@@ -94,7 +99,7 @@
 	$(MAKE) -f debian/rules unpatch-poms
 
 # extra arguments for the installation step
-PLUGIN_ARGS = -Ddebian.dir=$(CURDIR)/debian -Ddebian.package=$(DEB_JAR_PACKAGE) -Dmaven.repo.local=$(DEB_MAVEN_REPO)
+PLUGIN_ARGS = -Ddebian.dir=$(CURDIR)/debian -Ddebian.package=$(DEB_JAR_PACKAGE) -Dmaven.repo.local=$(DEB_MAVEN_REPO) -Dinstall.to.usj=$(DEB_MAVEN_INSTALL_TO_USJ)
 
 common-install-arch common-install-indep:: common-install-impl
 common-install-impl::




More information about the pkg-java-commits mailing list