You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by jd...@apache.org on 2006/11/01 03:59:09 UTC
svn commit: r469757 -
/geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/AbstractCarMojo.java
Author: jdillon
Date: Tue Oct 31 18:59:08 2006
New Revision: 469757
URL: http://svn.apache.org/viewvc?view=rev&rev=469757
Log:
Added geronimoToMavenArtifact(), mavenToGeornimoArtifact() and isModuleArtifact() helpers
Modified:
geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/AbstractCarMojo.java
Modified: geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/AbstractCarMojo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/AbstractCarMojo.java?view=diff&rev=469757&r1=469756&r2=469757
==============================================================================
--- geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/AbstractCarMojo.java (original)
+++ geronimo/server/trunk/maven-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/AbstractCarMojo.java Tue Oct 31 18:59:08 2006
@@ -28,14 +28,13 @@
import java.util.Properties;
import org.apache.geronimo.genesis.MojoSupport;
+import org.apache.geronimo.genesis.util.ArtifactItem;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.MavenProjectHelper;
-import org.apache.maven.artifact.resolver.ArtifactResolver;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.factory.ArtifactFactory;
/**
* Support for <em>packaging</em> Mojos.
@@ -121,5 +120,39 @@
}
return new File(basedir, finalName + classifier + ".car");
+ }
+
+ //
+ // Geronimo/Maven Artifact Interop
+ //
+
+ protected org.apache.geronimo.kernel.repository.Artifact mavenToGeronimoArtifact(final org.apache.maven.artifact.Artifact artifact) {
+ assert artifact != null;
+
+ return new org.apache.geronimo.kernel.repository.Artifact(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getType());
+ }
+
+ protected org.apache.maven.artifact.Artifact geronimoToMavenArtifact(final org.apache.geronimo.kernel.repository.Artifact artifact) throws MojoExecutionException {
+ assert artifact != null;
+
+ ArtifactItem item = new ArtifactItem();
+ item.setGroupId(artifact.getGroupId());
+ item.setArtifactId(artifact.getArtifactId());
+ item.setVersion(artifact.getVersion().toString());
+ item.setType(artifact.getType());
+
+ return createArtifact(item);
+ }
+
+ /**
+ * Determine if the given artifact is a Geronimo module.
+ *
+ * @param artifact The artifact to check; must not be null.
+ * @return True if the artifact is a Geronimo module.
+ */
+ protected boolean isModuleArtifact(final org.apache.geronimo.kernel.repository.Artifact artifact) {
+ assert artifact != null;
+
+ return "car".equals(artifact.getType());
}
}