jvanzyl 2002/11/14 09:46:27
Modified: src/java/org/apache/maven/project Dependency.java
Project.java
src/java/org/apache/maven/repository DefaultJarArtifact.java
src/plugins-build/deploy plugin.jelly
src/plugins-build/java plugin.jelly
src/plugins-build/war plugin.jelly
src/xsd maven-project.xsd
xdocs changes.xml
Log:
o Adding Alexei's patch to bring Maven's behaviour w.r.t. dependencies
up-to-date with the documention. Though I believe we still need to
account for the <category/> element. At any rate nice patch, much
appreciated.
Revision Changes Path
1.19 +23 -1
jakarta-turbine-maven/src/java/org/apache/maven/project/Dependency.java
Index: Dependency.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/project/Dependency.java,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- Dependency.java 26 Oct 2002 05:18:21 -0000 1.18
+++ Dependency.java 14 Nov 2002 17:46:25 -0000 1.19
@@ -55,6 +55,7 @@
*
* ====================================================================
*/
+
/**
* @author <a href="mailto:jvanzyl@;apache.org">Jason van Zyl</a>
* @version $Id$
@@ -83,6 +84,11 @@
private String projectId;
/**
+ * Group id
+ */
+ private String groupId;
+
+ /**
* The dependency type
*/
private String type;
@@ -143,6 +149,22 @@
// is 'ant'.
setProjectId(getId());
}
+ }
+
+ /**
+ * Sets the groupId attribute of the Dependency object
+ */
+ public void setGroupId(String groupId)
+ {
+ this.groupId = groupId;
+ }
+
+ /**
+ * Gets the groupId attribute of the Dependency object
+ */
+ public String getGroupId()
+ {
+ return groupId != null ? groupId : getProjectId();
}
/**
1.43 +22 -1
jakarta-turbine-maven/src/java/org/apache/maven/project/Project.java
Index: Project.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/project/Project.java,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- Project.java 21 Oct 2002 17:17:14 -0000 1.42
+++ Project.java 14 Nov 2002 17:46:25 -0000 1.43
@@ -211,6 +211,11 @@
private String shortDescription;
/**
+ * Project group id.
+ */
+ private String groupId;
+
+ /**
* File that this POM object was derived from.
*/
private File file;
@@ -308,6 +313,22 @@
public String getShortDescription()
{
return shortDescription;
+ }
+
+ /**
+ * Set the project group id.
+ */
+ public void setGroupId(String groupId)
+ {
+ this.groupId = groupId;
+ }
+
+ /**
+ * Get the project group id.
+ */
+ public String getGroupId()
+ {
+ return (groupId != null) ? groupId : getId();
}
/**
1.4 +5 -5
jakarta-turbine-maven/src/java/org/apache/maven/repository/DefaultJarArtifact.java
Index: DefaultJarArtifact.java
===================================================================
RCS file:
/home/cvs/jakarta-turbine-maven/src/java/org/apache/maven/repository/DefaultJarArtifact.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DefaultJarArtifact.java 22 Jul 2002 13:12:16 -0000 1.3
+++ DefaultJarArtifact.java 14 Nov 2002 17:46:25 -0000 1.4
@@ -109,12 +109,12 @@
*/
public String getPath()
{
- String projectId = dependency.getProjectId();
+ String groupId = dependency.getGroupId();
String artifact = dependency.getArtifact();
log.debug("artifact: " + artifact);
- return ps + projectId + ps + "jars" + ps + artifact;
+ return ps + groupId + ps + "jars" + ps + artifact;
}
/**
@@ -122,12 +122,12 @@
*/
public String getUrlPath()
{
- String projectId = dependency.getProjectId();
+ String groupId = dependency.getGroupId();
String artifact = dependency.getArtifact();
log.debug("artifact: " + artifact);
- return "/" + projectId + "/" + "jars" + "/" + artifact;
+ return "/" + groupId + "/" + "jars" + "/" + artifact;
}
/**
1.9 +2 -2 jakarta-turbine-maven/src/plugins-build/deploy/plugin.jelly
Index: plugin.jelly
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/deploy/plugin.jelly,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- plugin.jelly 20 Aug 2002 01:52:25 -0000 1.8
+++ plugin.jelly 14 Nov 2002 17:46:25 -0000 1.9
@@ -57,13 +57,13 @@
<j:when test="${typeX != 'X'}">
<property
name="resolvedDirectory"
- value="${siteDirectory}/${pom.id}/${type}"
+ value="${siteDirectory}/${pom.groupId}/${type}"
/>
</j:when>
<j:otherwise>
<property
name="resolvedDirectory"
- value="${siteDirectory}/${pom.id}"
+ value="${siteDirectory}/${pom.groupId}"
/>
</j:otherwise>
</j:choose>
1.31 +2 -2 jakarta-turbine-maven/src/plugins-build/java/plugin.jelly
Index: plugin.jelly
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/java/plugin.jelly,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- plugin.jelly 24 Oct 2002 07:09:50 -0000 1.30
+++ plugin.jelly 14 Nov 2002 17:46:25 -0000 1.31
@@ -192,7 +192,7 @@
<m:user-check user="${maven.username}"/>
<attainGoal name="jar:snapshot"/>
<property name="maven.jar.to.deploy" value="${maven.final.name}.jar"/>
- <property name="dir" value="${maven.repo.central.directory}/${pom.id}/jars"/>
+ <property name="dir"
value="${maven.repo.central.directory}/${pom.groupId}/jars"/>
<deploy:artifact
artifact="${maven.build.dir}/${maven.jar.to.deploy}"
@@ -231,7 +231,7 @@
<goal name="jar:install" prereqs="java:jar"
description="Install the jar in the local repository">
- <property name="jardir__" value="${maven.repo.local}/${pom.id}/jars"/>
+ <property name="jardir__" value="${maven.repo.local}/${pom.groupId}/jars"/>
<mkdir dir="${jardir__}"/>
<copy
file="${maven.build.dir}/${maven.final.name}.jar"
1.16 +1 -1 jakarta-turbine-maven/src/plugins-build/war/plugin.jelly
Index: plugin.jelly
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/plugins-build/war/plugin.jelly,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- plugin.jelly 17 Oct 2002 06:37:59 -0000 1.15
+++ plugin.jelly 14 Nov 2002 17:46:25 -0000 1.16
@@ -132,7 +132,7 @@
description="Install the war in the local repository">
<property name="maven.war.install.dir"
- value="${maven.repo.local}/${pom.id}/wars"/>
+ value="${maven.repo.local}/${pom.groupId}/wars"/>
<mkdir dir="${maven.war.install.dir}"/>
<copy file="${maven.war.build.dir}/${pom.id}.war"
tofile="${maven.war.install.dir}/${maven.war.final.name}"/>
1.11 +2 -0 jakarta-turbine-maven/src/xsd/maven-project.xsd
Index: maven-project.xsd
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/src/xsd/maven-project.xsd,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- maven-project.xsd 21 Sep 2002 09:52:30 -0000 1.10
+++ maven-project.xsd 14 Nov 2002 17:46:25 -0000 1.11
@@ -7,6 +7,7 @@
<xs:element ref="pomVersion"/>
<xs:element ref="id"/>
<xs:element ref="name"/>
+ <xs:element ref="groupId" minOccurs="0"/>
<xs:element ref="currentVersion"/>
<xs:element ref="organization"/>
<xs:element ref="inceptionYear"/>
@@ -38,6 +39,7 @@
<xs:element name="description" type='xs:string'/>
<xs:element name="distributionDirectory" type='xs:string'/>
<xs:element name="name" type='xs:string'/>
+ <xs:element name="groupId" type='xs:string'/>
<xs:element name="gumpRepositoryId" type='xs:string'/>
<xs:element name="id" type='xs:string'/>
<xs:element name="inceptionYear" type='xs:string'/>
1.8 +5 -0 jakarta-turbine-maven/xdocs/changes.xml
Index: changes.xml
===================================================================
RCS file: /home/cvs/jakarta-turbine-maven/xdocs/changes.xml,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- changes.xml 1 Nov 2002 22:43:15 -0000 1.7
+++ changes.xml 14 Nov 2002 17:46:25 -0000 1.8
@@ -7,6 +7,11 @@
<body>
<release version="1.0-beta-8" date="in CVS">
+ <action dev="jvanzyl" type="update">
+ Added a patch supplied by Alexei Barantsev that makes Maven's
+ behaviour actually match the document method of stating dependencies using
+ a group ids and artifact ids.
+ </action>
<action dev="smor" type="add">
Added support for templates.
Added a "standard" template providing a standard directory layout, and a
"sourceforge" template
--
To unsubscribe, e-mail: <mailto:turbine-maven-dev-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:turbine-maven-dev-help@;jakarta.apache.org>