You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Jason Chaffee <jc...@ebates.com> on 2010/07/21 23:13:39 UTC

accessing the path of a jar in local repository

Is there a way to use the path to a jar in the local respository using
variables in the pom?

 

I know I can use the dependency plugin to copy the jar to my target
directory, but I would prefer to just use the location in the repo.  For
example,

 

        <plugin>

          <groupId>org.apache.maven.plugins</groupId>

          <artifactId>maven-surefire-plugin</artifactId>

          <configuration>

            <forkMode>once</forkMode>

 
<argLine>-javaagent:${aspectjweaver.groupId}/${aspectjweaver.artifactid}
/${aspectjweaver.version}/${aspectjweaver.jar}</argLine>

          </configuration>

        </plugin>


Re: accessing the path of a jar in local repository

Posted by Jochen Stiepel <j....@gmail.com>.
Hi Jason,

sorry I don't know a direct way.

Maybe you can reuse some of this code or output:
http://maven.apache.org/plugins/maven-dependency-plugin/usage.html ->  "The
dependency:build-classpath mojo"

which can be used to write the complete path into a file e.g.

/home/foo/.m2/repository/org/java/utils/util/util-1.0.jar


Would be nice to hear from your solution.

Thanks and kind regards,
Jochen



2010/7/21 Jason Chaffee <jc...@ebates.com>

> Is there a way to use the path to a jar in the local respository using
> variables in the pom?
>
>
>
> I know I can use the dependency plugin to copy the jar to my target
> directory, but I would prefer to just use the location in the repo.  For
> example,
>
>
>
>        <plugin>
>
>          <groupId>org.apache.maven.plugins</groupId>
>
>          <artifactId>maven-surefire-plugin</artifactId>
>
>          <configuration>
>
>            <forkMode>once</forkMode>
>
>
> <argLine>-javaagent:${aspectjweaver.groupId}/${aspectjweaver.artifactid}
> /${aspectjweaver.version}/${aspectjweaver.jar}</argLine>
>
>          </configuration>
>
>        </plugin>
>
>