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/08/22 23:40:43 UTC
svn commit: r433765 - in /geronimo/trunk: configs/client-system/
configs/j2ee-system/ configs/online-deployer/ configs/shutdown/
m2-assemblies/geronimo-boilerplate-minimal/
m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/
Author: jdillon
Date: Tue Aug 22 14:40:42 2006
New Revision: 433765
URL: http://svn.apache.org/viewvc?rev=433765&view=rev
Log:
Moved ArtifactItem and artifact handling to Genesis plugin-support
Using arrays instead of lists to configure ArtifactItems and ClasspathItems, seems to behave better on the classpath and allows for terse(r) configuration
Use terse config for claspath/artifact elements
Removed:
geronimo/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/ArtifactItem.java
Modified:
geronimo/trunk/configs/client-system/pom.xml
geronimo/trunk/configs/j2ee-system/pom.xml
geronimo/trunk/configs/online-deployer/pom.xml
geronimo/trunk/configs/shutdown/pom.xml
geronimo/trunk/m2-assemblies/geronimo-boilerplate-minimal/pom.xml
geronimo/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/AbstractCarMojo.java
geronimo/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/ClasspathElement.java
geronimo/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/InstallArtifactsMojo.java
geronimo/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/PackageMojo.java
Modified: geronimo/trunk/configs/client-system/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/trunk/configs/client-system/pom.xml?rev=433765&r1=433764&r2=433765&view=diff
==============================================================================
--- geronimo/trunk/configs/client-system/pom.xml (original)
+++ geronimo/trunk/configs/client-system/pom.xml Tue Aug 22 14:40:42 2006
@@ -79,76 +79,76 @@
NOTE: This list of dependencies is non-transitive.
-->
<classpath>
- <classpathElement>
+ <element>
<groupId>org.apache.geronimo.modules</groupId>
<artifactId>geronimo-common</artifactId>
<version>${pom.version}</version>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>org.apache.geronimo.modules</groupId>
<artifactId>geronimo-kernel</artifactId>
<version>${pom.version}</version>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>org.apache.geronimo.modules</groupId>
<artifactId>geronimo-system</artifactId>
<version>${pom.version}</version>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>org.apache.geronimo.modules</groupId>
<artifactId>geronimo-util</artifactId>
<version>${pom.version}</version>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-qname_1.1_spec</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>mx4j</groupId>
<artifactId>mx4j</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>mx4j</groupId>
<artifactId>mx4j-remote</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>cglib</groupId>
<artifactId>cglib-nodep</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>jline</groupId>
<artifactId>jline</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>xpp3</groupId>
<artifactId>xpp3</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>xstream</groupId>
<artifactId>xstream</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<classpathPrefix>../lib/endorsed</classpathPrefix>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>xerces</groupId>
<artifactId>xmlParserAPIs</artifactId>
<classpathPrefix>../lib/endorsed</classpathPrefix>
- </classpathElement>
+ </element>
</classpath>
<classpathPrefix>../lib</classpathPrefix>
</configuration>
Modified: geronimo/trunk/configs/j2ee-system/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/trunk/configs/j2ee-system/pom.xml?rev=433765&r1=433764&r2=433765&view=diff
==============================================================================
--- geronimo/trunk/configs/j2ee-system/pom.xml (original)
+++ geronimo/trunk/configs/j2ee-system/pom.xml Tue Aug 22 14:40:42 2006
@@ -76,84 +76,84 @@
NOTE: This list of dependencies is non-transitive.
-->
<classpath>
- <classpathElement>
+ <element>
<groupId>org.apache.geronimo.modules</groupId>
<artifactId>geronimo-common</artifactId>
<version>${pom.version}</version>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>org.apache.geronimo.modules</groupId>
<artifactId>geronimo-kernel</artifactId>
<version>${pom.version}</version>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>org.apache.geronimo.modules</groupId>
<artifactId>geronimo-system</artifactId>
<version>${pom.version}</version>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>org.apache.geronimo.modules</groupId>
<artifactId>geronimo-util</artifactId>
<version>${pom.version}</version>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-qname_1.1_spec</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>mx4j</groupId>
<artifactId>mx4j</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>mx4j</groupId>
<artifactId>mx4j-remote</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>cglib</groupId>
<artifactId>cglib-nodep</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>jline</groupId>
<artifactId>jline</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>xpp3</groupId>
<artifactId>xpp3</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>xstream</groupId>
<artifactId>xstream</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>backport-util-concurrent</groupId>
<artifactId>backport-util-concurrent</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>concurrent</groupId>
<artifactId>concurrent</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<classpathPrefix>../lib/endorsed</classpathPrefix>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>xerces</groupId>
<artifactId>xmlParserAPIs</artifactId>
<classpathPrefix>../lib/endorsed</classpathPrefix>
- </classpathElement>
+ </element>
</classpath>
<classpathPrefix>../lib</classpathPrefix>
</configuration>
Modified: geronimo/trunk/configs/online-deployer/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/trunk/configs/online-deployer/pom.xml?rev=433765&r1=433764&r2=433765&view=diff
==============================================================================
--- geronimo/trunk/configs/online-deployer/pom.xml (original)
+++ geronimo/trunk/configs/online-deployer/pom.xml Tue Aug 22 14:40:42 2006
@@ -58,91 +58,91 @@
NOTE: This list of dependencies is non-transitive.
-->
<classpath>
- <classpathElement>
+ <element>
<groupId>org.apache.geronimo.modules</groupId>
<artifactId>geronimo-common</artifactId>
<version>${pom.version}</version>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>org.apache.geronimo.modules</groupId>
<artifactId>geronimo-kernel</artifactId>
<version>${pom.version}</version>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>org.apache.geronimo.modules</groupId>
<artifactId>geronimo-system</artifactId>
<version>${pom.version}</version>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>org.apache.geronimo.modules</groupId>
<artifactId>geronimo-util</artifactId>
<version>${pom.version}</version>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>org.apache.geronimo.modules</groupId>
<artifactId>geronimo-deployment</artifactId>
<version>${pom.version}</version>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>org.apache.geronimo.modules</groupId>
<artifactId>geronimo-deploy-jsr88</artifactId>
<version>${pom.version}</version>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>org.apache.geronimo.modules</groupId>
<artifactId>geronimo-deploy-tool</artifactId>
<version>${pom.version}</version>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-j2ee-deployment_1.1_spec</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>mx4j</groupId>
<artifactId>mx4j</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>mx4j</groupId>
<artifactId>mx4j-remote</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>cglib</groupId>
<artifactId>cglib-nodep</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>jline</groupId>
<artifactId>jline</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>xpp3</groupId>
<artifactId>xpp3</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>xstream</groupId>
<artifactId>xstream</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<classpathPrefix>../lib/endorsed</classpathPrefix>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>xerces</groupId>
<artifactId>xmlParserAPIs</artifactId>
<classpathPrefix>../lib/endorsed</classpathPrefix>
- </classpathElement>
+ </element>
</classpath>
<classpathPrefix>../lib</classpathPrefix>
</configuration>
Modified: geronimo/trunk/configs/shutdown/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/trunk/configs/shutdown/pom.xml?rev=433765&r1=433764&r2=433765&view=diff
==============================================================================
--- geronimo/trunk/configs/shutdown/pom.xml (original)
+++ geronimo/trunk/configs/shutdown/pom.xml Tue Aug 22 14:40:42 2006
@@ -58,59 +58,59 @@
NOTE: This list of dependencies is non-transitive.
-->
<classpath>
- <classpathElement>
+ <element>
<groupId>org.apache.geronimo.modules</groupId>
<artifactId>geronimo-deploy-tool</artifactId>
<version>${pom.version}</version>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>org.apache.geronimo.modules</groupId>
<artifactId>geronimo-common</artifactId>
<version>${pom.version}</version>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>org.apache.geronimo.modules</groupId>
<artifactId>geronimo-kernel</artifactId>
<version>${pom.version}</version>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>org.apache.geronimo.modules</groupId>
<artifactId>geronimo-system</artifactId>
<version>${pom.version}</version>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>org.apache.geronimo.modules</groupId>
<artifactId>geronimo-util</artifactId>
<version>${pom.version}</version>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>mx4j</groupId>
<artifactId>mx4j</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>mx4j</groupId>
<artifactId>mx4j-remote</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>cglib</groupId>
<artifactId>cglib-nodep</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
- </classpathElement>
- <classpathElement>
+ </element>
+ <element>
<groupId>jline</groupId>
<artifactId>jline</artifactId>
- </classpathElement>
+ </element>
</classpath>
<classpathPrefix>../lib</classpathPrefix>
</configuration>
Modified: geronimo/trunk/m2-assemblies/geronimo-boilerplate-minimal/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/trunk/m2-assemblies/geronimo-boilerplate-minimal/pom.xml?rev=433765&r1=433764&r2=433765&view=diff
==============================================================================
--- geronimo/trunk/m2-assemblies/geronimo-boilerplate-minimal/pom.xml (original)
+++ geronimo/trunk/m2-assemblies/geronimo-boilerplate-minimal/pom.xml Tue Aug 22 14:40:42 2006
@@ -60,54 +60,53 @@
</goals>
<configuration>
<repositoryDirectory>${project.build.outputDirectory}/repository</repositoryDirectory>
-
<artifacts>
- <artifactItem>
+ <artifact>
<groupId>org.apache.geronimo.modules</groupId>
<artifactId>ge-activemq-rar</artifactId>
<version>${pom.version}</version>
<type>rar</type>
- </artifactItem>
+ </artifact>
- <artifactItem>
+ <artifact>
<groupId>tranql</groupId>
<artifactId>tranql-connector</artifactId>
<type>rar</type>
- </artifactItem>
+ </artifact>
- <artifactItem>
+ <artifact>
<groupId>tranql</groupId>
<artifactId>tranql-connector-derby-embed-local</artifactId>
<type>rar</type>
- </artifactItem>
+ </artifact>
- <artifactItem>
+ <artifact>
<groupId>tranql</groupId>
<artifactId>tranql-connector-derby-embed-xa</artifactId>
<type>rar</type>
- </artifactItem>
+ </artifact>
- <artifactItem>
+ <artifact>
<groupId>tranql</groupId>
<artifactId>tranql-connector-derby-client-local</artifactId>
<type>rar</type>
- </artifactItem>
+ </artifact>
- <artifactItem>
+ <artifact>
<groupId>tranql</groupId>
<artifactId>tranql-connector-derby-client-xa</artifactId>
<type>rar</type>
- </artifactItem>
+ </artifact>
- <artifactItem>
+ <artifact>
<groupId>org.apache.derby</groupId>
<artifactId>derbyclient</artifactId>
- </artifactItem>
+ </artifact>
- <artifactItem>
+ <artifact>
<groupId>org.apache.derby</groupId>
<artifactId>derbytools</artifactId>
- </artifactItem>
+ </artifact>
</artifacts>
</configuration>
</execution>
Modified: geronimo/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/AbstractCarMojo.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/AbstractCarMojo.java?rev=433765&r1=433764&r2=433765&view=diff
==============================================================================
--- geronimo/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/AbstractCarMojo.java (original)
+++ geronimo/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/AbstractCarMojo.java Tue Aug 22 14:40:42 2006
@@ -22,8 +22,6 @@
import org.apache.maven.project.MavenProjectHelper;
import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
import org.apache.maven.artifact.resolver.filter.ExcludesArtifactFilter;
-import org.apache.maven.artifact.resolver.ArtifactResolutionException;
-import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
import org.apache.maven.artifact.resolver.ArtifactResolver;
import org.apache.maven.artifact.versioning.VersionRange;
import org.apache.maven.artifact.Artifact;
@@ -31,7 +29,6 @@
import org.apache.maven.artifact.factory.ArtifactFactory;
import org.apache.maven.model.Dependency;
import org.apache.maven.model.Exclusion;
-import org.apache.maven.plugin.MojoExecutionException;
import java.io.File;
import java.io.IOException;
@@ -63,58 +60,63 @@
protected MavenProject project;
/**
- * Used to look up Artifacts in the remote repository.
+ * The basedir of the project.
*
- * @component
+ * @parameter expression="${basedir}"
* @required
* @readonly
*/
- protected ArtifactFactory factory;
+ protected File basedir;
/**
- * Used to look up Artifacts in the remote repository.
+ * The maven project's helper.
*
* @component
* @required
* @readonly
*/
- protected ArtifactResolver resolver;
+ protected MavenProjectHelper projectHelper;
- /**
- * Location of the local repository.
- *
- * @parameter expression="${localRepository}"
- * @readonly
- * @required
- */
- protected ArtifactRepository local;
+ //
+ // MojoSupport Hooks
+ //
+
+ protected MavenProject getProject() {
+ return project;
+ }
/**
- * List of Remote Repositories used by the resolver.
- *
- * @parameter expression="${project.remoteArtifactRepositories}"
- * @readonly
+ * @component
* @required
+ * @readonly
*/
- protected java.util.List remoteRepos;
+ private ArtifactFactory artifactFactory = null;
+
+ protected ArtifactFactory getArtifactFactory() {
+ return artifactFactory;
+ }
/**
- * The basedir of the project.
- *
- * @parameter expression="${basedir}"
+ * @component
* @required
* @readonly
*/
- protected File basedir;
+ private ArtifactResolver artifactResolver = null;
+
+ protected ArtifactResolver getArtifactResolver() {
+ return artifactResolver;
+ }
/**
- * The maven project's helper.
- *
- * @component
- * @required
+ * @parameter expression="${localRepository}"
* @readonly
+ * @required
*/
- protected MavenProjectHelper projectHelper;
+ protected ArtifactRepository artifactRepository = null;
+
+ protected ArtifactRepository getArtifactRepository() {
+ return artifactRepository;
+ }
protected Set getProjectArtifacts(final MavenProject project) {
Set artifacts = new HashSet();
@@ -138,7 +140,7 @@
scope = Artifact.SCOPE_COMPILE;
}
- Artifact artifact = factory.createDependencyArtifact(
+ Artifact artifact = getArtifactFactory().createDependencyArtifact(
groupId,
artifactId,
versionRange,
@@ -199,101 +201,5 @@
}
return new File(basedir, finalName + classifier + ".car");
- }
-
- //
- // NOTE: Bits below lifed from the maven-depndency-plugin
- //
-
- //
- // TODO: Replace with ArtifactItem and move to base-class
- //
-
- /**
- * Resolves the Artifact from the remote repository if nessessary. If no version is specified, it will
- * be retrieved from the dependency list or from the DependencyManagement section of the pom.
- */
- protected Artifact getArtifact(final ArtifactItem item) throws MojoExecutionException {
- Artifact artifact;
-
- if (item.getVersion() == null) {
- fillMissingArtifactVersion(item);
-
- if (item.getVersion() == null) {
- throw new MojoExecutionException("Unable to find artifact version of " + item.getGroupId()
- + ":" + item.getArtifactId() + " in either dependency list or in project's dependency management.");
- }
-
- }
-
- String classifier = item.getClassifier();
- if (classifier == null || classifier.equals("")) {
- artifact = factory.createArtifact(
- item.getGroupId(),
- item.getArtifactId(),
- item.getVersion(),
- Artifact.SCOPE_PROVIDED,
- item.getType());
- }
- else {
- artifact = factory.createArtifactWithClassifier(
- item.getGroupId(),
- item.getArtifactId(),
- item.getVersion(),
- item.getType(),
- item.getClassifier());
- }
-
- try {
- resolver.resolve(artifact, remoteRepos, local);
- }
- catch (ArtifactResolutionException e) {
- throw new MojoExecutionException("Unable to resolve artifact.", e);
- }
- catch (ArtifactNotFoundException e) {
- throw new MojoExecutionException("Unable to find artifact.", e);
- }
-
- return artifact;
- }
-
- /**
- * Tries to find missing version from dependancy list and dependency management.
- * If found, the artifact is updated with the correct version.
- */
- private void fillMissingArtifactVersion(final ArtifactItem item) {
- log.debug("Attempting to find missing version in " + item.getGroupId() + ":" + item.getArtifactId());
-
- List list = this.project.getDependencies();
-
- for (int i = 0; i < list.size(); ++i) {
- Dependency dependency = (Dependency) list.get(i);
-
- if (dependency.getGroupId().equals(item.getGroupId())
- && dependency.getArtifactId().equals(item.getArtifactId())
- && dependency.getType().equals(item.getType()))
- {
- log.debug("Found missing version: " + dependency.getVersion() + " in dependency list.");
-
- item.setVersion(dependency.getVersion());
-
- return;
- }
- }
-
- list = this.project.getDependencyManagement().getDependencies();
-
- for (int i = 0; i < list.size(); i++) {
- Dependency dependency = (Dependency) list.get(i);
-
- if (dependency.getGroupId().equals(item.getGroupId())
- && dependency.getArtifactId().equals(item.getArtifactId())
- && dependency.getType().equals(item.getType()))
- {
- log.debug("Found missing version: " + dependency.getVersion() + " in dependency management list");
-
- item.setVersion(dependency.getVersion());
- }
- }
}
}
Modified: geronimo/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/ClasspathElement.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/ClasspathElement.java?rev=433765&r1=433764&r2=433765&view=diff
==============================================================================
--- geronimo/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/ClasspathElement.java (original)
+++ geronimo/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/ClasspathElement.java Tue Aug 22 14:40:42 2006
@@ -16,6 +16,8 @@
package org.apache.geronimo.plugin.car;
+import org.apache.geronimo.plugin.ArtifactItem;
+
/**
* Represents a Maven-artifact with additional classparh prefix details to build a jar's Manifest Class-Path.
*
Modified: geronimo/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/InstallArtifactsMojo.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/InstallArtifactsMojo.java?rev=433765&r1=433764&r2=433765&view=diff
==============================================================================
--- geronimo/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/InstallArtifactsMojo.java (original)
+++ geronimo/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/InstallArtifactsMojo.java Tue Aug 22 14:40:42 2006
@@ -18,14 +18,13 @@
import org.apache.geronimo.kernel.repository.WriteableRepository;
import org.apache.geronimo.system.repository.Maven2Repository;
+import org.apache.geronimo.plugin.ArtifactItem;
+
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.artifact.Artifact;
import java.io.File;
-import java.util.List;
-import java.util.Iterator;
-
/**
* Installs one or more artifacts into a local Geronimo repository.
*
@@ -45,12 +44,12 @@
private File repositoryDirectory = null;
/**
- * A list of {@link ArtifactItem} instances to be installed into the repository.
+ * A array {@link ArtifactItem} instances to be installed into the repository.
*
* @parameter
* @required
*/
- private List artifacts = null;
+ private ArtifactItem[] artifacts = null;
/**
* Flag to indicate that if an artifact exists already, that we should delete it and re-install.
@@ -71,12 +70,9 @@
WriteableRepository repository = new Maven2Repository(repositoryDirectory);
// Install all of the artifacts we were asked to...
- Iterator iter = artifacts.iterator();
- while (iter.hasNext()) {
- ArtifactItem item = (ArtifactItem)iter.next();
- log.info("Installing: " + item);
-
- Artifact artifact = getArtifact(item);
+ for (int i=0; i<artifacts.length; i++) {
+ Artifact artifact = getArtifact(artifacts[i]);
+ log.info("Installing: " + artifact);
org.apache.geronimo.kernel.repository.Artifact gartifact = mavenArtifactToGeronimo(artifact);
if (repository.contains(gartifact)) {
@@ -85,11 +81,11 @@
log.debug("Force deletion of: " + file);
if (!file.delete()) {
- throw new MojoExecutionException("Failed to delete artifact from repository: " + item);
+ throw new MojoExecutionException("Failed to delete artifact from repository: " + artifacts[i]);
}
}
else {
- throw new MojoExecutionException("Artifact already exists in repository: " + item);
+ throw new MojoExecutionException("Artifact already exists in repository: " + artifacts[i]);
}
}
Modified: geronimo/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/PackageMojo.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/PackageMojo.java?rev=433765&r1=433764&r2=433765&view=diff
==============================================================================
--- geronimo/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/PackageMojo.java (original)
+++ geronimo/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/PackageMojo.java Tue Aug 22 14:40:42 2006
@@ -18,12 +18,13 @@
package org.apache.geronimo.plugin.car;
import java.io.File;
+import java.net.URI;
+
import java.util.ArrayList;
import java.util.List;
import java.util.Iterator;
import java.util.Set;
import java.util.HashSet;
-import java.net.URI;
import org.apache.geronimo.deployment.PluginBootstrap2;
import org.apache.geronimo.system.configuration.RepositoryConfigurationStore;
@@ -45,6 +46,7 @@
import org.apache.geronimo.gbean.GBeanInfo;
import org.apache.geronimo.gbean.ReferencePatterns;
import org.apache.geronimo.gbean.AbstractNameQuery;
+import org.apache.geronimo.plugin.ArtifactItem;
import org.apache.maven.archiver.MavenArchiveConfiguration;
import org.apache.maven.archiver.MavenArchiver;
@@ -142,7 +144,7 @@
*
* @parameter
*/
- private ArrayList deploymentConfigs;
+ private List deploymentConfigs;
/**
* The name of the deployer which will be used to deploy the CAR.
@@ -185,7 +187,7 @@
private File explicitResolutionProperties = null;
/**
- * A list of {@link ClasspathElement} objects which will be used to construct the
+ * An array of {@link ClasspathElement} objects which will be used to construct the
* Class-Path entry of the manifest.
*
* This is needed to allow per-element prefixes to be added, which the standard Maven archiver
@@ -193,7 +195,7 @@
*
* @parameter
*/
- private List classpath = null;
+ private ClasspathElement[] classpath = null;
/**
* The default prefix to be applied to all elements of the <tt>classpath</tt> which
@@ -255,9 +257,9 @@
//
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");
+ dir = new File(dir, project.getArtifactId());
+ dir = new File(dir, project.getVersion());
+ dir = new File(dir, project.getArtifactId() + "-" + project.getVersion() + ".car");
return dir;
}
@@ -313,15 +315,14 @@
private String getClassPath() throws MojoExecutionException {
StringBuffer buff = new StringBuffer();
- ClasspathElement[] elements = (ClasspathElement[]) classpath.toArray(new ClasspathElement[classpath.size()]);
- for (int i=0; i < elements.length; i++) {
- Artifact artifact = getArtifact(elements[i]);
+ for (int i=0; i < classpath.length; i++) {
+ Artifact artifact = getArtifact(classpath[i]);
//
// TODO: Need to optionally get all transitive dependencies... but dunno how to get that intel from m2
//
- String prefix = elements[i].getClasspathPrefix();
+ String prefix = classpath[i].getClasspathPrefix();
if (prefix == null) {
prefix = classpathPrefix;
}
@@ -337,7 +338,7 @@
File file = artifact.getFile();
buff.append(file.getName());
- if (i + 1< elements.length) {
+ if (i + 1< classpath.length) {
buff.append(" ");
}
}