Thanks Brett,
That clears things up a bit.. Unfortunantly, this doesn't seem as easy to
fix as I think it should.. ArtifactListBuilder is responsible for all the
setup
of the artifacts. However, ArtifactListBuilder properly updates the path
variable of the artifact. So, if I change my jelly in classpath.jelly from:
<classpathentry kind="var" path="MAVEN_REPO${lib.urlPath}"/>
to
<classpathentry kind="var" path="${lib.path}"/>
it takes into account the correct version or location. Unfortunantly that
means that I get a URL like this
c:\java\maven\repository\commons-logging\jars\commons-logging-1.0.3.jar
And what I really need is just the
/commons-logging/jars/commons-logging-1.0.3.jar part. While I could get
slick w/ the textediting, it seems like something along the lines of this
should be applied:
Index: ArtifactListBuilder.java
===================================================================
RCS file:
/home/cvs/maven/src/java/org/apache/maven/ArtifactListBuilder.java,v
retrieving revision 1.16
diff -u -r1.16 ArtifactListBuilder.java
--- ArtifactListBuilder.java 23 Mar 2004 02:18:18 -0000 1.16
+++ ArtifactListBuilder.java 24 Sep 2004 13:47:41 -0000
@@ -68,13 +68,15 @@
// User is requesting a specific version of a
dependency
// be used.
d.setVersion( mavenJarProperty );
+
artifact.getDependency().setUrl(artifact.generatePath());
artifact.setPath(
project.getContext().getMavenRepoLocal() + artifact.generatePath() );
}
else
{
// User is requesting a specific path to a dependency
- // be used.
+ // be used.
artifact.setPath( new File(
mavenJarProperty ).getAbsolutePath() );
+ artifact.getDependency().setUrl(mavenJarProperty);
}
}
else
It boils down to needing the URL, not the full path.
Eric
> -----Original Message-----
> From: Brett Porter [mailto:[EMAIL PROTECTED]
> Sent: Friday, September 24, 2004 2:57 PM
> To: Maven Developers List
> Subject: Re: cvs commit: maven-plugins/eclipse/xdocs changes.xml
>
>
> Hi Eric,
>
> That's not a jar override... try
>
> maven.jar.override=on
> with
> # path override
> maven.jar.commons-jelly-tags-xml=${basedir}/lib/commons-jelly-tags
> -xml-1.0.jar
> or
> # version override
> maven.jar.commons-jelly-tags-xml=1.0
>
> for example.
>
> See touchstone or MAVEN-581 for some test cases I've been looking at
> recently.
>
> Cheers,
> Brett
>
> [EMAIL PROTECTED] wrote:
>
> >epugh 2004/09/24 05:22:15
> >
> > Modified: eclipse/src/plugin-test project.xml maven.xml
> > eclipse/xdocs changes.xml
> > Log:
> > MPECLIPSE-38 Jar overrides are not supported. Unit test to verify fix
> >
> > Revision Changes Path
> > 1.7 +5 -0 maven-plugins/eclipse/src/plugin-test/project.xml
> >
> > Index: project.xml
> > ===================================================================
> > RCS file: /home/cvs/maven-plugins/eclipse/src/plugin-test/project.xml,v
> > retrieving revision 1.6
> > retrieving revision 1.7
> > diff -u -r1.6 -r1.7
> > --- project.xml 10 Aug 2004 07:41:16 -0000 1.6
> > +++ project.xml 24 Sep 2004 12:22:15 -0000 1.7
> > @@ -54,6 +54,11 @@
> >
> > <dependencies>
> > <dependency>
> > + <id>maven</id>
> > + <version>beta-8</version>
> > + <jar>maven.jar</jar>
> > + </dependency>
> > + <dependency>
> > <groupId>commons-jelly</groupId>
> > <artifactId>commons-jelly-tags-xml</artifactId>
> > <version>20030211.142705</version>
> >
> >
> >
> > 1.11 +14 -1 maven-plugins/eclipse/src/plugin-test/maven.xml
> >
> > Index: maven.xml
> > ===================================================================
> > RCS file: /home/cvs/maven-plugins/eclipse/src/plugin-test/maven.xml,v
> > retrieving revision 1.10
> > retrieving revision 1.11
> > diff -u -r1.10 -r1.11
> > --- maven.xml 10 Aug 2004 07:41:17 -0000 1.10
> > +++ maven.xml 24 Sep 2004 12:22:15 -0000 1.11
> > @@ -20,7 +20,7 @@
> > xmlns:u="jelly:util"
> > xmlns:x="jelly:xml">
> >
> > - <goal name="testPlugin"
> prereqs="test-eclipse,test-natures,test-builders,test-natures-and-
> builders,test-classpath-has-generated-source">
> > + <goal name="testPlugin"
> prereqs="test-eclipse,test-natures,test-builders,test-natures-and-
> builders,test-classpath-has-generated-source,test-classpath-has-ov
> erridden-jar">
> > </goal>
> >
> > <goal name="test-init">
> > @@ -114,5 +114,18 @@
> > <assert:assertEquals expected="3"
> value="${count.intValue().toString()}"/>
> >
> > </goal>
> > +
> > + <goal name="test-classpath-has-overridden-jar">
> > + <attainGoal name="test-init"/>
> > + <attainGoal name="eclipse"/>
> > +
> > + <assert:assertFileExists file="${dotClasspath}" />
> > +
> > + <u:file var="classpathFile" name="${dotClasspath}"/>
> > + <x:parse var="classpathDoc" xml="${classpathFile.toURL()}" />
> > + <x:set var="count"
> select="count($classpathDoc/classpath/classpathentry[contains(@pat
> h,'MAVEN_REPO/maven/jars/maven.jar')])"/>
> > + <assert:assertEquals expected="1"
> value="${count.intValue().toString()}"/>
> > +
> > + </goal>
> >
> > </project>
> >
> >
> >
> > 1.29 +1 -0 maven-plugins/eclipse/xdocs/changes.xml
> >
> > Index: changes.xml
> > ===================================================================
> > RCS file: /home/cvs/maven-plugins/eclipse/xdocs/changes.xml,v
> > retrieving revision 1.28
> > retrieving revision 1.29
> > diff -u -r1.28 -r1.29
> > --- changes.xml 14 Aug 2004 19:43:30 -0000 1.28
> > +++ changes.xml 24 Sep 2004 12:22:15 -0000 1.29
> > @@ -25,6 +25,7 @@
> > </properties>
> > <body>
> > <release version="1.9" date="in cvs">
> > + <action dev="epugh" type="fix" issue="MPECLIPSE-38">Jar
> overrides are not supported. Unit test to verify fix</action>
> > </release>
> > <release version="1.8" date="2004-08-14">
> > <action dev="epugh" type="fix" issue="MPECLIPSE-37"
> due-to="Felipe Leme">Fixed a 'race condition' where Cactus
> dependency is added twice to .classpath.</action>
> >
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> >
> >
> >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]