[jboss-svn-commits] JBL Code SVN: r10079 - labs/jbossbuild/maven-plugins/trunk/jboss-deploy-maven-plugin/src/main/java/org/jboss/maven/plugins/deploy.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Mar 8 14:47:37 EST 2007


Author: pgier
Date: 2007-03-08 14:47:37 -0500 (Thu, 08 Mar 2007)
New Revision: 10079

Modified:
   labs/jbossbuild/maven-plugins/trunk/jboss-deploy-maven-plugin/src/main/java/org/jboss/maven/plugins/deploy/JBossDeployMojo.java
Log:
JBBUILD-340; Fixed formatting of code

Modified: labs/jbossbuild/maven-plugins/trunk/jboss-deploy-maven-plugin/src/main/java/org/jboss/maven/plugins/deploy/JBossDeployMojo.java
===================================================================
--- labs/jbossbuild/maven-plugins/trunk/jboss-deploy-maven-plugin/src/main/java/org/jboss/maven/plugins/deploy/JBossDeployMojo.java	2007-03-08 19:32:17 UTC (rev 10078)
+++ labs/jbossbuild/maven-plugins/trunk/jboss-deploy-maven-plugin/src/main/java/org/jboss/maven/plugins/deploy/JBossDeployMojo.java	2007-03-08 19:47:37 UTC (rev 10079)
@@ -117,13 +117,13 @@
     * @parameter
     */
    private Map importsParam;
-   
+
    /**
     * This is the list of artifacts to be added to the classpath.
     * @parameter
     */
    private List exportsParam;
-   
+
    /**
     * Main execution path of the plugin.  Generates component-info.xml, and copies jar files to repository location.
     */
@@ -132,11 +132,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")) {
+      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;
@@ -196,13 +197,16 @@
          project.setDescription(project.getId());
       }
       evaluateVariable(compInfoTemplate, "project.description", project.getDescription());
-      if (scm == null || scm.getConnection() == null) {
+      if (scm == null || scm.getConnection() == null)
+      {
          evaluateVariable(compInfoTemplate, "project.scm", "");
-      } else {
+      }
+      else
+      {
          String scmConnStr = scm.getConnection().replaceFirst("scm:", "");
-         evaluateVariable(compInfoTemplate, "project.scm", "scm:\"" + scmConnStr + "\"");
+         evaluateVariable(compInfoTemplate, "project.scm", "scm=\"" + scmConnStr + "\"");
       }
-      
+
       // Create and set list of artifacts
       StringBuffer artifacts = new StringBuffer();
       artifacts.append("    <artifact id=\"" + artifactFileName + "\"/>\n");
@@ -232,15 +236,23 @@
       //TODO: Maybe this can be determined based on the dependencies, but for now we just have to set it 
       //      in the plugin configuration 
       //      List dependencies = project.getDependencies();
-      StringBuffer imports = new StringBuffer();
-      Set componentNames = importsParam.keySet();
-      for(Object component : componentNames) {
-         imports.append("    <import componentref=\"" + component + "\">\n");
-         imports.append("      <compatible version=\"" + importsParam.get(component) + "\"/>\n");
-         imports.append("    </import>\n");
+      if (importsParam == null)
+      {
+         evaluateVariable(compInfoTemplate, "imports", "");
       }
-      evaluateVariable(compInfoTemplate, "imports", imports.toString());
-      
+      else
+      {
+         StringBuffer imports = new StringBuffer();
+         Set componentNames = importsParam.keySet();
+         for (Object component : componentNames)
+         {
+            imports.append("    <import componentref=\"" + component + "\">\n");
+            imports.append("      <compatible version=\"" + importsParam.get(component) + "\"/>\n");
+            imports.append("    </import>\n");
+         }
+         evaluateVariable(compInfoTemplate, "imports", imports.toString());
+      }
+
       // Write the component info file
       try
       {




More information about the jboss-svn-commits mailing list