geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r942436 - /geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/
Date Sat, 08 May 2010 18:23:24 GMT
Author: djencks
Date: Sat May  8 18:23:24 2010
New Revision: 942436

URL: http://svn.apache.org/viewvc?rev=942436&view=rev
Log:
GERONIMO-5290 Fix access to maven data structures to work with maven 3

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

Modified: geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/AbstractCarMojo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/AbstractCarMojo.java?rev=942436&r1=942435&r2=942436&view=diff
==============================================================================
--- geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/AbstractCarMojo.java
(original)
+++ geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/AbstractCarMojo.java
Sat May  8 18:23:24 2010
@@ -403,7 +403,15 @@ public abstract class AbstractCarMojo
         DependencyType dependency = new DependencyType();
         dependency.setGroupId(artifact.getGroupId());
         dependency.setArtifactId(artifact.getArtifactId());
-        dependency.setVersion(includeVersion ? artifact.getVersionRange().getRecommendedVersion().toString()
: null);
+        String version = null;
+        if (includeVersion) {
+            if (artifact.getVersionRange() == null) {
+                version = artifact.getVersion();
+            } else {
+                version = artifact.getVersionRange().getRecommendedVersion().toString();
+            }
+        }
+        dependency.setVersion(version);
         dependency.setType(artifact.getType());
         if (includeImport) {
             ImportType importType = ImportType.ALL;
@@ -950,6 +958,11 @@ public abstract class AbstractCarMojo
         ServiceLoader<FrameworkFactory> loader = ServiceLoader.load(FrameworkFactory.class);
         Framework framework = loader.iterator().next().newFramework(properties);
         framework.start();
+        //enable mvn url handling
+//        new org.ops4j.pax.url.mvn.internal.Activator().start(framework.getBundleContext());
+        //don't allow mvn urls
+        System.setProperty("geronimo.build.car", "true");
+
         return framework;
     }
 

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=942436&r1=942435&r2=942436&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
Sat May  8 18:23:24 2010
@@ -70,7 +70,7 @@ public class ArchiveCarMojo
     /**
      * The Jar archiver.
      *
-     * @parameter expression="${component.org.codehaus.plexus.archiver.Archiver#jar}"
+     * @component role="org.codehaus.plexus.archiver.Archiver" roleHint="jar"
      * @required
      * @readonly
      */
@@ -79,7 +79,7 @@ public class ArchiveCarMojo
     /**
      * The Jar archiver.
      *
-     * @parameter expression="${component.org.codehaus.plexus.archiver.manager.ArchiverManager}"
+     * @component role="org.codehaus.plexus.archiver.manager.ArchiverManager"
      * @required
      * @readonly
      */

Modified: geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PlanProcessorMojo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PlanProcessorMojo.java?rev=942436&r1=942435&r2=942436&view=diff
==============================================================================
--- geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PlanProcessorMojo.java
(original)
+++ geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PlanProcessorMojo.java
Sat May  8 18:23:24 2010
@@ -51,6 +51,7 @@ import org.apache.xmlbeans.XmlOptions;
  *
  * @version $Rev$ $Date$
  * @goal prepare-plan
+ * @requiresDependencyResolution runtime
  */
 public class PlanProcessorMojo
         extends AbstractCarMojo {

Modified: geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PluginMetadataGeneratorMojo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PluginMetadataGeneratorMojo.java?rev=942436&r1=942435&r2=942436&view=diff
==============================================================================
--- geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PluginMetadataGeneratorMojo.java
(original)
+++ geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/PluginMetadataGeneratorMojo.java
Sat May  8 18:23:24 2010
@@ -183,14 +183,19 @@ public class PluginMetadataGeneratorMojo
                 throw new Error("Unable to resolve car plugin");
             }
 
-            Xpp3Dom dom;
+            Xpp3Dom dom = null;
             if (plugin.getExecutions().isEmpty()) {
                 dom = (Xpp3Dom) plugin.getConfiguration();
             } else {
-                if (plugin.getExecutions().size() > 1) {
-                    throw new IllegalStateException("Cannot determine correct configuration
for PluginMetadataGeneratorMojo: " + plugin.getExecutionsAsMap().keySet());
+                for (PluginExecution execution: (List<PluginExecution>)plugin.getExecutions())
{
+                    if ("prepare-metadata".equals(execution.getGoals().get(0))) {
+                        dom = (Xpp3Dom) execution.getConfiguration();
+                        break;
+                    }
+                }
+                if (dom == null) {
+                    throw new IllegalStateException("Cannot determine correct configuration
for PluginMetadataGeneratorMojo: " + plugin.getExecutionsAsMap());
                 }
-                dom = (Xpp3Dom) ((PluginExecution) plugin.getExecutions().get(0)).getConfiguration();
             }
             Xpp3Dom instanceDom = dom.getChild("instance");
 

Modified: geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/ValidateConfigurationMojo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/ValidateConfigurationMojo.java?rev=942436&r1=942435&r2=942436&view=diff
==============================================================================
--- geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/ValidateConfigurationMojo.java
(original)
+++ geronimo/server/trunk/framework/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/ValidateConfigurationMojo.java
Sat May  8 18:23:24 2010
@@ -30,6 +30,7 @@ import org.apache.maven.plugin.MojoFailu
  * Check that all dependencies mentioned explicitly in the car-maven-plugin configuration
are present as maven dependencies.
  *
  * @goal validate-configuration
+ * @requiresDependencyResolution compile
  *
  * @version $Rev$ $Date$
  */



Mime
View raw message