[jboss-svn-commits] JBL Code SVN: r9724 - in labs/jbossbuild/trunk/projects/maven-plugins/jboss-deploy-maven-plugin/src/main: resources/org/jboss/maven/plugins/deploy and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Feb 23 15:28:24 EST 2007


Author: pgier
Date: 2007-02-23 15:28:24 -0500 (Fri, 23 Feb 2007)
New Revision: 9724

Modified:
   labs/jbossbuild/trunk/projects/maven-plugins/jboss-deploy-maven-plugin/src/main/java/org/jboss/maven/plugins/deploy/JBossDeployMojo.java
   labs/jbossbuild/trunk/projects/maven-plugins/jboss-deploy-maven-plugin/src/main/resources/org/jboss/maven/plugins/deploy/component-info-template.xml
Log:
JBBUILD-340; Added scm settings to component info and made this setting optional.

Modified: labs/jbossbuild/trunk/projects/maven-plugins/jboss-deploy-maven-plugin/src/main/java/org/jboss/maven/plugins/deploy/JBossDeployMojo.java
===================================================================
--- labs/jbossbuild/trunk/projects/maven-plugins/jboss-deploy-maven-plugin/src/main/java/org/jboss/maven/plugins/deploy/JBossDeployMojo.java	2007-02-23 19:47:42 UTC (rev 9723)
+++ labs/jbossbuild/trunk/projects/maven-plugins/jboss-deploy-maven-plugin/src/main/java/org/jboss/maven/plugins/deploy/JBossDeployMojo.java	2007-02-23 20:28:24 UTC (rev 9724)
@@ -44,7 +44,6 @@
    /**
     * Source control information.
     * @parameter expression="${project.scm}"
-    * @required
     * @readonly
     */
    private org.apache.maven.model.Scm scm;
@@ -152,6 +151,12 @@
    {
       this.getLog().debug("Executing JBoss deploy plugin");
 
+      // Check that the project is using jar packaging because we don't handle other types yet.
+      if (!project.getPackaging().equals("jar")) {
+         getLog().info("Ignoring project with packaging type: " + project.getPackaging());
+         return;
+      }
+      
       // Initialize local variables
       String artifactFileName = project.getArtifactId() + "." + project.getPackaging();
       String artifactFilePath = targetDirectory.toString() + fileSep + artifactFileName;
@@ -211,7 +216,13 @@
          project.setDescription(project.getId());
       }
       evaluateVariable(compInfoTemplate, "project.description", project.getDescription());
-
+      if (scm == null || scm.getConnection() == null) {
+         evaluateVariable(compInfoTemplate, "project.scm", "");
+      } else {
+         String scmConnStr = scm.getConnection().replaceFirst("scm:", "");
+         evaluateVariable(compInfoTemplate, "project.scm", "scm:\"" + scmConnStr + "\"");
+      }
+      
       // Create and set list of artifacts
       StringBuffer artifacts = new StringBuffer();
       artifacts.append("    <artifact id=\"" + artifactFileName + "\"/>\n");
@@ -303,7 +314,7 @@
 
    /**
     * Replace all instances of var with value in the given buffer.
-    * For example if var is project.name, this method will search
+    * For example if var is "project.name", this method will search
     * the buffer for "${project.name}" and replace it with the value
     * provided.
     * 

Modified: labs/jbossbuild/trunk/projects/maven-plugins/jboss-deploy-maven-plugin/src/main/resources/org/jboss/maven/plugins/deploy/component-info-template.xml
===================================================================
--- labs/jbossbuild/trunk/projects/maven-plugins/jboss-deploy-maven-plugin/src/main/resources/org/jboss/maven/plugins/deploy/component-info-template.xml	2007-02-23 19:47:42 UTC (rev 9723)
+++ labs/jbossbuild/trunk/projects/maven-plugins/jboss-deploy-maven-plugin/src/main/resources/org/jboss/maven/plugins/deploy/component-info-template.xml	2007-02-23 20:28:24 UTC (rev 9724)
@@ -4,6 +4,7 @@
              licenseType="${project.license}"
              version="${project.version}"
              description="${project.description}"
+             ${project.scm}
              > 
               
 ${artifacts}




More information about the jboss-svn-commits mailing list