maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brett Porter <br...@apache.org>
Subject Re: cvs commit: maven-plugins/eclipse/xdocs changes.xml
Date Fri, 24 Sep 2004 14:07:59 GMT
That's a poorly named property if ever I saw one :)

lib is an artifact, not a dependency. I don't see why modifying the 
dependency helps, and its not the right thing to do (model/runtime 
separation - and yes, I notice that the version does this anyway).

lib.urlPath here should give you the 
/commons-logging/jars/commons-logging-1.0.3.jar part, but this isn't 
what you want.

A path jar override is unlikely to be in the repository (people often 
use it to test, because the jars are there though). It's actually 
usually in basedir.

I suggest you do the following:
- take lib.path
- if it starts with ${maven.repo.local}, swap it for MAVEN_REPO
- if it starts with ${basedir}/, remove it.

Sound right?

Cheers,
Brett

Eric Pugh wrote:

>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
>
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Mime
View raw message