You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Ilyevsky, Leonid (Equity Trading)" <Le...@ml.com> on 2005/05/05 14:54:58 UTC

FW: Maven2 jar classpath

Brett,

I tried using <addClasspath> tag again few days ago. Still does not work
for the default "compile" scope.
I assume I have to wait for the next alpha release to get your fix. For
the time being I am using <manifestFile> feature.

However, even if <addClasspath> works, the way it is now is not very
useful (I mentioned this problem in one of my previous postings).
It will include dependent jar file names without any directory prefix,
like if they are sitting in the same directory. But they are not in the
same directory!
For example, my program 

        ...repository/mygroup/myprog/1.0/myprog-1.0.jar 

depends on 

 
...repository/commons-collections/commons-collections/3.1/commons-collec
tions-3.1.jar

The classpath generated by maven will have
"commons-collections-3.1.jar", but it should have 
"../../../commons-collections/commons-collections/3.1/commons-collection
s-3.1.jar".

Then I really can run my jar file out of repository.

Any thoughts?

-----Original Message-----
From: Ilyevsky, Leonid (Equity Trading) 
Sent: Friday, April 22, 2005 7:12 PM
To: 'Brett Porter'
Subject: RE: Maven2 jar classpath


Thanks Brett. I will try it Monday (it is time now to go home).
One more related question. The classpath I am getting this way will list
just the names of the jar files (no path).
So, it will work if my program's jar file and all dependencies are all
in one directory.
I guess, this is reasonable, to have it in one directory in runtime
environment.
The question is, can maven2 automatically put my program jar and all
dependencies in one directory? Or something equivalent to this, so after
doing "m2 deploy" I can run it with "java -jar myprog.jar".

-----Original Message-----
From: Brett Porter [mailto:brett.porter@gmail.com] 
Sent: Friday, April 22, 2005 6:53 PM
To: Ilyevsky, Leonid (Equity Trading)
Cc: Maven Users List
Subject: Re: Maven2 jar classpath


On 4/23/05, Ilyevsky, Leonid (Equity Trading) <Le...@ml.com>
wrote:
> The problem is that artifacts with the "compile" scope don't get into
> the runtime classpath, 

I'm pretty sure they do.

> so when I use <addClasspath>true</addClasspath>,
> they do not show up in the manifest.

Ok, there was a bug in the "addClasspath" handling. Fixed.
--------------------------------------------------------

If you are not an intended recipient of this e-mail, please notify the sender, delete it and do not read, act upon, print, disclose, copy, retain or redistribute it. Click here for important additional terms relating to this e-mail.     http://www.ml.com/email_terms/
--------------------------------------------------------

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


Re: FW: Maven2 jar classpath

Posted by Brett Porter <br...@gmail.com>.
On 5/5/05, Ilyevsky, Leonid (Equity Trading) <Le...@ml.com> wrote:
> I assume I have to wait for the next alpha release to get your fix. For
> the time being I am using <manifestFile> feature.

Correct.

> The classpath generated by maven will have
> "commons-collections-3.1.jar", but it should have
> "../../../commons-collections/commons-collections/3.1/commons-collection
> s-3.1.jar".
> 
> Then I really can run my jar file out of repository.

That's not very portable if you want to move the JAR around, though.

> 
> Any thoughts?

I think that the Classpath: manifest entry is not very useful :)

You might like to try the "jar-with-dependencies" assembly that simply
folds all of the JARs into one. Or zip all the dependencies up in one
directory. We are looking into more sophisticated ways of building
distributables along these lines.

Cheers,
Brett

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