FW: Maven2 jar classpath

2005-05-05 Thread Ilyevsky, Leonid (Equity Trading)
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:[EMAIL PROTECTED] 
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) [EMAIL PROTECTED]
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 addClasspathtrue/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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: FW: Maven2 jar classpath

2005-05-05 Thread Brett Porter
On 5/5/05, Ilyevsky, Leonid (Equity Trading) [EMAIL PROTECTED] 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: FW: Maven2 jar classpath

2005-05-05 Thread Ilyevsky, Leonid (Equity Trading)
I think the following workaround is acceptable.
Take an advantage of the convenient uniqueness of the jar file names
with their version numbers, dump all of them from repository to a single
/lib directory. Then all executable jar files created with
addClasspath feature will work.

I also tried putting soft links in /lib. It does not help much; soft
links to dependency libraries are OK, but the executable jar must be a
real file, otherwise java is looking for dependencies in the wrong
place.

-Original Message-
From: Brett Porter [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 05, 2005 9:06 AM
To: Ilyevsky, Leonid (Equity Trading)
Cc: users@maven.apache.org
Subject: Re: FW: Maven2 jar classpath


On 5/5/05, Ilyevsky, Leonid (Equity Trading) [EMAIL PROTECTED]
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


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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: FW: Maven2 jar classpath

2005-05-05 Thread Ilyevsky, Leonid (Equity Trading)
Just one more thought. Brett said That's not very portable if you want
to move the JAR around, though.
Bit isn't it a part of maven philosophy that we should restrict
ourselves of moving things around too much?
If repository layout is a standard, why not use it at runtime, so we
always know where to look for the specific version of any package.

-Original Message-
From: Ilyevsky, Leonid (Equity Trading) 
Sent: Thursday, May 05, 2005 9:25 AM
To: Brett Porter
Cc: users@maven.apache.org
Subject: RE: FW: Maven2 jar classpath


I think the following workaround is acceptable.
Take an advantage of the convenient uniqueness of the jar file names
with their version numbers, dump all of them from repository to a single
/lib directory. Then all executable jar files created with
addClasspath feature will work.

I also tried putting soft links in /lib. It does not help much; soft
links to dependency libraries are OK, but the executable jar must be a
real file, otherwise java is looking for dependencies in the wrong
place.

-Original Message-
From: Brett Porter [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 05, 2005 9:06 AM
To: Ilyevsky, Leonid (Equity Trading)
Cc: users@maven.apache.org
Subject: Re: FW: Maven2 jar classpath


On 5/5/05, Ilyevsky, Leonid (Equity Trading) [EMAIL PROTECTED]
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


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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Maven2 jar classpath

2005-04-22 Thread Ilyevsky, Leonid (Equity Trading)
Kenney,

You said But beware, only dependencies with scoperuntime/scope get
included in the classpath..
It really behaves like that, but
1. It creates a problem. If I specify runtime then it does not
compile. I managed to see runtime for the manifest when I compiled
without runtime, then put it in and did deploy again.

2. It was not meant to be this way, because on
http://maven.apache.org/maven2/dependencies.html it says that with
default compile scope the artifact will be in all classpaths.

So, I suspect it is a bug.

-Original Message-
From: Kenney Westerhof [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 19, 2005 10:29 AM
To: Maven Users List
Subject: Re: Maven2 jar classpath


On Tue, 19 Apr 2005, Ilyevsky, Leonid (Equity Trading) wrote:


use this:

build
  plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-jar-plugin/artifactId
configuration
  archive
manifest
  addClasspathtrue/addClasspath
/manifest
  /archive
/configuration
  /plugin
/build

But beware, only dependencies with scoperuntime/scope get included
in the classpath.

Greetings,

Kenney Westerhof

 As my dependency list grows, I would like maven 2 to automatically
 generage class path in the manifest from dependency information.
 How should I specify it in pom.xml?
 

 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/
 


--
Kenney Westerhof
http://www.neonics.com
GPG public key: http://www.gods.nl/~forge/kenneyw.key

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



RE: Maven2 jar classpath

2005-04-22 Thread Ilyevsky, Leonid (Equity Trading)
The problem is that artifacts with the compile scope don't get into
the runtime classpath, so when I use addClasspathtrue/addClasspath,
they do not show up in the manifest.

-Original Message-
From: Brett Porter [mailto:[EMAIL PROTECTED] 
Sent: Friday, April 22, 2005 5:41 PM
To: Maven Users List
Subject: Re: Maven2 jar classpath


 2. It was not meant to be this way, because on
 http://maven.apache.org/maven2/dependencies.html it says that with
 default compile scope the artifact will be in all classpaths.

correct

 
 So, I suspect it is a bug.

I don't see anywhere in the thread that you describe a bug. What's the
problem?

- Brett

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Maven2 jar classpath

2005-04-22 Thread Brett Porter
On 4/23/05, Ilyevsky, Leonid (Equity Trading) [EMAIL PROTECTED] 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 addClasspathtrue/addClasspath,
 they do not show up in the manifest.

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

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Maven2 jar classpath

2005-04-22 Thread Brett Porter
 2. It was not meant to be this way, because on
 http://maven.apache.org/maven2/dependencies.html it says that with
 default compile scope the artifact will be in all classpaths.

correct

 
 So, I suspect it is a bug.

I don't see anywhere in the thread that you describe a bug. What's the problem?

- Brett

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Maven2 jar classpath

2005-04-19 Thread Ilyevsky, Leonid (Equity Trading)
As my dependency list grows, I would like maven 2 to automatically
generage class path in the manifest from dependency information.
How should I specify it in pom.xml?


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/



Re: Maven2 jar classpath

2005-04-19 Thread Kenney Westerhof
On Tue, 19 Apr 2005, Ilyevsky, Leonid (Equity Trading) wrote:


use this:

build
  plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-jar-plugin/artifactId
configuration
  archive
manifest
  addClasspathtrue/addClasspath
/manifest
  /archive
/configuration
  /plugin
/build

But beware, only dependencies with scoperuntime/scope get included
in the classpath.

Greetings,

Kenney Westerhof

 As my dependency list grows, I would like maven 2 to automatically
 generage class path in the manifest from dependency information.
 How should I specify it in pom.xml?
 

 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/
 


--
Kenney Westerhof
http://www.neonics.com
GPG public key: http://www.gods.nl/~forge/kenneyw.key

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Maven2 jar classpath

2005-04-19 Thread Ilyevsky, Leonid (Equity Trading)
Thanks Kenney, it works. But, to make it useful, I need to put all the
jar files in one directory, because maven puts just the jar file names
in the classpath.
Right now I have them in .m2/repository, in their subdirectories. I
guess, I will create a directory with soft links for my run environment.
Is there a task in maven2 to automate this?

-Original Message-
From: Kenney Westerhof [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 19, 2005 10:29 AM
To: Maven Users List
Subject: Re: Maven2 jar classpath


On Tue, 19 Apr 2005, Ilyevsky, Leonid (Equity Trading) wrote:


use this:

build
  plugin
groupIdorg.apache.maven.plugins/groupId
artifactIdmaven-jar-plugin/artifactId
configuration
  archive
manifest
  addClasspathtrue/addClasspath
/manifest
  /archive
/configuration
  /plugin
/build

But beware, only dependencies with scoperuntime/scope get included
in the classpath.

Greetings,

Kenney Westerhof

 As my dependency list grows, I would like maven 2 to automatically
 generage class path in the manifest from dependency information.
 How should I specify it in pom.xml?
 

 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/
 


--
Kenney Westerhof
http://www.neonics.com
GPG public key: http://www.gods.nl/~forge/kenneyw.key

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



Re: Maven2 jar classpath

2005-04-19 Thread Brett Porter
you are missing plugins/ to wrap the plugin/ element.

On 4/20/05, Pieter Laeremans [EMAIL PROTECTED] wrote:
 When I want to do this I get this:

- Brett

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Maven2 jar classpath

2005-04-19 Thread Pieter Laeremans
Brett Porter wrote:
you are missing plugins/ to wrap the plugin/ element.
On 4/20/05, Pieter Laeremans [EMAIL PROTECTED] wrote:
When I want to do this I get this:

- Brett
Inded. The problem is fixed Thanks!
kind regards,
Pieter
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]