geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r431523 - in /geronimo/trunk: ./ configs/activemq/ configs/console-jetty/ configs/console-tomcat/ configs/jsp-examples-jetty/ configs/jsp-examples-tomcat/ configs/ldap-demo-jetty/ configs/ldap-demo-tomcat/ configs/remote-deploy-jetty/ confi...
Date Tue, 15 Aug 2006 04:02:49 GMT
Author: jdillon
Date: Mon Aug 14 21:02:48 2006
New Revision: 431523

URL: http://svn.apache.org/viewvc?rev=431523&view=rev
Log:
Added <module> which is basically a maven dependency def to replace <moduleFile>
and reuse the build intel; module ends up setting moduleFile
Moved some common artifact dep handling to AbtractCarMojo
Trimmed a few more properties from the root pom

Added:
    geronimo/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/ArtifactItem.java
  (with props)
Modified:
    geronimo/trunk/configs/activemq/pom.xml
    geronimo/trunk/configs/console-jetty/pom.xml
    geronimo/trunk/configs/console-tomcat/pom.xml
    geronimo/trunk/configs/jsp-examples-jetty/pom.xml
    geronimo/trunk/configs/jsp-examples-tomcat/pom.xml
    geronimo/trunk/configs/ldap-demo-jetty/pom.xml
    geronimo/trunk/configs/ldap-demo-tomcat/pom.xml
    geronimo/trunk/configs/remote-deploy-jetty/pom.xml
    geronimo/trunk/configs/remote-deploy-tomcat/pom.xml
    geronimo/trunk/configs/servlets-examples-jetty/pom.xml
    geronimo/trunk/configs/servlets-examples-tomcat/pom.xml
    geronimo/trunk/configs/system-database/pom.xml
    geronimo/trunk/configs/welcome-jetty/pom.xml
    geronimo/trunk/configs/welcome-tomcat/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/PackageMojo.java
    geronimo/trunk/pom.xml

Modified: geronimo/trunk/configs/activemq/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/trunk/configs/activemq/pom.xml?rev=431523&r1=431522&r2=431523&view=diff
==============================================================================
--- geronimo/trunk/configs/activemq/pom.xml (original)
+++ geronimo/trunk/configs/activemq/pom.xml Mon Aug 14 21:02:48 2006
@@ -72,7 +72,12 @@
                         <deploymentConfig>${openejbDeployer}</deploymentConfig>
                         <deploymentConfig>${axisDeployer}</deploymentConfig>
                     </deploymentConfigs>
-                   <moduleFile>${settings.localRepository}/org/apache/geronimo/modules/ge-activemq-rar/${pom.version}/ge-activemq-rar-${pom.version}.rar</moduleFile>

+                    <module>
+                        <groupId>org.apache.geronimo.modules</groupId>
+                        <artifactId>ge-activemq-rar</artifactId>
+                        <version>${pom.version}</version>
+                        <type>rar</type>
+                    </module>
                 </configuration>
             </plugin>
         </plugins>

Modified: geronimo/trunk/configs/console-jetty/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/trunk/configs/console-jetty/pom.xml?rev=431523&r1=431522&r2=431523&view=diff
==============================================================================
--- geronimo/trunk/configs/console-jetty/pom.xml (original)
+++ geronimo/trunk/configs/console-jetty/pom.xml Mon Aug 14 21:02:48 2006
@@ -209,7 +209,12 @@
                         <deploymentConfig>${openejbDeployer}</deploymentConfig>
                         <deploymentConfig>${axisDeployer}</deploymentConfig>
                     </deploymentConfigs>
-                    <moduleFile>${settings.localRepository}/org/apache/geronimo/applications/console/geronimo-console/${pom.version}/geronimo-console-${pom.version}.ear</moduleFile>
+                    <module>
+                        <groupId>org.apache.geronimo.applications.console</groupId>
+                        <artifactId>geronimo-console</artifactId>
+                        <version>${pom.version}</version>
+                        <type>ear</type>
+                    </module>
                 </configuration>
             </plugin>
         </plugins>

Modified: geronimo/trunk/configs/console-tomcat/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/trunk/configs/console-tomcat/pom.xml?rev=431523&r1=431522&r2=431523&view=diff
==============================================================================
--- geronimo/trunk/configs/console-tomcat/pom.xml (original)
+++ geronimo/trunk/configs/console-tomcat/pom.xml Mon Aug 14 21:02:48 2006
@@ -209,7 +209,12 @@
                         <deploymentConfig>${openejbDeployer}</deploymentConfig>
                         <deploymentConfig>${axisDeployer}</deploymentConfig>
                     </deploymentConfigs>
-                    <moduleFile>${settings.localRepository}/org/apache/geronimo/applications/console/geronimo-console/${pom.version}/geronimo-console-${pom.version}.ear</moduleFile>
+                    <module>
+                        <groupId>org.apache.geronimo.applications.console</groupId>
+                        <artifactId>geronimo-console</artifactId>
+                        <version>${pom.version}</version>
+                        <type>ear</type>
+                    </module>
                 </configuration>
             </plugin>
         </plugins>

Modified: geronimo/trunk/configs/jsp-examples-jetty/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/trunk/configs/jsp-examples-jetty/pom.xml?rev=431523&r1=431522&r2=431523&view=diff
==============================================================================
--- geronimo/trunk/configs/jsp-examples-jetty/pom.xml (original)
+++ geronimo/trunk/configs/jsp-examples-jetty/pom.xml Mon Aug 14 21:02:48 2006
@@ -81,7 +81,11 @@
                         <deploymentConfig>${openejbDeployer}</deploymentConfig>
                         <deploymentConfig>${axisDeployer}</deploymentConfig>
                     </deploymentConfigs>
-                    <moduleFile>${settings.localRepository}/geronimo-samples/geronimo-jsp-examples-tomcat/${tomcatVersion}/geronimo-jsp-examples-tomcat-${tomcatVersion}.war</moduleFile>
+                    <module>
+                        <groupId>geronimo-samples</groupId>
+                        <artifactId>geronimo-jsp-examples-tomcat</artifactId>
+                        <type>war</type>
+                    </module>
                 </configuration>
             </plugin>
         </plugins>

Modified: geronimo/trunk/configs/jsp-examples-tomcat/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/trunk/configs/jsp-examples-tomcat/pom.xml?rev=431523&r1=431522&r2=431523&view=diff
==============================================================================
--- geronimo/trunk/configs/jsp-examples-tomcat/pom.xml (original)
+++ geronimo/trunk/configs/jsp-examples-tomcat/pom.xml Mon Aug 14 21:02:48 2006
@@ -76,7 +76,11 @@
                         <deploymentConfig>${openejbDeployer}</deploymentConfig>
                         <deploymentConfig>${axisDeployer}</deploymentConfig>
                     </deploymentConfigs>
-                    <moduleFile>${settings.localRepository}/geronimo-samples/geronimo-jsp-examples-tomcat/${tomcatVersion}/geronimo-jsp-examples-tomcat-${tomcatVersion}.war</moduleFile>
+                    <module>
+                        <groupId>geronimo-samples</groupId>
+                        <artifactId>geronimo-jsp-examples-tomcat</artifactId>
+                        <type>war</type>
+                    </module>
                 </configuration>
             </plugin>
         </plugins>

Modified: geronimo/trunk/configs/ldap-demo-jetty/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/trunk/configs/ldap-demo-jetty/pom.xml?rev=431523&r1=431522&r2=431523&view=diff
==============================================================================
--- geronimo/trunk/configs/ldap-demo-jetty/pom.xml (original)
+++ geronimo/trunk/configs/ldap-demo-jetty/pom.xml Mon Aug 14 21:02:48 2006
@@ -77,7 +77,12 @@
                         <deploymentConfig>${openejbDeployer}</deploymentConfig>
                         <deploymentConfig>${axisDeployer}</deploymentConfig>
                     </deploymentConfigs>
-                    <moduleFile>${settings.localRepository}/org/apache/geronimo/applications/geronimo-ldap-demo/${pom.version}/geronimo-ldap-demo-${pom.version}.war</moduleFile>
+                    <module>
+                        <groupId>org.apache.geronimo.applications</groupId>
+                        <artifactId>geronimo-ldap-demo</artifactId>
+                        <version>${pom.version}</version>
+                        <type>war</type>
+                    </module>
                 </configuration>
             </plugin>
         </plugins>

Modified: geronimo/trunk/configs/ldap-demo-tomcat/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/trunk/configs/ldap-demo-tomcat/pom.xml?rev=431523&r1=431522&r2=431523&view=diff
==============================================================================
--- geronimo/trunk/configs/ldap-demo-tomcat/pom.xml (original)
+++ geronimo/trunk/configs/ldap-demo-tomcat/pom.xml Mon Aug 14 21:02:48 2006
@@ -77,7 +77,12 @@
                         <deploymentConfig>${openejbDeployer}</deploymentConfig>
                         <deploymentConfig>${axisDeployer}</deploymentConfig>
                     </deploymentConfigs>
-                    <moduleFile>${settings.localRepository}/org/apache/geronimo/applications/geronimo-ldap-demo/${pom.version}/geronimo-ldap-demo-${pom.version}.war</moduleFile>
+                    <module>
+                        <groupId>org.apache.geronimo.applications</groupId>
+                        <artifactId>geronimo-ldap-demo</artifactId>
+                        <version>${pom.version}</version>
+                        <type>war</type>
+                    </module>
                 </configuration>
             </plugin>
         </plugins>

Modified: geronimo/trunk/configs/remote-deploy-jetty/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/trunk/configs/remote-deploy-jetty/pom.xml?rev=431523&r1=431522&r2=431523&view=diff
==============================================================================
--- geronimo/trunk/configs/remote-deploy-jetty/pom.xml (original)
+++ geronimo/trunk/configs/remote-deploy-jetty/pom.xml Mon Aug 14 21:02:48 2006
@@ -62,7 +62,12 @@
                         <deploymentConfig>${openejbDeployer}</deploymentConfig>
                         <deploymentConfig>${axisDeployer}</deploymentConfig>
                     </deploymentConfigs>
-                    <moduleFile>${settings.localRepository}/org/apache/geronimo/applications/geronimo-remote-deploy/${pom.version}/geronimo-remote-deploy-${pom.version}.war</moduleFile>
+                    <module>
+                        <groupId>org.apache.geronimo.applications</groupId>
+                        <artifactId>geronimo-remote-deploy</artifactId>
+                        <version>${pom.version}</version>
+                        <type>war</type>
+                    </module>
                 </configuration>
             </plugin>
         </plugins>

Modified: geronimo/trunk/configs/remote-deploy-tomcat/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/trunk/configs/remote-deploy-tomcat/pom.xml?rev=431523&r1=431522&r2=431523&view=diff
==============================================================================
--- geronimo/trunk/configs/remote-deploy-tomcat/pom.xml (original)
+++ geronimo/trunk/configs/remote-deploy-tomcat/pom.xml Mon Aug 14 21:02:48 2006
@@ -62,7 +62,12 @@
                         <deploymentConfig>${openejbDeployer}</deploymentConfig>
                         <deploymentConfig>${axisDeployer}</deploymentConfig>
                     </deploymentConfigs>
-                    <moduleFile>${settings.localRepository}/org/apache/geronimo/applications/geronimo-remote-deploy/${pom.version}/geronimo-remote-deploy-${pom.version}.war</moduleFile>
+                    <module>
+                        <groupId>org.apache.geronimo.applications</groupId>
+                        <artifactId>geronimo-remote-deploy</artifactId>
+                        <version>${pom.version}</version>
+                        <type>war</type>
+                    </module>
                 </configuration>
             </plugin>
         </plugins>

Modified: geronimo/trunk/configs/servlets-examples-jetty/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/trunk/configs/servlets-examples-jetty/pom.xml?rev=431523&r1=431522&r2=431523&view=diff
==============================================================================
--- geronimo/trunk/configs/servlets-examples-jetty/pom.xml (original)
+++ geronimo/trunk/configs/servlets-examples-jetty/pom.xml Mon Aug 14 21:02:48 2006
@@ -90,7 +90,11 @@
                         <deploymentConfig>${openejbDeployer}</deploymentConfig>
                         <deploymentConfig>${axisDeployer}</deploymentConfig>
                     </deploymentConfigs>
-                    <moduleFile>${settings.localRepository}/geronimo-samples/geronimo-servlet-examples-tomcat/${tomcatVersion}/geronimo-servlet-examples-tomcat-${tomcatVersion}.war</moduleFile>
+                    <module>
+                        <groupId>geronimo-samples</groupId>
+                        <artifactId>geronimo-servlet-examples-tomcat</artifactId>
+                        <type>war</type>
+                    </module>
                 </configuration>
             </plugin>
         </plugins>

Modified: geronimo/trunk/configs/servlets-examples-tomcat/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/trunk/configs/servlets-examples-tomcat/pom.xml?rev=431523&r1=431522&r2=431523&view=diff
==============================================================================
--- geronimo/trunk/configs/servlets-examples-tomcat/pom.xml (original)
+++ geronimo/trunk/configs/servlets-examples-tomcat/pom.xml Mon Aug 14 21:02:48 2006
@@ -90,7 +90,11 @@
                         <deploymentConfig>${openejbDeployer}</deploymentConfig>
                         <deploymentConfig>${axisDeployer}</deploymentConfig>
                     </deploymentConfigs>
-                    <moduleFile>${settings.localRepository}/geronimo-samples/geronimo-servlet-examples-tomcat/${tomcatVersion}/geronimo-servlet-examples-tomcat-${tomcatVersion}.war</moduleFile>
+                    <module>
+                        <groupId>geronimo-samples</groupId>
+                        <artifactId>geronimo-servlet-examples-tomcat</artifactId>
+                        <type>war</type>
+                    </module>
                 </configuration>
             </plugin>
         </plugins>

Modified: geronimo/trunk/configs/system-database/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/trunk/configs/system-database/pom.xml?rev=431523&r1=431522&r2=431523&view=diff
==============================================================================
--- geronimo/trunk/configs/system-database/pom.xml (original)
+++ geronimo/trunk/configs/system-database/pom.xml Mon Aug 14 21:02:48 2006
@@ -111,7 +111,11 @@
                         <deploymentConfig>${openejbDeployer}</deploymentConfig>
                         <deploymentConfig>${axisDeployer}</deploymentConfig>
                     </deploymentConfigs>
-                    <moduleFile>${settings.localRepository}/tranql/tranql-connector-derby-embed-xa/${tranqlVendorsVersion}/tranql-connector-derby-embed-xa-${tranqlVendorsVersion}.rar</moduleFile>
+                    <module>
+                        <groupId>tranql</groupId>
+                        <artifactId>tranql-connector-derby-embed-xa</artifactId>
+                        <type>rar</type>
+                    </module>
                 </configuration>
             </plugin>
         </plugins>

Modified: geronimo/trunk/configs/welcome-jetty/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/trunk/configs/welcome-jetty/pom.xml?rev=431523&r1=431522&r2=431523&view=diff
==============================================================================
--- geronimo/trunk/configs/welcome-jetty/pom.xml (original)
+++ geronimo/trunk/configs/welcome-jetty/pom.xml Mon Aug 14 21:02:48 2006
@@ -77,7 +77,12 @@
                         <deploymentConfig>${openejbDeployer}</deploymentConfig>
                         <deploymentConfig>${axisDeployer}</deploymentConfig>
                     </deploymentConfigs>
-                    <moduleFile>${settings.localRepository}/org/apache/geronimo/applications/geronimo-welcome/${pom.version}/geronimo-welcome-${pom.version}.war</moduleFile>
+                    <module>
+                        <groupId>org.apache.geronimo.applications</groupId>
+                        <artifactId>geronimo-welcome</artifactId>
+                        <version>${pom.version}</version>
+                        <type>war</type>
+                    </module>
                 </configuration>
             </plugin>
         </plugins>

Modified: geronimo/trunk/configs/welcome-tomcat/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/trunk/configs/welcome-tomcat/pom.xml?rev=431523&r1=431522&r2=431523&view=diff
==============================================================================
--- geronimo/trunk/configs/welcome-tomcat/pom.xml (original)
+++ geronimo/trunk/configs/welcome-tomcat/pom.xml Mon Aug 14 21:02:48 2006
@@ -77,7 +77,12 @@
                         <deploymentConfig>${openejbDeployer}</deploymentConfig>
                         <deploymentConfig>${axisDeployer}</deploymentConfig>
                     </deploymentConfigs>
-                    <moduleFile>${settings.localRepository}/org/apache/geronimo/applications/geronimo-welcome/${pom.version}/geronimo-welcome-${pom.version}.war</moduleFile>
+                    <module>
+                        <groupId>org.apache.geronimo.applications</groupId>
+                        <artifactId>geronimo-welcome</artifactId>
+                        <version>${pom.version}</version>
+                        <type>war</type>
+                    </module>
                 </configuration>
             </plugin>
         </plugins>

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=431523&r1=431522&r2=431523&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
Mon Aug 14 21:02:48 2006
@@ -22,11 +22,16 @@
 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;
+import org.apache.maven.artifact.repository.ArtifactRepository;
 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;
@@ -58,6 +63,42 @@
     protected MavenProject project;
 
     /**
+     * Used to look up Artifacts in the remote repository.
+     *
+     * @parameter expression="${component.org.apache.maven.artifact.factory.ArtifactFactory}"
+     * @required
+     * @readonly
+     */
+    protected ArtifactFactory factory;
+
+    /**
+     * Used to look up Artifacts in the remote repository.
+     *
+     * @parameter expression="${component.org.apache.maven.artifact.resolver.ArtifactResolver}"
+     * @required
+     * @readonly
+     */
+    protected ArtifactResolver resolver;
+
+    /**
+     * Location of the local repository.
+     *
+     * @parameter expression="${localRepository}"
+     * @readonly
+     * @required
+     */
+    protected ArtifactRepository local;
+
+    /**
+     * List of Remote Repositories used by the resolver.
+     *
+     * @parameter expression="${project.remoteArtifactRepositories}"
+     * @readonly
+     * @required
+     */
+    protected java.util.List remoteRepos;
+
+    /**
      * The basedir of the project.
      *
      * @parameter expression="${basedir}"
@@ -165,5 +206,101 @@
         }
 
         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());
+            }
+        }
     }
 }

Added: geronimo/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/ArtifactItem.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/ArtifactItem.java?rev=431523&view=auto
==============================================================================
--- geronimo/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/ArtifactItem.java
(added)
+++ geronimo/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/ArtifactItem.java
Mon Aug 14 21:02:48 2006
@@ -0,0 +1,144 @@
+/**
+ *  Copyright 2006 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.plugin.car;
+
+import org.apache.maven.artifact.Artifact;
+
+/**
+ * Represents a Maven-artifact.
+ *
+ * @version $Rev:385659 $ $Date$
+ */
+public class ArtifactItem
+{
+    /**
+     * Group Id of artifact.
+     *
+     * @parameter
+     * @required
+     */
+    private String groupId;
+
+    /**
+     * Name of artifact.
+     *
+     * @parameter
+     * @required
+     */
+    private String artifactId;
+
+    /**
+     * Version of artifact.
+     *
+     * @parameter
+     */
+    private String version = null;
+
+    /**
+     * Type of artifact.
+     *
+     * @parameter
+     * @required
+     */
+    private String type = "jar";
+
+    /**
+     * Classifier for artifact.
+     *
+     * @parameter
+     */
+    private String classifier;
+
+    /**
+     * Artifact Item
+     */
+    private Artifact artifact;
+
+    public String toString() {
+        return groupId + ":" + artifactId + ":" + classifier + ":" + version + ":" + type;
+    }
+
+    /**
+     * @return Returns the artifactId.
+     */
+    public String getArtifactId() {
+        return artifactId;
+    }
+
+    /**
+     * @param artifactId The artifactId to set.
+     */
+    public void setArtifactId(final String artifactId) {
+        this.artifactId = artifactId;
+    }
+
+    /**
+     * @return Returns the groupId.
+     */
+    public String getGroupId() {
+        return groupId;
+    }
+
+    /**
+     * @param groupId The groupId to set.
+     */
+    public void setGroupId(final String groupId) {
+        this.groupId = groupId;
+    }
+
+    /**
+     * @return Returns the type.
+     */
+    public String getType() {
+        return type;
+    }
+
+    /**
+     * @param type The type to set.
+     */
+    public void setType(final String type) {
+        this.type = type;
+    }
+
+    /**
+     * @return Returns the version.
+     */
+    public String getVersion() {
+        return version;
+    }
+
+    /**
+     * @param version The version to set.
+     */
+    public void setVersion(final String version) {
+        this.version = version;
+    }
+
+    /**
+     * @return Classifier.
+     */
+    public String getClassifier() {
+        return classifier;
+    }
+
+    /**
+     * @param classifier Classifier.
+     */
+    public void setClassifier(final String classifier) {
+        this.classifier = classifier;
+    }
+}

Propchange: geronimo/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/ArtifactItem.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/ArtifactItem.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: geronimo/trunk/m2-plugins/car-maven-plugin/src/main/java/org/apache/geronimo/plugin/car/ArtifactItem.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

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=431523&r1=431522&r2=431523&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
Mon Aug 14 21:02:48 2006
@@ -16,54 +16,15 @@
 
 package org.apache.geronimo.plugin.car;
 
-import org.apache.maven.artifact.Artifact;
-
 /**
- * Builds a Geronimo Configuration using the local Maven infrastructure.
+ * Represents a Maven-artifact with additional classparh prefix details to build a jar's
Manifest Class-Path.
  *
  * @version $Rev:385659 $ $Date$
  */
 public class ClasspathElement
+    extends ArtifactItem
 {
     /**
-     * Group Id of artifact.
-     *
-     * @parameter
-     * @required
-     */
-    private String groupId;
-
-    /**
-     * Name of artifact.
-     *
-     * @parameter
-     * @required
-     */
-    private String artifactId;
-
-    /**
-     * Version of artifact.
-     *
-     * @parameter
-     */
-    private String version = null;
-
-    /**
-     * Type of artifact.
-     *
-     * @parameter
-     * @required
-     */
-    private String type = "jar";
-
-    /**
-     * Classifier for artifact.
-     *
-     * @parameter
-     */
-    private String classifier;
-
-    /**
      * Prefix to be prepended to the artifact, like <tt>../lib</tt>.
      *
      * @parameter
@@ -71,85 +32,6 @@
     private String classpathPrefix;
 
     /**
-     * Artifact Item
-     */
-    private Artifact artifact;
-
-    public String toString() {
-        return groupId + ":" + artifactId + ":" + classifier + ":" + version + ":" + type;
-    }
-
-    /**
-     * @return Returns the artifactId.
-     */
-    public String getArtifactId() {
-        return artifactId;
-    }
-
-    /**
-     * @param artifactId The artifactId to set.
-     */
-    public void setArtifactId(String artifactId) {
-        this.artifactId = artifactId;
-    }
-
-    /**
-     * @return Returns the groupId.
-     */
-    public String getGroupId() {
-        return groupId;
-    }
-
-    /**
-     * @param groupId The groupId to set.
-     */
-    public void setGroupId(String groupId) {
-        this.groupId = groupId;
-    }
-
-    /**
-     * @return Returns the type.
-     */
-    public String getType() {
-        return type;
-    }
-
-    /**
-     * @param type The type to set.
-     */
-    public void setType(String type) {
-        this.type = type;
-    }
-
-    /**
-     * @return Returns the version.
-     */
-    public String getVersion() {
-        return version;
-    }
-
-    /**
-     * @param version The version to set.
-     */
-    public void setVersion(String version) {
-        this.version = version;
-    }
-
-    /**
-     * @return Classifier.
-     */
-    public String getClassifier() {
-        return classifier;
-    }
-
-    /**
-     * @param classifier Classifier.
-     */
-    public void setClassifier(String classifier) {
-        this.classifier = classifier;
-    }
-
-    /**
      * @return Returns the classpath prefix.
      */
     public String getClasspathPrefix() {
@@ -159,7 +41,7 @@
     /**
      * @param classpathPrefix   The classpath prefix
      */
-    public void setClasspathPrefix(String classpathPrefix) {
+    public void setClasspathPrefix(final String classpathPrefix) {
         this.classpathPrefix = classpathPrefix;
     }
 }

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=431523&r1=431522&r2=431523&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
Mon Aug 14 21:02:48 2006
@@ -29,9 +29,6 @@
 import org.apache.maven.archiver.MavenArchiver;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.resolver.ArtifactResolutionException;
-import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
-import org.apache.maven.model.Dependency;
 
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.archiver.jar.JarArchiver;
@@ -70,42 +67,6 @@
     private JarArchiver jarArchiver = null;
 
     /**
-     * Used to look up Artifacts in the remote repository.
-     *
-     * @parameter expression="${component.org.apache.maven.artifact.factory.ArtifactFactory}"
-     * @required
-     * @readonly
-     */
-    protected org.apache.maven.artifact.factory.ArtifactFactory factory;
-
-    /**
-     * Used to look up Artifacts in the remote repository.
-     *
-     * @parameter expression="${component.org.apache.maven.artifact.resolver.ArtifactResolver}"
-     * @required
-     * @readonly
-     */
-    protected org.apache.maven.artifact.resolver.ArtifactResolver resolver;
-
-    /**
-     * Location of the local repository.
-     *
-     * @parameter expression="${localRepository}"
-     * @readonly
-     * @required
-     */
-    protected org.apache.maven.artifact.repository.ArtifactRepository local;
-
-    /**
-     * List of Remote Repositories used by the resolver.
-     *
-     * @parameter expression="${project.remoteArtifactRepositories}"
-     * @readonly
-     * @required
-     */
-    protected java.util.List remoteRepos;
-
-    /**
      * Directory containing the generated archive.
      *
      * @parameter expression="${project.build.directory}"
@@ -186,6 +147,13 @@
     private File moduleFile = null;
 
     /**
+     * ???
+     *
+     * @parameter
+     */
+    private ArtifactItem module = null;
+    
+    /**
      * The location where the properties mapping will be generated.
      *
      * @parameter expression="${project.build.directory}/explicit-versions.properties"
@@ -234,8 +202,15 @@
         }
         log.debug("Deployment configs: " + deploymentConfigs);
 
-        generateExplicitVersionProperties(explicitResolutionProperties);
+        // If module is set, then resolve the artifact and set moduleFile
+        if (module != null) {
+            Artifact artifact = getArtifact(module);
+            moduleFile = artifact.getFile();
+            log.debug("Using module file: " + moduleFile);
+        }
 
+        generateExplicitVersionProperties(explicitResolutionProperties);
+        
         if (bootstrap) {
             executeBootShell();
         }
@@ -371,97 +346,5 @@
         log.debug("Using classpath: " + buff);
 
         return buff.toString();
-    }
-
-    //
-    // NOTE: Bits below lifed from the maven-depndency-plugin
-    //
-
-    /**
-     * 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.
-     */
-    private Artifact getArtifact(final ClasspathElement element) throws MojoExecutionException
{
-        Artifact artifact;
-
-        if (element.getVersion() == null) {
-            fillMissingArtifactVersion(element);
-
-            if (element.getVersion() == null) {
-                throw new MojoExecutionException("Unable to find artifact version of " +
element.getGroupId()
-                    + ":" + element.getArtifactId() + " in either dependency list or in project's
dependency management.");
-            }
-
-        }
-
-        String classifier = element.getClassifier();
-        if (classifier == null || classifier.equals("")) {
-            artifact = factory.createArtifact(
-                    element.getGroupId(),
-                    element.getArtifactId(),
-                    element.getVersion(),
-                    Artifact.SCOPE_PROVIDED,
-                    element.getType());
-        }
-        else {
-            artifact = factory.createArtifactWithClassifier(
-                    element.getGroupId(),
-                    element.getArtifactId(),
-                    element.getVersion(),
-                    element.getType(),
-                    element.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 ClasspathElement element) {
-        log.debug("Attempting to find missing version in " + element.getGroupId() + ":" +
element.getArtifactId());
-
-        List list = this.project.getDependencies();
-
-        for (int i = 0; i < list.size(); ++i) {
-            Dependency dependency = (Dependency) list.get(i);
-
-            if (dependency.getGroupId().equals(element.getGroupId())
-                && dependency.getArtifactId().equals(element.getArtifactId())
-                && dependency.getType().equals(element.getType()))
-            {
-                log.debug("Found missing version: " + dependency.getVersion() + " in dependency
list.");
-
-                element.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(element.getGroupId())
-                && dependency.getArtifactId().equals(element.getArtifactId())
-                && dependency.getType().equals(element.getType()))
-            {
-                log.debug("Found missing version: " + dependency.getVersion() + " in dependency
management list");
-
-                element.setVersion(dependency.getVersion());
-            }
-        }
     }
 }

Modified: geronimo/trunk/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/trunk/pom.xml?rev=431523&r1=431522&r2=431523&view=diff
==============================================================================
--- geronimo/trunk/pom.xml (original)
+++ geronimo/trunk/pom.xml Mon Aug 14 21:02:48 2006
@@ -65,33 +65,22 @@
         <tomcatVersion>5.5.15</tomcatVersion>
         
         <!--
-        HACK: Used by system-database, uddi-jetty and uddi-tomcat configs.
-        -->
-        <tranqlVendorsVersion>1.1</tranqlVendorsVersion>
-        
-        <!--
-        HACK: USed by system to build product-versions.properties
+        HACK: Used by system to build product-versions.properties
         -->
         <openejbVersion>2.2-SNAPSHOT</openejbVersion>
         <activeMqVersion>3.2.4-SNAPSHOT</activeMqVersion>
         <tranqlVersion>1.4-SNAPSHOT</tranqlVersion>
         
         <!--
-        HACK: Used by tomcate-builder tests, needs to replace with dependency plugin
+        HACK: Used bu uddi-jetty and uddi-tomcat configs
         -->
-        <xercesVersion>2.6.2</xercesVersion>
-        <xmlApisVersion>1.0.b2</xmlApisVersion>
+        <tranqlVendorsVersion>1.1</tranqlVendorsVersion>
         
         <!--
-        HACK: Used by deps below... need to unwrap
+        HACK: Used by tomcate-builder tests, needs to replace with dependency plugin
         -->
-        <asn1Version>0.3.2</asn1Version>
-        <apachedsVersion>0.9.2</apachedsVersion>
-        <tomcatAjpVersion>5.5.15</tomcatAjpVersion>
-        <kerberosCommonVersion>0.5</kerberosCommonVersion>
-        <kerberosProtocolVersion>0.5</kerberosProtocolVersion>
-        <ldapProtocolVersion>0.9.2</ldapProtocolVersion>
-        <minaVersion>0.7.3</minaVersion>
+        <xercesVersion>2.6.2</xercesVersion>
+        <xmlApisVersion>1.0.b2</xmlApisVersion>
         
     </properties>
 
@@ -618,14 +607,14 @@
             <dependency>
                 <groupId>tranql</groupId>
                 <artifactId>tranql-connector-derby-embed-xa</artifactId>
-                <version>${tranqlVendorsVersion}</version>
+                <version>1.1</version>
                 <type>rar</type>
             </dependency>
 
             <dependency>
                 <groupId>tranql</groupId>
                 <artifactId>tranql-connector-derby-embed-local</artifactId>
-                <version>${tranqlVendorsVersion}</version>
+                <version>1.1</version>
                 <type>rar</type>
             </dependency>
 
@@ -658,25 +647,25 @@
             <dependency>
                 <groupId>directory</groupId>
                 <artifactId>apacheds-core</artifactId>
-                <version>${apachedsVersion}</version>
+                <version>0.9.2</version>
             </dependency>
             
             <dependency>
                 <groupId>directory</groupId>
                 <artifactId>apacheds-shared</artifactId>
-                <version>${apachedsVersion}</version>
+                <version>0.9.2</version>
             </dependency>
             
             <dependency>
                 <groupId>directory-asn1</groupId>
                 <artifactId>asn1-codec</artifactId>
-                <version>${asn1Version}</version>
+                <version>0.3.2</version>
             </dependency>
             
             <dependency>
                 <groupId>directory-asn1</groupId>
                 <artifactId>asn1-ber</artifactId>
-                <version>${asn1Version}</version>
+                <version>0.3.2</version>
                 <exclusions>
                     <!--
                     NOTE: Exclude commons-test, no needed for compile, not deployed into
any m2 repo.
@@ -692,43 +681,43 @@
             <dependency>
                 <groupId>directory-asn1</groupId>
                 <artifactId>asn1-der</artifactId>
-                <version>${asn1Version}</version>
+                <version>0.3.2</version>
             </dependency>
             
             <dependency>
                 <groupId>directory-shared</groupId>
                 <artifactId>apache-ldapber-provider</artifactId>
-                <version>${apachedsVersion}</version>
+                <version>0.9.2</version>
             </dependency>
             
             <dependency>
                 <groupId>directory-shared</groupId>
                 <artifactId>ldap-common</artifactId>
-                <version>${apachedsVersion}</version>
+                <version>0.9.2</version>
             </dependency>
             
             <dependency>
                 <groupId>directory-shared</groupId>
                 <artifactId>kerberos-common</artifactId>
-                <version>${kerberosCommonVersion}</version>
+                <version>0.5</version>
             </dependency>
             
             <dependency>
                 <groupId>directory-network</groupId>
                 <artifactId>mina</artifactId>
-                <version>${minaVersion}</version>
+                <version>0.7.3</version>
             </dependency>
             
             <dependency>
                 <groupId>directory-protocols</groupId>
                 <artifactId>kerberos-protocol</artifactId>
-                <version>${kerberosProtocolVersion}</version>
+                <version>0.5</version>
             </dependency>
             
             <dependency>
                 <groupId>directory-protocols</groupId>
                 <artifactId>ldap-protocol</artifactId>
-                <version>${ldapProtocolVersion}</version>
+                <version>0.9.2</version>
             </dependency>
             
             <dependency>
@@ -764,7 +753,7 @@
             <dependency>
                 <groupId>tomcat</groupId>
                 <artifactId>tomcat-ajp</artifactId>
-                <version>${tomcatAjpVersion}</version>
+                <version>5.5.15</version>
             </dependency>
             
             <dependency>



Mime
View raw message