You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Wendy Smoak <ja...@wendysmoak.com> on 2005/08/30 15:21:56 UTC

[m1] Removing dependencies from classpath

If I declare 'duplicate' dependencies, (meaning two .jar files that contain
the same classes,) how do I get one of them *out* of
'maven.dependency.classpath' before compilation?

I've learned how to add things:
   <preGoal name="java:compile">
     <maven:addPath id="maven.dependency.classpath" refid="shale.jsf.path"/>
   </preGoal>

Where does 'maven.dependency.classpath' get created?  I only see it
referenced from the Maven Java Plugin, yet if I try
   <ant:echo>${maven.dependency.classpath}</ant:echo>
in a preGoal to java:compile, it's blank.

More to the point, in which pre/postGoal do I have a chance at modifying
'maven.dependency.classpath' and how would I go about it?  Is it just a
String by that point?  It would seem that I need to get involved wherever
Maven is going through the <dependency> tags.

[This is related to the conditional dependencies thread... I either need to 
declare them and remove one, or declare none and manually add the one I 
need.  Or maybe something else entirely!]

Thanks,
Wendy Smoak 



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


Re: [m1] Removing dependencies from classpath

Posted by Andy Glick <an...@acm.org>.
Wendy Smoak wrote:

> Where does 'maven.dependency.classpath' get created?  I only see it
> referenced from the Maven Java Plugin, yet if I try
>   <ant:echo>${maven.dependency.classpath}</ant:echo>
> in a preGoal to java:compile, it's blank.

To see the value of an ant path, fileset, dirset or filelist you can use the ant "pathconvert" task. The following fragment is from the Ant manual page for the task. When the ant reference is converted to a property, echo will display its value. 

Converts a nested <path> or reference to a Path, FileSet, DirSet, or FileList into a path form for a particular platform, and stores the result in a given property. It can also be used when you need to convert a Path, FileSet, or DirSet into a list, separated by a given character, such as a comma or space, or, conversely, to convert a list of files in a FileList into a path.


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


Re: [m1] Removing dependencies from classpath

Posted by Brett Porter <br...@gmail.com>.
Hi,

Please see my reply to the other thread. You probably need something else 
entirely.

Where does 'maven.dependency.classpath' get created? I only see it
> referenced from the Maven Java Plugin, yet if I try
> <ant:echo>${maven.dependency.classpath}</ant:echo>
> in a preGoal to java:compile, it's blank.


It's an ant reference, not a property - so it comes up blank. maven -X will 
show it whenever it is changed.

- Brett