geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From genspr...@apache.org
Subject svn commit: r1023627 - /geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/ArchiveCarMojo.java
Date Mon, 18 Oct 2010 02:26:38 GMT
Author: genspring
Date: Mon Oct 18 02:26:37 2010
New Revision: 1023627

URL: http://svn.apache.org/viewvc?rev=1023627&view=rev
Log:
GERONIMO-5575 car-maven-plugin EBA plugin build failed to include the eba module in the target
plugin car.

Modified:
    geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/ArchiveCarMojo.java

Modified: geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/ArchiveCarMojo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/ArchiveCarMojo.java?rev=1023627&r1=1023626&r2=1023627&view=diff
==============================================================================
--- geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/ArchiveCarMojo.java
(original)
+++ geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/ArchiveCarMojo.java
Mon Oct 18 02:26:37 2010
@@ -175,6 +175,16 @@ public class ArchiveCarMojo
      * @parameter
      */
     private Map instructions;
+    
+    /**
+     * An {@link Dependency} to include as a module of the CAR. we need this here to determine
+     * if the included module is a EBA application.
+     *
+     * @parameter
+     */
+    private Dependency module = null;
+    
+    
 
     //
     // Mojo
@@ -193,14 +203,28 @@ public class ArchiveCarMojo
         //
         // HACK: Generate the filename in the repo... really should delegate this to the
repo impl
         //
-
-        File dir = new File(targetRepository, project.getGroupId().replace('.', '/'));
-        dir = new File(dir, project.getArtifactId());
-        dir = new File(dir, project.getVersion());
-        dir = new File(dir, project.getArtifactId() + "-" + project.getVersion() + ".car");
+        
+        String groupId=project.getGroupId().replace('.', '/');
+        String artifactId=project.getArtifactId();
+        String version=project.getVersion();
+        String type="car";
+        
+        if (module != null && module.getType() != null && module.getType().equals("eba"))
{
+            groupId = "application";
+            artifactId = module.getArtifactId();
+            version = module.getVersion();
+            type = "eba";
+        }
+        
+        
+        File dir = new File(targetRepository,groupId );
+        dir = new File(dir, artifactId);
+        dir = new File(dir, version);
+        dir = new File(dir, artifactId + "-" + version + "."+type);
 
         return dir;
     }
+    
 
 
     /**
@@ -215,7 +239,7 @@ public class ArchiveCarMojo
 
         try {
             // Incldue the generated artifact contents
-            File artifactDirectory = getArtifactInRepositoryDir();
+            File artifactDirectory = this.getArtifactInRepositoryDir();
 
             if (artifactDirectory.exists()) {
                 archiver.addArchivedFileSet(artifactDirectory);
@@ -251,7 +275,9 @@ public class ArchiveCarMojo
 
             //For no plan car, do nothing
             if (artifactDirectory.exists()) {
-                JarFile includedJarFile = new JarFile(getArtifactInRepositoryDir());
+                
+                JarFile includedJarFile = new JarFile(artifactDirectory) ;
+                
                 if (includedJarFile.getEntry("META-INF/MANIFEST.MF") != null) {
                     FilesetManifestConfig mergeFilesetManifestConfig = new FilesetManifestConfig();
                     mergeFilesetManifestConfig.setValue("merge");



Mime
View raw message