-1, at least without some discussion.
One of the principles of geronimo is that we try to make components
independent where possible. For instance, we don't let the particular
implementation of Repository leak into other parts of the server.
This change firmly fixes our current repository structure into any
plugin that uses this new functionality and makes it impossible to run
such plugins on any other repository implementation.
thanks
david jencks
On Nov 18, 2008, at 8:33 AM, [EMAIL PROTECTED] wrote:
Author: gawor
Date: Tue Nov 18 08:33:38 2008
New Revision: 718644
URL: http://svn.apache.org/viewvc?rev=718644&view=rev
Log:
improve manifest classpath generation (GERONIMO-4417)
Modified:
geronimo/server/trunk/buildsupport/car-maven-plugin/src/main/java/
org/apache/geronimo/mavenplugins/car/ArchiveCarMojo.java
geronimo/server/trunk/buildsupport/car-maven-plugin/src/main/java/
org/apache/geronimo/mavenplugins/car/ClasspathElement.java
Modified: geronimo/server/trunk/buildsupport/car-maven-plugin/src/
main/java/org/apache/geronimo/mavenplugins/car/ArchiveCarMojo.java
URL:
http://svn.apache.org/viewvc/geronimo/server/trunk/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/ArchiveCarMojo.java?rev=718644&r1=718643&r2=718644&view=diff
=
=
=
=
=
=
=
=
======================================================================
--- geronimo/server/trunk/buildsupport/car-maven-plugin/src/main/
java/org/apache/geronimo/mavenplugins/car/ArchiveCarMojo.java
(original)
+++ geronimo/server/trunk/buildsupport/car-maven-plugin/src/main/
java/org/apache/geronimo/mavenplugins/car/ArchiveCarMojo.java Tue
Nov 18 08:33:38 2008
@@ -133,6 +133,19 @@
* @parameter
*/
private String classpathPrefix = null;
+
+ /**
+ * Generate classpath prefix based on the artifactId and
groupId. The generated classpath
+ * prefix will be in the following form:
+ * <tt>../repository/<groupId>/<artifactId>/
<version></tt>.
+ * This is the default setting applied to all elements of the
<tt>classpath</tt> which
+ * do not provide a prefix or do not set the
generateClasspathPrefix parameter. The
+ * classpath prefix will only be generated if the
<tt>classpathPrefix</tt> parameter is not
+ * set.
+ *
+ * @parameter
+ */
+ private boolean generateClasspathPrefix;
/**
* Location of resources directory for additional content to
include in the car.
@@ -243,7 +256,22 @@
String prefix = classpath[i].getClasspathPrefix();
if (prefix == null) {
- prefix = classpathPrefix;
+ Boolean generatePrefix =
classpath[i].getGenerateClasspathPrefix();
+ if (generatePrefix == null) {
+ // generatePrefix is not set - try defaults
+ if (classpathPrefix == null) {
+ if (generateClasspathPrefix) {
+ prefix = generatePrefix(artifact);
+ }
+ } else {
+ prefix = classpathPrefix;
+ }
+ } else if (Boolean.TRUE.equals(generatePrefix)) {
+ // generatePrefix is explicitly set to true
- generate prefix
+ prefix = generatePrefix(artifact);
+ } else {
+ // generatePrefix is explicitly set to
false - leave null prefix
+ }
}
if (prefix != null) {
@@ -269,4 +297,8 @@
return buff.toString();
}
-}
\ No newline at end of file
+ private static String generatePrefix(Artifact artifact) {
+ return "../repository/" +
artifact.getGroupId().replace('.', '/') + "/" +
artifact.getArtifactId() + "/" + artifact.getVersion();
+ }
+
+}
Modified: geronimo/server/trunk/buildsupport/car-maven-plugin/src/
main/java/org/apache/geronimo/mavenplugins/car/ClasspathElement.java
URL:
http://svn.apache.org/viewvc/geronimo/server/trunk/buildsupport/car-maven-plugin/src/main/java/org/apache/geronimo/mavenplugins/car/ClasspathElement.java?rev=718644&r1=718643&r2=718644&view=diff
=
=
=
=
=
=
=
=
======================================================================
--- geronimo/server/trunk/buildsupport/car-maven-plugin/src/main/
java/org/apache/geronimo/mavenplugins/car/ClasspathElement.java
(original)
+++ geronimo/server/trunk/buildsupport/car-maven-plugin/src/main/
java/org/apache/geronimo/mavenplugins/car/ClasspathElement.java Tue
Nov 18 08:33:38 2008
@@ -78,6 +78,17 @@
* @parameter
*/
private String entry;
+
+ /**
+ * Generate classpath prefix based on the artifactId and
groupId. The generated classpath
+ * prefix will be in the following form:
+ * <tt>../repository/<groupId>/<artifactId>/
<version></tt>.
+ * The classpath prefix will only be generated if the
<tt>classpathPrefix</tt> parameter
+ * is not set.
+ *
+ * @parameter
+ */
+ private Boolean generateClasspathPrefix;
/**
* @return Returns the artifactId.
@@ -163,6 +174,24 @@
this.classpathPrefix = classpathPrefix;
}
+ /**
+ * @return Returns null if the classpath prefix parameter was
not set.
+ * Returns true if the classpath prefix should be
automatically generated.
+ * Returns false if the classpath prefix should NOT be
automatically generated.
+ */
+ public Boolean getGenerateClasspathPrefix() {
+ return generateClasspathPrefix;
+ }
+
+ /**
+ * Sets whether classpath prefix should be automatically
generated.
+ *
+ * @param generateClasspathPrefix
+ */
+ public void setGenerateClasspathPrefix(Boolean
generateClasspathPrefix) {
+ this.generateClasspathPrefix = generateClasspathPrefix;
+ }
+
public String getEntry() {
return entry;
}