RE: Surefire includes artifacts with scope 'provided' in the runtime classpath, is this correct?

2007-07-17 Thread Stephen Connolly



frodesto wrote:
> 
> In my case I am using the javaee-api to get access to the JMS API
> (javax.jms). I need the API classes to get my code to compile, but I
> cannot include this jar as a compile-time dependency since the
> app-server/JMS provider will provide the "real" JMS implementation.
> 
> I my unit tests I need a "real" JMS implementation, and I am using
> ActiveMQ.  ActiveMQ also bundles the javax.jms package, and this is the
> one I need to use at test-time. I have included the ActiveMQ jar as
> scope="test" dependency. When I run the unit tests, I get a classpath with
> two different versions of the javax.jms package (a "dummy implementation"
> in javaee-api.jar and a real one in activemq-core.jar), and unfortunately
> it seems like the JVM chooses the wrong one.
> 

Most likely is that the javax.jms references one of the classes which should
be provided by the container (which it has to pull from javaee-api.jar,
which is borked, which causes a classloader error, which [i'm guessing]
causes your problem)

-- 
View this message in context: 
http://www.nabble.com/Surefire-includes-artifacts-with-scope-%27provided%27-in-the-runtime-classpath%2C-is-this-correct--tf4016962s177.html#a11662736
Sent from the Maven - Users mailing list archive at Nabble.com.


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



RE: Surefire includes artifacts with scope 'provided' in the runtime classpath, is this correct?

2007-07-17 Thread Stephen Connolly



frodesto wrote:
> 
> 
> Jörg Schaible wrote:
>> 
>> 
>> Why is it a problem for you, that it is available in the classpath for
>> the test?
>> 
>> - Jörg
>> 
>> 
> 
> Hi again. I see your point in that in many (most?) cases you actually
> would like the artifacts with scope 'provided' to be available in the
> classpath for the unit tests.
> 
> However, in my case this causes problems since the javaee-api.jar cannot
> be used at runtime. It only provides the interface part of the Java EE
> APIs, but no implementation. If you try to use it at runtime, you will get
> java.lang.ClassFormatError and other weird exceptions.  You have to use a
> "real" JavaEE implementation at runtime.
> 
> In my case I am using the javaee-api to get access to the JMS API
> (javax.jms). I need the API classes to get my code to compile, but I
> cannot include this jar as a compile-time dependency since the
> app-server/JMS provider will provide the "real" JMS implementation.
> 
> I my unit tests I need a "real" JMS implementation, and I am using
> ActiveMQ.  ActiveMQ also bundles the javax.jms package, and this is the
> one I need to use at test-time. I have included the ActiveMQ jar as
> scope="test" dependency. When I run the unit tests, I get a classpath with
> two different versions of the javax.jms package (a "dummy implementation"
> in javaee-api.jar and a real one in activemq-core.jar), and unfortunately
> it seems like the JVM chooses the wrong one.
> 
> I need a way to make Surefire skip the javaee-api.jar from the test-time
> classpath or a way to control which version the JVM will use. 
> 
> Frode
> 
> 
See

http://forums.java.net/jive/thread.jspa?threadID=28648&tstart=0

In my opinion, it is that the javaee-api.jar that is being used is borked.
(At least in terms of use cases with Maven)

In the interim, I suggest changing from using the javaee-api.jar with scope
provided to using the individual jsr spec api jars with scope provided. (As
the individual spec jars do not seem to be borked)

-Stephen.
-- 
View this message in context: 
http://www.nabble.com/Surefire-includes-artifacts-with-scope-%27provided%27-in-the-runtime-classpath%2C-is-this-correct--tf4016962s177.html#a11662554
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Add Maven ear properties file to war manifest classpath

2007-07-12 Thread Timothy Reilly
I am trying to add an additional classpath element to the manifest created by 
the war plugin.
 
Is it possible to do this?  I see how to add a manifest entry 
and I see how to specify the war classpath should be generated, 
but how to get this:
 
Manifest-Version: 1.0 
Class-Path: 
customerEjb_client.jar   <-- Dependency
inventoryEjb_client.jar  <-- Dependency
mailerEjb_client.jar<-- Dependency
../foobar.properties  

problem of mutiple resources with the same location and names at classpath during testing

2007-07-05 Thread ywtsang

We have a spring configuration file located at "main" and "test" resources
directory. This is for having different config file for testing and
production.

We guess that the test run by maven will see the "spring config file" at the
test directory during testing, but we find that the test case will pick up
the "spring config file" at "main" or "test" resources directory randomly.

Can maven help to "use" the resources at test directory at a "higher"
prioerity in classpath resource loading?

I don't know if this actually relates to maven issue or what (or maybe this
relates to project directory structure packaing?), a kind pointer to where
to help is very much appreciated if I have asked the question at a wrong
place.

Thanks for reading.
-- 
View this message in context: 
http://www.nabble.com/problem-of-mutiple-resources-with-the-same-location-and-names-at-classpath-during-testing-tf4028919s177.html#a11444124
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Ant Mojo - Maven classpath

2007-07-04 Thread Jon SlinnHawkins

Hi All,

Is it possible to pass / access the maven project classpath inside of an 
ant mojo build file.


I see that you can with the antrun plugin, but can you do the same with 
 self written ant mojo's ?


I want to get at :

${maven.dependency.classpath}
${maven.compile.classpath}
${maven.runtime.classpath}
${maven.test.classpath}
${maven.plugin.classpath}

Thanks

Jon


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



RE: Surefire includes artifacts with scope 'provided' in the runtime classpath, is this correct?

2007-07-03 Thread frodesto


Jörg Schaible wrote:
> 
> 
> Why is it a problem for you, that it is available in the classpath for the
> test?
> 
> - Jörg
> 
> 

Hi again. I see your point in that in many (most?) cases you actually would
like the artifacts with scope 'provided' to be available in the classpath
for the unit tests.

However, in my case this causes problems since the javaee-api.jar cannot be
used at runtime. It only provides the interface part of the Java EE APIs,
but no implementation. If you try to use it at runtime, you will get
java.lang.ClassFormatError and other weird exceptions.  You have to use a
"real" JavaEE implementation at runtime.

In my case I am using the javaee-api to get access to the JMS API
(javax.jms). I need the API classes to get my code to compile, but I cannot
include this jar as a compile-time dependency since the app-server/JMS
provider will provide the "real" JMS implementation.

I my unit tests I need a "real" JMS implementation, and I am using ActiveMQ. 
ActiveMQ also bundles the javax.jms package, and this is the one I need to
use at test-time. I have included the ActiveMQ jar as scope="test"
dependency. When I run the unit tests, I get a classpath with two different
versions of the javax.jms package (a "dummy implementation" in
javaee-api.jar and a real one in activemq-core.jar), and unfortunately it
seems like the JVM chooses the wrong one.

I need a way to make Surefire skip the javaee-api.jar from the test-time
classpath or a way to control which version the JVM will use. 

Frode

-- 
View this message in context: 
http://www.nabble.com/Surefire-includes-artifacts-with-scope-%27provided%27-in-the-runtime-classpath%2C-is-this-correct--tf4016962s177.html#a11421886
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Surefire includes artifacts with scope 'provided' in the runtime classpath, is this correct?

2007-07-03 Thread Frode Stokke

Hi.

Surefire seems to include dependency artifacts with  provided in the
classpath when running unit tests. Is this a bug? Shouldn't such artifacts
only be included in the compile-time classpath?

The output from 'mvn -X test' is shown below. The artifact that is causing
problems for me is the javaee5-api.jar which should not be present in the
runtime classpath (should be substituted with a real Java EE 5 container
jar, not shown in the example below).


+ Error stacktraces are turned on.
Maven version: 2.0.7
Java version: 1.6.0_01
OS name: "windows xp" version: "5.1" arch: "x86"
...
[DEBUG] Configuring mojo '
org.apache.maven.plugins:maven-surefire-plugin:2.2:test' -->
...
[DEBUG]   (f) classpathElements = [...,
...\.m2\repository\javaee\javaee-api\5\javaee-api-5.jar, ...]
...
[DEBUG]   (f) projectArtifactMap =
{javaee:javaee-api=javaee:javaee-api:jar:5:provided,
junit:junit=junit:junit:jar:3.8.1:test}
...
[DEBUG] -- end configuration --
...
[DEBUG] Test Classpath :
...
[DEBUG]   ...\.m2\repository\javaee\javaee-api\5\javaee-api-5.jar
[DEBUG]   ...\.m2\repository\junit\junit\3.8.1\junit-3.8.1.jar


RE: Surefire includes artifacts with scope 'provided' in the runtime classpath, is this correct?

2007-07-03 Thread Jörg Schaible
Frode Stokke wrote on Tuesday, July 03, 2007 10:36 AM:

> Hi.
> 
> Surefire seems to include dependency artifacts with  provided
> in the classpath when running unit tests. Is this a bug? Shouldn't
> such artifacts
> only be included in the compile-time classpath?

Yes. Provided means, that the dependency will be available in the target 
runtime environment. But you don't run your tests there, so it must be 
available in the classpath running the test.

> The output from 'mvn -X test' is shown below. The artifact
> that is causing
> problems for me is the javaee5-api.jar which should not be present in
> the runtime classpath (should be substituted with a real Java EE 5
> container jar, not shown in the example below).
> 
> + Error stacktraces are turned on.
> Maven version: 2.0.7
> Java version: 1.6.0_01
> OS name: "windows xp" version: "5.1" arch: "x86"
> ...
> [DEBUG] Configuring mojo '
> org.apache.maven.plugins:maven-surefire-plugin:2.2:test' --> ...
> [DEBUG]   (f) classpathElements = [...,
> ...\.m2\repository\javaee\javaee-api\5\javaee-api-5.jar, ...] ...
> [DEBUG]   (f) projectArtifactMap =
> {javaee:javaee-api=javaee:javaee-api:jar:5:provided,
> junit:junit=junit:junit:jar:3.8.1:test}
> ...
> [DEBUG] -- end configuration --
> ...
> [DEBUG] Test Classpath :
> ...
> [DEBUG]   ...\.m2\repository\javaee\javaee-api\5\javaee-api-5.jar
> [DEBUG]   ...\.m2\repository\junit\junit\3.8.1\junit-3.8.1.jar

Why is it a problem for you, that it is available in the classpath for the test?

- Jörg

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



Re: adding the classpath to jar file

2007-06-27 Thread MUSTAFA SAIT OZEN
this method can bu used to combine DB2 Universal Type 4 Driver jars.There are 
two jars. One of them is licence jar another one is main jar. If licence jar is 
not added at the same classpath, main jar can not work.

-Orijinal e-posta iletisi-
From: "Keith Beattie" [EMAIL PROTECTED]
Date: Wed, 27 Jun 2007 01:04:19 +0300
To: "Maven Users List" users@maven.apache.org
Subject: Re: adding the classpath to jar file

> On 6/26/07, DCVer <[EMAIL PROTECTED]> wrote:
> >
> >
> > Ok, thanks for some information!
> 
> 
> I've gotten Maven to create an executable jar which sets a class-path in its
> manifest file  pointing (via a *relative* path) to contained dependent jars
> within the same jar though the use of the jar and assembly plugins [1].  So
> this *is* possible but of little use beyond just having them all in a single
> container due to the classloading problem [2].
> 
> [1] 
> http://dsd.lbl.gov/~ksb/Scratch/Maven_notes.html<http://dsd.lbl.gov/%7Eksb/Scratch/Maven_notes.html>
> [2] http://one-jar.sourceforge.net/
> 
> ksb
> 
> 

---
Mustafa Sait ÖZEN
Elektrik-Elektronik Mühendisi / Electrical-Electronics Engineer
+9 0 222 335 05 80 /1390


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



Re: adding the classpath to jar file

2007-06-26 Thread Keith Beattie

On 6/26/07, DCVer <[EMAIL PROTECTED]> wrote:



Ok, thanks for some information!



I've gotten Maven to create an executable jar which sets a class-path in its
manifest file  pointing (via a *relative* path) to contained dependent jars
within the same jar though the use of the jar and assembly plugins [1].  So
this *is* possible but of little use beyond just having them all in a single
container due to the classloading problem [2].

[1] 
http://dsd.lbl.gov/~ksb/Scratch/Maven_notes.html
[2] http://one-jar.sourceforge.net/

ksb


Re: adding the classpath to jar file

2007-06-26 Thread Wayne Fay

Maven is a BUILD tool not a RUNTIME tool. So your assumptions about
what Maven will do for you regarding your dependencies etc at runtime
are simply invalid. Dependency jars do not necessarily live in the
same location on all your machines.

If you require a single jar that "just runs", you can build an "uber
jar" containing all your dependencies etc along with your own project
jars using the Assembly plugin and "jar-with-dependencies"
configuration. This has been discussed numerous times on this list and
is well-documented on the Maven website.

Wayne

On 6/26/07, DCVer <[EMAIL PROTECTED]> wrote:


Ok, thanks for some information!


Jan-Christopher Bals-2 wrote:
>
> Yes. The behavior is correct.
>
> Maven does not include the log4j jar because jars cannot contain other
> jars.
>
> When you use additional jars at runtime, you have to provide them via the
> classpath.
>
> And as far as i know you cannot define the classpath of jar inside the jar
> like the main class.
>
> So maven cannot set the classpath for you. Moreover Maven cannot know
> where
> the jar is executed, so it cannot guarantee that the referenced jars in
> the
> classpath are present.
>
> 2007/6/26, DCVer <[EMAIL PROTECTED]>:
>>
>>
>> Thanks for reply.
>>
>> Hmm, I think my jar doesn't contain log4j - it only contains App.class
>> and
>> pom.xml with pom.properties and manifest.mf. Is it a correctly built jar?
>>
>> And I wonder why Maven2 won't set *somewhere* classpaths to jars on its
>> own
>> if it knows where they are :-/
>>
>>
>> Jan-Christopher Bals-2 wrote:
>> >
>> > You have to provide log4j via the classpath on your own.
>> > Maven does include log4j in your generated jar automatically.
>> >
>> > But Maven can generate the classpath for you
>> > http://maven.apache.org/plugins/maven-dependency-plugin/usage.html
>> > ->dependency:build-classpath
>> >
>> >
>> > 2007/6/26, DCVer <[EMAIL PROTECTED]>:
>> >>
>> >>
>> >> Hi,
>> >>
>> >> I'm creating a jar using "mvn package". The files, which are included
>> in
>> >> this jar are using another jar (e.g. log4j-1.2.14.jar), which are
>> stored
>> >> in
>> >> maven repository. My part of pom.xml file responsible for dependencies
>> >> looks
>> >> like:
>> >>
>> >> 
>> >>   log4j
>> >>   log4j
>> >>   1.2.14
>> >>   compile
>> >>   jar
>> >> 
>> >>
>> >> The "mvn package" process finishes correctly, but when i run the jar
>> >> using:
>> >>
>> >> java -cp target\my-app-1.0-SNAPSHOT.jar com.mycompany.app.App
>> >>
>> >> i receive the error:
>> >>
>> >> Exception in thread "main" java.lang.NoClassDefFoundError:
>> >> org/apache/log4j/Logger
>> >>
>> >> (on line:
>> >> private static Logger logger = Logger.getLogger("com.mycompany.app.App
>> ");
>> >>
>> >> In my opinion the jar, that was created using "mvn package" doesn't
>> know
>> >> about dependencies (and about jars stored in repository?). How should
>> I
>> >> set
>> >> classpaths and make this jar work correctly? Isn't it a BASIC
>> >> functionality,
>> >> that Maven2 should do, when I set  in pom.xml file?
>> >>
>> >> I tried this with other jars (in repository) and other methods of the
>> >> classes included in jars and the results were exactly the same.
>> >> --
>> >> View this message in context:
>> >>
>> 
http://www.nabble.com/adding-the-classpath-to-jar-file-tf3982263s177.html#a11305225
>> >> Sent from the Maven - Users mailing list archive at Nabble.com.
>> >>
>> >>
>> >> -
>> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> For additional commands, e-mail: [EMAIL PROTECTED]
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> 
http://www.nabble.com/adding-the-classpath-to-jar-file-tf3982263s177.html#a11305662
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>

--
View this message in context: 
http://www.nabble.com/adding-the-classpath-to-jar-file-tf3982263s177.html#a11306165
Sent from the Maven - Users mailing list archive at Nabble.com.


-
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: adding the classpath to jar file

2007-06-26 Thread DCVer

Ok, thanks for some information!


Jan-Christopher Bals-2 wrote:
> 
> Yes. The behavior is correct.
> 
> Maven does not include the log4j jar because jars cannot contain other
> jars.
> 
> When you use additional jars at runtime, you have to provide them via the
> classpath.
> 
> And as far as i know you cannot define the classpath of jar inside the jar
> like the main class.
> 
> So maven cannot set the classpath for you. Moreover Maven cannot know
> where
> the jar is executed, so it cannot guarantee that the referenced jars in
> the
> classpath are present.
> 
> 2007/6/26, DCVer <[EMAIL PROTECTED]>:
>>
>>
>> Thanks for reply.
>>
>> Hmm, I think my jar doesn't contain log4j - it only contains App.class
>> and
>> pom.xml with pom.properties and manifest.mf. Is it a correctly built jar?
>>
>> And I wonder why Maven2 won't set *somewhere* classpaths to jars on its
>> own
>> if it knows where they are :-/
>>
>>
>> Jan-Christopher Bals-2 wrote:
>> >
>> > You have to provide log4j via the classpath on your own.
>> > Maven does include log4j in your generated jar automatically.
>> >
>> > But Maven can generate the classpath for you
>> > http://maven.apache.org/plugins/maven-dependency-plugin/usage.html
>> > ->dependency:build-classpath
>> >
>> >
>> > 2007/6/26, DCVer <[EMAIL PROTECTED]>:
>> >>
>> >>
>> >> Hi,
>> >>
>> >> I'm creating a jar using "mvn package". The files, which are included
>> in
>> >> this jar are using another jar (e.g. log4j-1.2.14.jar), which are
>> stored
>> >> in
>> >> maven repository. My part of pom.xml file responsible for dependencies
>> >> looks
>> >> like:
>> >>
>> >> 
>> >>   log4j
>> >>   log4j
>> >>   1.2.14
>> >>   compile
>> >>   jar
>> >> 
>> >>
>> >> The "mvn package" process finishes correctly, but when i run the jar
>> >> using:
>> >>
>> >> java -cp target\my-app-1.0-SNAPSHOT.jar com.mycompany.app.App
>> >>
>> >> i receive the error:
>> >>
>> >> Exception in thread "main" java.lang.NoClassDefFoundError:
>> >> org/apache/log4j/Logger
>> >>
>> >> (on line:
>> >> private static Logger logger = Logger.getLogger("com.mycompany.app.App
>> ");
>> >>
>> >> In my opinion the jar, that was created using "mvn package" doesn't
>> know
>> >> about dependencies (and about jars stored in repository?). How should
>> I
>> >> set
>> >> classpaths and make this jar work correctly? Isn't it a BASIC
>> >> functionality,
>> >> that Maven2 should do, when I set  in pom.xml file?
>> >>
>> >> I tried this with other jars (in repository) and other methods of the
>> >> classes included in jars and the results were exactly the same.
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/adding-the-classpath-to-jar-file-tf3982263s177.html#a11305225
>> >> Sent from the Maven - Users mailing list archive at Nabble.com.
>> >>
>> >>
>> >> -
>> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> For additional commands, e-mail: [EMAIL PROTECTED]
>> >>
>> >>
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/adding-the-classpath-to-jar-file-tf3982263s177.html#a11305662
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/adding-the-classpath-to-jar-file-tf3982263s177.html#a11306165
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Re: adding the classpath to jar file

2007-06-26 Thread Jan-Christopher Bals

Yes. The behavior is correct.

Maven does not include the log4j jar because jars cannot contain other jars.

When you use additional jars at runtime, you have to provide them via the
classpath.

And as far as i know you cannot define the classpath of jar inside the jar
like the main class.

So maven cannot set the classpath for you. Moreover Maven cannot know where
the jar is executed, so it cannot guarantee that the referenced jars in the
classpath are present.

2007/6/26, DCVer <[EMAIL PROTECTED]>:



Thanks for reply.

Hmm, I think my jar doesn't contain log4j - it only contains App.class and
pom.xml with pom.properties and manifest.mf. Is it a correctly built jar?

And I wonder why Maven2 won't set *somewhere* classpaths to jars on its
own
if it knows where they are :-/


Jan-Christopher Bals-2 wrote:
>
> You have to provide log4j via the classpath on your own.
> Maven does include log4j in your generated jar automatically.
>
> But Maven can generate the classpath for you
> http://maven.apache.org/plugins/maven-dependency-plugin/usage.html
> ->dependency:build-classpath
>
>
> 2007/6/26, DCVer <[EMAIL PROTECTED]>:
>>
>>
>> Hi,
>>
>> I'm creating a jar using "mvn package". The files, which are included
in
>> this jar are using another jar (e.g. log4j-1.2.14.jar), which are
stored
>> in
>> maven repository. My part of pom.xml file responsible for dependencies
>> looks
>> like:
>>
>> 
>>   log4j
>>   log4j
>>   1.2.14
>>   compile
>>   jar
>> 
>>
>> The "mvn package" process finishes correctly, but when i run the jar
>> using:
>>
>> java -cp target\my-app-1.0-SNAPSHOT.jar com.mycompany.app.App
>>
>> i receive the error:
>>
>> Exception in thread "main" java.lang.NoClassDefFoundError:
>> org/apache/log4j/Logger
>>
>> (on line:
>> private static Logger logger = Logger.getLogger("com.mycompany.app.App
");
>>
>> In my opinion the jar, that was created using "mvn package" doesn't
know
>> about dependencies (and about jars stored in repository?). How should I
>> set
>> classpaths and make this jar work correctly? Isn't it a BASIC
>> functionality,
>> that Maven2 should do, when I set  in pom.xml file?
>>
>> I tried this with other jars (in repository) and other methods of the
>> classes included in jars and the results were exactly the same.
>> --
>> View this message in context:
>>
http://www.nabble.com/adding-the-classpath-to-jar-file-tf3982263s177.html#a11305225
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
>

--
View this message in context:
http://www.nabble.com/adding-the-classpath-to-jar-file-tf3982263s177.html#a11305662
Sent from the Maven - Users mailing list archive at Nabble.com.


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




Re: adding the classpath to jar file

2007-06-26 Thread DCVer

Thanks for reply.

Hmm, I think my jar doesn't contain log4j - it only contains App.class and
pom.xml with pom.properties and manifest.mf. Is it a correctly built jar?

And I wonder why Maven2 won't set *somewhere* classpaths to jars on its own
if it knows where they are :-/


Jan-Christopher Bals-2 wrote:
> 
> You have to provide log4j via the classpath on your own.
> Maven does include log4j in your generated jar automatically.
> 
> But Maven can generate the classpath for you
> http://maven.apache.org/plugins/maven-dependency-plugin/usage.html
> ->dependency:build-classpath
> 
> 
> 2007/6/26, DCVer <[EMAIL PROTECTED]>:
>>
>>
>> Hi,
>>
>> I'm creating a jar using "mvn package". The files, which are included in
>> this jar are using another jar (e.g. log4j-1.2.14.jar), which are stored
>> in
>> maven repository. My part of pom.xml file responsible for dependencies
>> looks
>> like:
>>
>> 
>>   log4j
>>   log4j
>>   1.2.14
>>   compile
>>   jar
>> 
>>
>> The "mvn package" process finishes correctly, but when i run the jar
>> using:
>>
>> java -cp target\my-app-1.0-SNAPSHOT.jar com.mycompany.app.App
>>
>> i receive the error:
>>
>> Exception in thread "main" java.lang.NoClassDefFoundError:
>> org/apache/log4j/Logger
>>
>> (on line:
>> private static Logger logger = Logger.getLogger("com.mycompany.app.App");
>>
>> In my opinion the jar, that was created using "mvn package" doesn't know
>> about dependencies (and about jars stored in repository?). How should I
>> set
>> classpaths and make this jar work correctly? Isn't it a BASIC
>> functionality,
>> that Maven2 should do, when I set  in pom.xml file?
>>
>> I tried this with other jars (in repository) and other methods of the
>> classes included in jars and the results were exactly the same.
>> --
>> View this message in context:
>> http://www.nabble.com/adding-the-classpath-to-jar-file-tf3982263s177.html#a11305225
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/adding-the-classpath-to-jar-file-tf3982263s177.html#a11305662
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Re: adding the classpath to jar file

2007-06-26 Thread Jan-Christopher Bals

You have to provide log4j via the classpath on your own.
Maven does include log4j in your generated jar automatically.

But Maven can generate the classpath for you
http://maven.apache.org/plugins/maven-dependency-plugin/usage.html
->dependency:build-classpath


2007/6/26, DCVer <[EMAIL PROTECTED]>:



Hi,

I'm creating a jar using "mvn package". The files, which are included in
this jar are using another jar (e.g. log4j-1.2.14.jar), which are stored
in
maven repository. My part of pom.xml file responsible for dependencies
looks
like:


  log4j
  log4j
  1.2.14
  compile
  jar


The "mvn package" process finishes correctly, but when i run the jar
using:

java -cp target\my-app-1.0-SNAPSHOT.jar com.mycompany.app.App

i receive the error:

Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/log4j/Logger

(on line:
private static Logger logger = Logger.getLogger("com.mycompany.app.App");

In my opinion the jar, that was created using "mvn package" doesn't know
about dependencies (and about jars stored in repository?). How should I
set
classpaths and make this jar work correctly? Isn't it a BASIC
functionality,
that Maven2 should do, when I set  in pom.xml file?

I tried this with other jars (in repository) and other methods of the
classes included in jars and the results were exactly the same.
--
View this message in context:
http://www.nabble.com/adding-the-classpath-to-jar-file-tf3982263s177.html#a11305225
Sent from the Maven - Users mailing list archive at Nabble.com.


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




adding the classpath to jar file

2007-06-26 Thread DCVer

Hi,

I'm creating a jar using "mvn package". The files, which are included in
this jar are using another jar (e.g. log4j-1.2.14.jar), which are stored in
maven repository. My part of pom.xml file responsible for dependencies looks
like:


  log4j
  log4j
  1.2.14
  compile
  jar


The "mvn package" process finishes correctly, but when i run the jar using:

java -cp target\my-app-1.0-SNAPSHOT.jar com.mycompany.app.App

i receive the error:

Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/log4j/Logger

(on line:
private static Logger logger = Logger.getLogger("com.mycompany.app.App");

In my opinion the jar, that was created using "mvn package" doesn't know
about dependencies (and about jars stored in repository?). How should I set
classpaths and make this jar work correctly? Isn't it a BASIC functionality,
that Maven2 should do, when I set  in pom.xml file?

I tried this with other jars (in repository) and other methods of the
classes included in jars and the results were exactly the same.
-- 
View this message in context: 
http://www.nabble.com/adding-the-classpath-to-jar-file-tf3982263s177.html#a11305225
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Re: native2ascii classpath woes

2007-06-25 Thread Alexander Sack

Can someone give me an example of using the antrun plugin to call
native2ascii directly?  I searched the archive, found a thread, but its not
working.  antrun claims it can't find native2ascii as a task and I DID
include the ant-nodeps, 1.6.5 in my dependency tree (as provided).

-aps

On 6/25/07, Alexander Sack <[EMAIL PROTECTED]> wrote:


Uggh, on a side note the plugin is breaking because of the profile used to
add tools.jar.  The FAQ for adding tools.jar is a very bad idea:

http://maven.apache.org/general.html#tools-jar-dependency

This assumes a JDK by Sun which may not be the case on many platforms.  It
would be better to really look for tools.jar off of JAVA_HOME (at least
don't key off of java.vendor string).

-aps

On 6/25/07, Alexander Sack <[EMAIL PROTECTED]> wrote:
>
> I'm confused Niraj.  I understand that is the normal way I would do it
> in Java, how would I do that within my Maven pom file?
>
> -aps
>
> On 6/25/07, Alok, Niraj <[EMAIL PROTECTED]> wrote:
> >
> > You could use Thread.currentThread().getContextLoader()
> > and then iterate through the urls list which are locations of jar
> > files.
> >
> >
> > -Original Message-
> > From: Alexander Sack [mailto: [EMAIL PROTECTED]
> > Sent: Tuesday, June 26, 2007 1:37 AM
> > To: Maven Users List
> > Subject: native2ascii classpath woes
> >
> > I'm using the native2ascii codehaus plugin and on windows it works
> > fine,
> > but
> > on my Unix box it fails with:
> >
> > --- Nested Exception ---
> > java.lang.ClassNotFoundException: sun.tools.native2ascii.Main
> > at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> > at java.security.AccessController.doPrivileged (Native Method)
> > at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> >
> > Now tools.jar is in my JAVA_HOME/lib directory and as such I would
> > think
> > be
> > in the system class path, yet its not finding it?  I did a little
> > searching
> > and I know someone recently had issues specifically on Mac because its
> > JDK
> > doesn't have a tools.jar (its in their classes.jar).  Okay, but that's
> > not
> > the case here.
> >
> > It seems the native2ascii plugin just forwards the task to the built
> > in
> > ANT
> > optional task which itself calls native2ascii (that's what I would
> > guess
> > from looking at the exception trace).
> >
> > How can I debug the runtime classpath of a Maven2 build cycle?
> >
> > -aps
> >
> > --
> > "What lies behind us and what lies in front of us is of little concern
> > to
> > what lies within us." -Ralph Waldo Emerson
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> "What lies behind us and what lies in front of us is of little concern
> to what lies within us." -Ralph Waldo Emerson
>



--
"What lies behind us and what lies in front of us is of little concern to
what lies within us." -Ralph Waldo Emerson





--
"What lies behind us and what lies in front of us is of little concern to
what lies within us." -Ralph Waldo Emerson


Re: native2ascii classpath woes

2007-06-25 Thread Alexander Sack

Uggh, on a side note the plugin is breaking because of the profile used to
add tools.jar.  The FAQ for adding tools.jar is a very bad idea:

http://maven.apache.org/general.html#tools-jar-dependency

This assumes a JDK by Sun which may not be the case on many platforms.  It
would be better to really look for tools.jar off of JAVA_HOME (at least
don't key off of java.vendor string).

-aps

On 6/25/07, Alexander Sack <[EMAIL PROTECTED]> wrote:


I'm confused Niraj.  I understand that is the normal way I would do it in
Java, how would I do that within my Maven pom file?

-aps

On 6/25/07, Alok, Niraj <[EMAIL PROTECTED]> wrote:
>
> You could use Thread.currentThread().getContextLoader()
> and then iterate through the urls list which are locations of jar files.
>
>
> -Original Message-
> From: Alexander Sack [mailto: [EMAIL PROTECTED]
> Sent: Tuesday, June 26, 2007 1:37 AM
> To: Maven Users List
> Subject: native2ascii classpath woes
>
> I'm using the native2ascii codehaus plugin and on windows it works fine,
> but
> on my Unix box it fails with:
>
> --- Nested Exception ---
> java.lang.ClassNotFoundException: sun.tools.native2ascii.Main
> at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
> at java.security.AccessController.doPrivileged (Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>
> Now tools.jar is in my JAVA_HOME/lib directory and as such I would think
> be
> in the system class path, yet its not finding it?  I did a little
> searching
> and I know someone recently had issues specifically on Mac because its
> JDK
> doesn't have a tools.jar (its in their classes.jar).  Okay, but that's
> not
> the case here.
>
> It seems the native2ascii plugin just forwards the task to the built in
> ANT
> optional task which itself calls native2ascii (that's what I would guess
> from looking at the exception trace).
>
> How can I debug the runtime classpath of a Maven2 build cycle?
>
> -aps
>
> --
> "What lies behind us and what lies in front of us is of little concern
> to
> what lies within us." -Ralph Waldo Emerson
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
"What lies behind us and what lies in front of us is of little concern to
what lies within us." -Ralph Waldo Emerson





--
"What lies behind us and what lies in front of us is of little concern to
what lies within us." -Ralph Waldo Emerson


Re: native2ascii classpath woes

2007-06-25 Thread Alexander Sack

I'm confused Niraj.  I understand that is the normal way I would do it in
Java, how would I do that within my Maven pom file?

-aps

On 6/25/07, Alok, Niraj <[EMAIL PROTECTED]> wrote:


You could use Thread.currentThread().getContextLoader()
and then iterate through the urls list which are locations of jar files.


-Original Message-
From: Alexander Sack [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 26, 2007 1:37 AM
To: Maven Users List
Subject: native2ascii classpath woes

I'm using the native2ascii codehaus plugin and on windows it works fine,
but
on my Unix box it fails with:

--- Nested Exception ---
java.lang.ClassNotFoundException: sun.tools.native2ascii.Main
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)

Now tools.jar is in my JAVA_HOME/lib directory and as such I would think
be
in the system class path, yet its not finding it?  I did a little
searching
and I know someone recently had issues specifically on Mac because its
JDK
doesn't have a tools.jar (its in their classes.jar).  Okay, but that's
not
the case here.

It seems the native2ascii plugin just forwards the task to the built in
ANT
optional task which itself calls native2ascii (that's what I would guess
from looking at the exception trace).

How can I debug the runtime classpath of a Maven2 build cycle?

-aps

--
"What lies behind us and what lies in front of us is of little concern
to
what lies within us." -Ralph Waldo Emerson

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





--
"What lies behind us and what lies in front of us is of little concern to
what lies within us." -Ralph Waldo Emerson


RE: native2ascii classpath woes

2007-06-25 Thread Alok, Niraj
You could use Thread.currentThread().getContextLoader()
and then iterate through the urls list which are locations of jar files.


-Original Message-
From: Alexander Sack [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 26, 2007 1:37 AM
To: Maven Users List
Subject: native2ascii classpath woes

I'm using the native2ascii codehaus plugin and on windows it works fine,
but
on my Unix box it fails with:

--- Nested Exception ---
java.lang.ClassNotFoundException: sun.tools.native2ascii.Main
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)

Now tools.jar is in my JAVA_HOME/lib directory and as such I would think
be
in the system class path, yet its not finding it?  I did a little
searching
and I know someone recently had issues specifically on Mac because its
JDK
doesn't have a tools.jar (its in their classes.jar).  Okay, but that's
not
the case here.

It seems the native2ascii plugin just forwards the task to the built in
ANT
optional task which itself calls native2ascii (that's what I would guess
from looking at the exception trace).

How can I debug the runtime classpath of a Maven2 build cycle?

-aps

-- 
"What lies behind us and what lies in front of us is of little concern
to
what lies within us." -Ralph Waldo Emerson

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



native2ascii classpath woes

2007-06-25 Thread Alexander Sack

I'm using the native2ascii codehaus plugin and on windows it works fine, but
on my Unix box it fails with:

--- Nested Exception ---
java.lang.ClassNotFoundException: sun.tools.native2ascii.Main
   at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:188)

Now tools.jar is in my JAVA_HOME/lib directory and as such I would think be
in the system class path, yet its not finding it?  I did a little searching
and I know someone recently had issues specifically on Mac because its JDK
doesn't have a tools.jar (its in their classes.jar).  Okay, but that's not
the case here.

It seems the native2ascii plugin just forwards the task to the built in ANT
optional task which itself calls native2ascii (that's what I would guess
from looking at the exception trace).

How can I debug the runtime classpath of a Maven2 build cycle?

-aps

--
"What lies behind us and what lies in front of us is of little concern to
what lies within us." -Ralph Waldo Emerson


RE: Surefire classpath issues

2007-06-23 Thread Randall Fidler
Barrett,

Thanks for your input, glad to know I'm not the only one fighting
the plug-in.  I was hoping that somebody on the list had a work around
but it doesn't appear so.  I'll follow your suggestion and either add to
your existing bug or log a new one with a example project.

Regards,

Randall

-Original Message-
From: Barrett Nuzum [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 20, 2007 8:42 AM
To: Maven Users List
Subject: RE: Surefire classpath issues

Randall:
 
Surefire seems to have a number of issues because of it's dedicated
Resource and Class loaders.
I believe the best practice here is to make an example project and
submit a bug to codehaus.
I've had to do so.
 
http://jira.codehaus.org/browse/SUREFIRE-340
 
Barrett
 
::   
Barrett Nuzum
Consultant, Skill Development
Direct: 918.640.4414
Fax: 972.789.1340 

Valtech Technologies, Inc.
5080 Spectrum Drive
Suite 700 West
Addison, Texas 75001
www.valtech.com <http://www.valtech.com/>   
making IT business friendly




From: Randall Fidler [mailto:[EMAIL PROTECTED]
Sent: Wed 6/20/2007 9:58 AM
To: users@maven.apache.org
Subject: Surefire classpath issues



Hello,



Have an issue with trying to leverage Blowfish which ships
with Java 1.5 in relation to unit tests.  The test which I'm trying to
run is using JAXB and Blowfish impl which comes with Java 1.5, i.e.
what's in SunJCE.jar (jre/lib/ext).   



Before I was using a different impl of Blowfish, third party jar
(cryptix) and that was setup as a dependency in my pom so JAXB and the
blowfish impl were on the same "level" - no problems.  The fun begins
when I switch from the third party jar and try to use the java provided
impl.  Now, I can use JAXB and the Java impl together fine, say, when I
run the actual application which is being tested - problems only happen
when running the unit tests via Maven.



First problem:



java.lang.NoClassDefFoundError: com/sun/crypto/provider/SunJCE

Resolved this by enabling the childDelegation for the
surefire plugin.



org.apache.maven.plugins

maven-surefire-plugin



always

true



Note - The surefire plugin describes the childDelegation option as:





When false it makes tests run using the standard classloader delegation
instead of the default Maven isolated classloader. Only used when
forking (forkMode is not "none").



Setting it to false helps with some problems caused by conflicts between
xml parsers in the classpath and the Java 5 provider parser. Default
value is false.











Second problem:

   

When I enable the childDelegation, the plugin then cannot
find the JAXB classes (setup as dependencies in the pom).  I've tried
test/compile scopes on the dependencies but to no avail.



Note: I tried the true
option, but that only seemed to make things worse.









Any help is greatly appreciated!



Regards,



Randall




-
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: Classpath in EAR's manifest?

2007-06-22 Thread Jörg Schaible
[EMAIL PROTECTED] wrote on Friday, June 22, 2007 12:29 PM:

> Hallo Jörg,
> 
>> -Original Message-
>> From: ext Jörg Schaible [mailto:[EMAIL PROTECTED]
>>> Can I turn that off somehow? I couldn't find an option in the
>>> documentation in
>>> http://maven.apache.org/plugins/maven-ear-plugin/ear-mojo.html 
>> 
>> None of my generated EARs has a manifest that contains a
>> Class-Path entry. So it must be something within your
>> configuration or you provide a manually generated one.
> 
> You were right. Sorry for the fuss:
> 
>  
> maven-ear-plugin
>  ...
>  
> 
>true
>
>
>  
> 
> I think this explains it :(

Definitely ;-)

- Jörg

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



RE: Classpath in EAR's manifest?

2007-06-22 Thread andreas.ebbert-karroum
Hallo Jörg, 

>-Original Message-
>From: ext Jörg Schaible [mailto:[EMAIL PROTECTED] 
>> Can I turn that off somehow? I couldn't find an option in the 
>> documentation in 
>> http://maven.apache.org/plugins/maven-ear-plugin/ear-mojo.html
>
>None of my generated EARs has a manifest that contains a 
>Class-Path entry. So it must be something within your 
>configuration or you provide a manually generated one. 

You were right. Sorry for the fuss:

 
maven-ear-plugin

...
 

   true

  
   
 

I think this explains it :(

Andreas

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



RE: Classpath in EAR's manifest?

2007-06-21 Thread Jörg Schaible
Hi Anread, 

> -Original Message-
> From: andreas.ebbert-karroum
> Sent: Thursday, June 21, 2007 11:54 AM
> Subject: Classpath in EAR's manifest?
> 
> Hi,
>  
> why is the classpath also generated in the EAR's manifest? It 
> should not, the JavaEE verifier in netbeans is complaining about it:
>  
> 
>   Manifest file of an EAR file should not contain 
> Class-Path entries. Please refer to J2EE 1.4 Platform 
> Specification Section #8.2   for further information.
>   Manifest file of this EAR file contains [ ... ] as the 
> Class-Path entry.  
>   
> 
> Can I turn that off somehow? I couldn't find an option in the 
> documentation in 
> http://maven.apache.org/plugins/maven-ear-plugin/ear-mojo.html

None of my generated EARs has a manifest that contains a Class-Path entry. So 
it must be something within your configuration or you provide a manually 
generated one. You can print the effective POM (mvn help:effective-pom) and 
compare the settings for the ear-plugin with my settings though:

[snip]

  maven-ear-plugin
  2.3
  

  false
  

true

true
  

  

[snip]


- Jörg

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



Classpath in EAR's manifest?

2007-06-21 Thread andreas.ebbert-karroum
Hi,
 
why is the classpath also generated in the EAR's manifest? It should not, the 
JavaEE verifier in netbeans is complaining about it:
 

Manifest file of an EAR file should not contain Class-Path entries. 
Please refer to J2EE 1.4 Platform Specification Section #8.2   for further 
information.
Manifest file of this EAR file contains [ ... ] as the Class-Path 
entry.  


Can I turn that off somehow? I couldn't find an option in the documentation in 
http://maven.apache.org/plugins/maven-ear-plugin/ear-mojo.html
 
Thanks,
Andreas Ebbert-Karroum 
  Senior Software Design Engineer - Nokia Siemens Networks / Operations & 
Business Software 
  phone: +49-211-94123928, fax: +49-211-94123838 
  Heltorfer Straße 1, 40472 Düsseldorf, Germany 




Nokia Siemens Networks GmbH & Co. KG * Sitz der Gesellschaft: München / 
Registered office: Munich * Registergericht: München / Commercial registry: 
Munich, HRA 88537 * WEEE-Reg.-Nr.: DE 52984304 

Persönlich haftende Gesellschafterin / General Partner: Nokia Siemens Networks 
Management GmbH * Geschäftsleitung / Board of Directors: Joachim Malterer, 
Lydia Sommer * Sitz der Gesellschaft: München / Registered office: Munich * 
Registergericht: München / Commercial registry: Munich, HRB 163416 



This message is confidential. If you have received this message in error, 
please delete it from your system. You should not copy it for any purpose, or 
disclose its contents to any other person. Internet communications are not 
secure and therefore Nokia Siemens Networks GmbH & Co. KG does not accept legal 
responsibility for the contents of this message as it has been transmitted over 
a public network. Thank you.

Nokia Siemens Networks GmbH & Co. KG is a German Company. Further information 
about the Company is available from its offices at Heltorferstrasse 1, D-40472, 
Düsseldorf, Germany and from the website at http://www.nsn.com/



 


RE: Surefire classpath issues

2007-06-20 Thread Barrett Nuzum
Randall:
 
Surefire seems to have a number of issues because of it's dedicated Resource 
and Class loaders.
I believe the best practice here is to make an example project and submit a bug 
to codehaus.
I've had to do so.
 
http://jira.codehaus.org/browse/SUREFIRE-340
 
Barrett
 
::   
Barrett Nuzum
Consultant, Skill Development
Direct: 918.640.4414
Fax: 972.789.1340 

Valtech Technologies, Inc.
5080 Spectrum Drive
Suite 700 West
Addison, Texas 75001
www.valtech.com <http://www.valtech.com/>   
making IT business friendly




From: Randall Fidler [mailto:[EMAIL PROTECTED]
Sent: Wed 6/20/2007 9:58 AM
To: users@maven.apache.org
Subject: Surefire classpath issues



Hello,



Have an issue with trying to leverage Blowfish which ships
with Java 1.5 in relation to unit tests.  The test which I'm trying to
run is using JAXB and Blowfish impl which comes with Java 1.5, i.e.
what's in SunJCE.jar (jre/lib/ext).   



Before I was using a different impl of Blowfish, third party jar
(cryptix) and that was setup as a dependency in my pom so JAXB and the
blowfish impl were on the same "level" - no problems.  The fun begins
when I switch from the third party jar and try to use the java provided
impl.  Now, I can use JAXB and the Java impl together fine, say, when I
run the actual application which is being tested - problems only happen
when running the unit tests via Maven.



First problem:



java.lang.NoClassDefFoundError: com/sun/crypto/provider/SunJCE

Resolved this by enabling the childDelegation for the
surefire plugin.



org.apache.maven.plugins

maven-surefire-plugin



always

true



Note - The surefire plugin describes the childDelegation option as:





When false it makes tests run using the standard classloader delegation
instead of the default Maven isolated classloader. Only used when
forking (forkMode is not "none").



Setting it to false helps with some problems caused by conflicts between
xml parsers in the classpath and the Java 5 provider parser. Default
value is false.











Second problem:

   

When I enable the childDelegation, the plugin then cannot
find the JAXB classes (setup as dependencies in the pom).  I've tried
test/compile scopes on the dependencies but to no avail.



Note: I tried the true
option, but that only seemed to make things worse.









Any help is greatly appreciated!



Regards,



Randall




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



Surefire classpath issues

2007-06-20 Thread Randall Fidler
Hello,

 

Have an issue with trying to leverage Blowfish which ships
with Java 1.5 in relation to unit tests.  The test which I'm trying to
run is using JAXB and Blowfish impl which comes with Java 1.5, i.e.
what's in SunJCE.jar (jre/lib/ext).

 

Before I was using a different impl of Blowfish, third party jar
(cryptix) and that was setup as a dependency in my pom so JAXB and the
blowfish impl were on the same "level" - no problems.  The fun begins
when I switch from the third party jar and try to use the java provided
impl.  Now, I can use JAXB and the Java impl together fine, say, when I
run the actual application which is being tested - problems only happen
when running the unit tests via Maven.

 

First problem:

 

java.lang.NoClassDefFoundError: com/sun/crypto/provider/SunJCE

Resolved this by enabling the childDelegation for the
surefire plugin.

 

org.apache.maven.plugins

maven-surefire-plugin



always

true

 

Note - The surefire plugin describes the childDelegation option as:

 

 

When false it makes tests run using the standard classloader delegation
instead of the default Maven isolated classloader. Only used when
forking (forkMode is not "none").

 

Setting it to false helps with some problems caused by conflicts between
xml parsers in the classpath and the Java 5 provider parser. Default
value is false.

 

 

 

 

 

Second problem:



When I enable the childDelegation, the plugin then cannot
find the JAXB classes (setup as dependencies in the pom).  I've tried
test/compile scopes on the dependencies but to no avail.

 

Note: I tried the true
option, but that only seemed to make things worse.

 

 

 

 

Any help is greatly appreciated!

 

Regards,

 

Randall



Re: maven-eclipse-plugin: .classpath is not written if packaging is zip

2007-06-10 Thread Graham Leggett

Graham Leggett wrote:


I am trying to get the eclipse plugin to generate an eclipse config that
can be built using PDE (via the maven-pde-plugin).

To do this, the packaging type needs to be "zip". However - when this is
the case, the eclipse plugin refuses to write a .classpath file, and my
project has no dependencies as a result. Changing the packaging to jar
fixes maven-eclipse-plugin, but then breaks maven-pde-plugin.

Is there a way to convince the maven-eclipse plugin to be inside a zip
project _and_ generate a .classpath config file at the same time?


Fixed here: MECLIPSE-279

Regards,
Graham
--


smime.p7s
Description: S/MIME Cryptographic Signature


Classpath in exec:java

2007-06-08 Thread sharrissf

Can someone point me to a sample of executing a java program from exec:java
that requires a jar in the class path that comes from an external package.
In otherwords, manually setting the classpath. This isn't working for me.


   org.codehaus.mojo
   exec-maven-plugin
   
 
   
 java
   
   process-test-resources
 
   
  
com.tc.object.tools.BootJarTool
java
  
-classpath
   
${project.build.directory}/dependency/terracotta-trunk/lib/tc.jar
make
  
   
 

Thanks for any help
-- 
View this message in context: 
http://www.nabble.com/Classpath-in-exec%3Ajava-tf3890648s177.html#a11029155
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Re: Classpath issues with maven 2.0.6

2007-06-08 Thread Vandermeeren, Jo

On 6/8/07, [EMAIL PROTECTED]
<[EMAIL PROTECTED] >
wrote:


I can not use the parent class loader since that would render the whole
exercise useless. The whole point is not using the standard classloader
otherwise it is impossible to unload classes. Remember, I want to test
static blocks ( static { some code } ) . So I need fresh copies of my
class for every single test. That's why I use the ReloadableClassLoader.




Hi Minto


Whether you like it or not, every ClassLoader has a parent, except for the
system class loader.
If you don't specify a parent ClassLoader, the default parent will be the
system class loader.
But this class loader is not always what we want.

And that's the reason why I adviced you to use the correct parent class
loader, i.c. the class loader that was used to load the definition of your
custom classloader (ReloadableClassLoader).

Every Class knows its ClassLoader, so you could get yours by calling
"getClass().getClassLoader()".
That is the correct parent loader and will introduce the desired class path
to your custom class loader.
Make sure that one is used when the custom class loader is created. It has
to be passed in the construcor.

Fiddling with the "java.class.path" system property in this context smells
too much like hacking to me.


Cheers
Jo


This custom classloader does not use the normal commandline but the

'java.class.path' system property to determine the classpath. Retrieving
this system property reveals only one classpath entry.

K:\DevTools\maven\maven- 2.0.6\boot\classworlds-1.1.jar

Thus all entries in the classpath reported by 'mvn -X' do not show up
here.

An alternative to using 'java.class.path' is fine with me, but from
where can I programmatically retrieve the classpath to feed to the
custom classloader. Is it possible to get the classpath from the active
classloader?

Regards,

Minto


-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens
Vandermeeren, Jo
Verzonden: vrijdag 8 juni 2007 14:49
Aan: Maven Users List
Onderwerp: Re: Classpath issues with maven 2.0.6

On 6/8/07, [EMAIL PROTECTED] <
[EMAIL PROTECTED] > wrote:
>
> Snippet of the "mvn test -X" ouput:
> ==
> 
> [DEBUG] Test Classpath :
> [DEBUG] K:\Sources\Prefs\memoryprefs\target\test-classes
> [DEBUG] K:\Sources\Prefs\memoryprefs\target\classes
> [DEBUG] K:\Sources\Prefs\memoryprefs\target\classes
> [DEBUG] K:\Sources\Prefs\memoryprefs\target\test-classes
> [DEBUG]
> K:\Repositories\maven2\.m2\repository\junit\junit\4.3.1\junit- 4.3.1.ja
> r
> [DEBUG]
> K:\Repositories\maven2\.m2\repository\org\slf4j\slf4j-simple\1.4.0\slf
> 4j
> -simple-1.4.0.jar
> [DEBUG]
> K:\Repositories\maven2\.m2\repository\org\slf4j\slf4j-api\1.4.0\slf4j-
> ap
> i-1.4.0.jar
> 
>


Hi Minto

I have reduced your output to show nothing but the test classpath that
is defined by your project.
As you can see, both target/classes and target/test-classes are
included.
(Twice, it seems.. kind of strange..)
Also your dependencies are listed.

The only stuff that is appended by Eclipse are the eclipse jars..
Note that compilation and running tests in Eclipse is done by Eclipse
itself, not by Maven.

If your custom classloader uses the system classloader for delegation,
there is no way to catch the additional libararies.
Since the sourceode of the classloader is already in your project, you
might as well adjust it.
Try using the context classloader as a parent instead.

Cheers
Jo


DISCLAIMER
De informatie in deze e-mail is vertrouwelijk en uitsluitend bestemd voor
de geadresseerde. Indien u niet de geadresseerde bent, wordt u er hierbij op
gewezen, dat u geen recht heeft kennis te nemen van de rest van deze e-mail,
deze te gebruiken, te kopieren of te verstrekken aan andere personen dan de
geadresseerde. Indien u deze e-mail abusievelijk hebt ontvangen, brengt u
dan alstublieft de afzender op de hoogte, waarbij u bij deze gevraagd wordt
het originele bericht te vernietigen. Politie Amsterdam-Amstelland is niet
verantwoordelijk voor de inhoud van deze e-mail en wijst iedere
aansprakelijkheid af voor en/of in verband met alle gevolgen en/of schade
van een onjuiste of onvolledige verzending ervan. Tenzij uitdrukkelijk het
tegendeel blijkt, kunnen aan dit bericht geen rechten worden ontleend. Het
gebruik van Internet e-mail brengt zekere risicos met zich. Daarom wordt
iedere aansprakelijkheid voor het gebruik van dit medium door de Politie
Amsterdam-Amstelland van de hand gewezen.

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




RE: Classpath issues with maven 2.0.6

2007-06-08 Thread Minto.van.der.Sluis


Hi Jo,

I can not use the parent class loader since that would render the whole
exercise useless. The whole point is not using the standard classloader
otherwise it is impossible to unload classes. Remember, I want to test
static blocks ( static { some code } ) . So I need fresh copies of my
class for every single test. That's why I use the ReloadableClassLoader.

This custom classloader does not use the normal commandline but the
'java.class.path' system property to determine the classpath. Retrieving
this system property reveals only one classpath entry.

K:\DevTools\maven\maven-2.0.6\boot\classworlds-1.1.jar 

Thus all entries in the classpath reported by 'mvn -X' do not show up
here.

An alternative to using 'java.class.path' is fine with me, but from
where can I programmatically retrieve the classpath to feed to the
custom classloader. Is it possible to get the classpath from the active
classloader?

Regards,

Minto


-Oorspronkelijk bericht-
Van: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Namens
Vandermeeren, Jo
Verzonden: vrijdag 8 juni 2007 14:49
Aan: Maven Users List
Onderwerp: Re: Classpath issues with maven 2.0.6

On 6/8/07, [EMAIL PROTECTED] <
[EMAIL PROTECTED]> wrote:
>
> Snippet of the "mvn test -X" ouput:
> ==
> 
> [DEBUG] Test Classpath :
> [DEBUG] K:\Sources\Prefs\memoryprefs\target\test-classes
> [DEBUG] K:\Sources\Prefs\memoryprefs\target\classes
> [DEBUG] K:\Sources\Prefs\memoryprefs\target\classes
> [DEBUG] K:\Sources\Prefs\memoryprefs\target\test-classes
> [DEBUG]
> K:\Repositories\maven2\.m2\repository\junit\junit\4.3.1\junit-4.3.1.ja
> r
> [DEBUG]
> K:\Repositories\maven2\.m2\repository\org\slf4j\slf4j-simple\1.4.0\slf
> 4j
> -simple-1.4.0.jar
> [DEBUG]
> K:\Repositories\maven2\.m2\repository\org\slf4j\slf4j-api\1.4.0\slf4j-
> ap
> i-1.4.0.jar
> 
>


Hi Minto

I have reduced your output to show nothing but the test classpath that
is defined by your project.
As you can see, both target/classes and target/test-classes are
included.
(Twice, it seems.. kind of strange..)
Also your dependencies are listed.

The only stuff that is appended by Eclipse are the eclipse jars..
Note that compilation and running tests in Eclipse is done by Eclipse
itself, not by Maven.

If your custom classloader uses the system classloader for delegation,
there is no way to catch the additional libararies.
Since the sourceode of the classloader is already in your project, you
might as well adjust it.
Try using the context classloader as a parent instead.

Cheers
Jo


DISCLAIMER
De informatie in deze e-mail is vertrouwelijk en uitsluitend bestemd voor de 
geadresseerde. Indien u niet de geadresseerde bent, wordt u er hierbij op 
gewezen, dat u geen recht heeft kennis te nemen van de rest van deze e-mail, 
deze te gebruiken, te kopieren of te verstrekken aan andere personen dan de 
geadresseerde. Indien u deze e-mail abusievelijk hebt ontvangen, brengt u dan 
alstublieft de afzender op de hoogte, waarbij u bij deze gevraagd wordt het 
originele bericht te vernietigen. Politie Amsterdam-Amstelland is niet 
verantwoordelijk voor de inhoud van deze e-mail en wijst iedere 
aansprakelijkheid af voor en/of in verband met alle gevolgen en/of schade van 
een onjuiste of onvolledige verzending ervan. Tenzij uitdrukkelijk het 
tegendeel blijkt, kunnen aan dit bericht geen rechten worden ontleend. Het 
gebruik van Internet e-mail brengt zekere risicos met zich. Daarom wordt iedere 
aansprakelijkheid voor het gebruik van dit medium door de Politie 
Amsterdam-Amstelland van de hand gewezen. 

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



Re: Classpath issues with maven 2.0.6

2007-06-08 Thread Vandermeeren, Jo

On 6/8/07, [EMAIL PROTECTED] <
[EMAIL PROTECTED]> wrote:


Snippet of the "mvn test -X" ouput:
==

[DEBUG] Test Classpath :
[DEBUG] K:\Sources\Prefs\memoryprefs\target\test-classes
[DEBUG] K:\Sources\Prefs\memoryprefs\target\classes
[DEBUG] K:\Sources\Prefs\memoryprefs\target\classes
[DEBUG] K:\Sources\Prefs\memoryprefs\target\test-classes
[DEBUG]
K:\Repositories\maven2\.m2\repository\junit\junit\4.3.1\junit-4.3.1.jar
[DEBUG]
K:\Repositories\maven2\.m2\repository\org\slf4j\slf4j-simple\1.4.0\slf4j
-simple-1.4.0.jar
[DEBUG]
K:\Repositories\maven2\.m2\repository\org\slf4j\slf4j-api\1.4.0\slf4j-ap
i-1.4.0.jar





Hi Minto

I have reduced your output to show nothing but the test classpath that is
defined by your project.
As you can see, both target/classes and target/test-classes are included.
(Twice, it seems.. kind of strange..)
Also your dependencies are listed.

The only stuff that is appended by Eclipse are the eclipse jars..
Note that compilation and running tests in Eclipse is done by Eclipse
itself, not by Maven.

If your custom classloader uses the system classloader for delegation, there
is no way to catch the additional libararies.
Since the sourceode of the classloader is already in your project, you might
as well adjust it.
Try using the context classloader as a parent instead.

Cheers
Jo


RE: Classpath issues with maven 2.0.6

2007-06-08 Thread Minto.van.der.Sluis


Hi Jo,

The ReloadableClassLoader was copied into the test sources. That's why
there is no dependency for that one.

The class it could not find was not ReloadableClassLoader, but the class
I want to load. This is actually the class under test. 

313 [main] ERROR nl.xup.prefs.memoryprefs.PreferencesTestBase -
Faild reloading nl.xup.prefs.memoryprefs.MemoryPreferencesFactory
java.lang.ClassNotFoundException:
nl.xup.prefs.memoryprefs.MemoryPreferencesFactory 
...

Some more detailed output can be found below.

BTW, thanks for the quick responses :-)

Regards,

Minto


Snippet of the "mvn test -X" ouput:
==

[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[DEBUG] nl.xup.prefs:memoryprefs:jar:1.0-SNAPSHOT (selected for null)
[DEBUG]   org.slf4j:slf4j-api:jar:1.4.0:compile (selected for compile)
[DEBUG]   junit:junit:jar:4.3.1:test (selected for test)
[DEBUG]   org.slf4j:slf4j-simple:jar:1.4.0:test (selected for test)
[DEBUG] Configuring mojo
'org.apache.maven.plugins:maven-compiler-plugin:2.0:testCompile' -->
[DEBUG]   (f) basedir = K:\Sources\Prefs\memoryprefs
[DEBUG]   (f) buildDirectory = K:\Sources\Prefs\memoryprefs\target
[DEBUG]   (f) classpathElements =
[K:\Sources\Prefs\memoryprefs\target\classes,
K:\Sources\Prefs\memoryprefs\target\test-classes,
K:\Repositories\maven2\.m2\repository\junit\junit\4.3.1\junit-4.3.1.jar,
K:\Repositories\maven2\.m2\repository\org\slf4j\slf4j-simple\1.4.0\slf4j
-simple-1.4.0.jar,
K:\Repositories\maven2\.m2\repository\org\slf4j\slf4j-api\1.4.0\slf4j-ap
i-1.4.0.jar]
[DEBUG]   (f) compileSourceRoots =
[K:\Sources\Prefs\memoryprefs\src\test\java]
[DEBUG]   (f) compilerId = javac
[DEBUG]   (f) debug = true
[DEBUG]   (f) fork = false
[DEBUG]   (f) optimize = false
[DEBUG]   (f) outputDirectory =
K:\Sources\Prefs\memoryprefs\target\test-classes
[DEBUG]   (f) outputFileName = memoryprefs-1.0-SNAPSHOT
[DEBUG]   (f) source = 1.4
[DEBUG]   (f) staleMillis = 0
[DEBUG]   (f) target = 1.4
[DEBUG]   (f) verbose = false
[DEBUG] -- end configuration --
[INFO] [compiler:testCompile]
[DEBUG] Using compiler 'javac'.
[DEBUG] Source directories: [K:\Sources\Prefs\memoryprefs\src\test\java]
[DEBUG] Classpath: [K:\Sources\Prefs\memoryprefs\target\classes
 K:\Sources\Prefs\memoryprefs\target\test-classes
 K:\Repositories\maven2\.m2\repository\junit\junit\4.3.1\junit-4.3.1.jar
 
K:\Repositories\maven2\.m2\repository\org\slf4j\slf4j-simple\1.4.0\slf4j
-simple-1.4.0.jar
 
K:\Repositories\maven2\.m2\repository\org\slf4j\slf4j-api\1.4.0\slf4j-ap
i-1.4.0.jar]
[DEBUG] Output directory:
K:\Sources\Prefs\memoryprefs\target\test-classes
[INFO] Nothing to compile - all classes are up to date
[DEBUG] nl.xup.prefs:memoryprefs:jar:1.0-SNAPSHOT (selected for null)
[DEBUG]   org.slf4j:slf4j-api:jar:1.4.0:compile (selected for compile)
[DEBUG]   junit:junit:jar:4.3.1:test (selected for test)
[DEBUG]   org.slf4j:slf4j-simple:jar:1.4.0:test (selected for test)
[DEBUG]
org.apache.maven.plugins:maven-surefire-plugin:maven-plugin:2.1.2:runtim
e (selected for runtime)
[DEBUG] Retrieving parent-POM:
org.apache.maven.surefire:surefire-root::1.1 for project:
null:surefire-booter:jar:1.5.2 from the repository.
[DEBUG]   org.apache.maven.surefire:surefire-booter:jar:1.5.2:runtime
(selected for runtime)
[DEBUG] junit:junit:jar:3.8.1:runtime (selected for runtime)
[DEBUG] Retrieving parent-POM:
org.apache.maven.surefire:surefire-root::1.1 for project:
null:surefire:jar:1.5.2 from the repository.
[DEBUG] org.apache.maven.surefire:surefire:jar:1.5.2:runtime
(selected for runtime)
[DEBUG] Retrieving parent-POM: org.codehaus.plexus:plexus::1.0.4 for
project: null:plexus-utils:jar:1.0.5 from the repository.
[DEBUG]   org.codehaus.plexus:plexus-utils:jar:1.0.5:runtime
(selected for runtime)
[DEBUG] classworlds:classworlds:jar:1.1-alpha-2:runtime
(selected for runtime)
[DEBUG]   org.apache.maven:maven-plugin-api:jar:2.0:runtime (selected
for runtime)
[DEBUG]   org.codehaus.plexus:plexus-utils:jar:1.0.5:runtime (removed -
nearer found: 1.0.4)
[DEBUG]   org.codehaus.plexus:plexus-utils:jar:1.0.4:runtime (selected
for runtime)
[DEBUG]   org.apache.maven.surefire:surefire:jar:1.5.2:runtime (selected
for runtime)
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.0.5:runtime (removed
- nearer found: 1.0.4)
[DEBUG]   org.codehaus.plexus:plexus-utils:jar:1.1:runtime (removed -
nearer found: 1.0.4)
[DEBUG]   org.apache.maven:maven-artifact:jar:2.0:runtime (selected for
runtime)
[DEBUG]   junit:junit:jar:3.8.1:runtime (selected for runtime)
[DEBUG] Configuring mojo
'org.apache.maven.plugins:maven-surefire-plugin:2.1.2:test' -->
[DEBUG]   (f) basedir = K:\Sources\Prefs\memoryprefs
[DEBUG]   (f) childDelegation = true
[DEBUG]   (f) classesDirectory =
K:\Sources\Prefs\memoryprefs\target\classes
[DEBUG]   (f) classpathElements =
[K:\Sources\Prefs\memoryprefs\target\classes,

Re: Classpath issues with maven 2.0.6

2007-06-08 Thread Vandermeeren, Jo

On 6/8/07, [EMAIL PROTECTED] <
[EMAIL PROTECTED]> wrote:




Hi Jo,

Yes I have, look at the pom files below.




Hi Minto

I only see junit and 2 slf4j dependencies.
The ReloadableClassLoader class you mentioned earlier.. Did you include it
as source?
I would expect a dependency to the library that contains it.

Which class is causing the ClassNotFoundException?


Also not that in the maven case the test and project classes are not

part of the classpath being used by the tests.




Could you paste some information about the build output when you run "mvn
test -X"?
Search for "classpathElements" and paste it back here.
As I said earlier, you can't predict the classpath that is used to run your
tests by looking at the classpath that is used to start Maven.

PS. Groeten aan de flikken! ;)
(Transl: Say hello to the cops)

Cheers
Jo


RE: Classpath issues with maven 2.0.6

2007-06-08 Thread Minto.van.der.Sluis


Hi Jo,

Yes I have, look at the pom files below. 

Also not that in the maven case the test and project classes are not
part of the classpath being used by the tests.

Regards,

Minto


My project pom file:
===

  4.0.0

  
nl.xup.prefs
root
0.1-SNAPSHOT
..
  

  nl.xup.prefs
  memoryprefs
  jar
  1.0-SNAPSHOT
  MemoryPrefs

  

  org.slf4j
  slf4j-api
  compile



  junit
  junit
  test


  org.slf4j
  slf4j-simple
  test

  
 

The parent pom:
==

  4.0.0

  nl.xup.prefs
  root
  pom
  0.1-SNAPSHOT
  Xup Prefs

  

  
junit
junit
4.3.1
  
  
org.slf4j
slf4j-api
1.4.0
  
  
org.slf4j
slf4j-simple
1.4.0
  

  

  
...
memoryprefs
...
  

  

  
org.apache.maven.plugins
maven-compiler-plugin

  
  1.4
  1.4

  

  
  

-Oorspronkelijk bericht-
Van: Jo Vandermeeren [mailto:[EMAIL PROTECTED] 
Verzonden: vrijdag 8 juni 2007 12:38
Aan: Maven Users List
Onderwerp: Re: Classpath issues with maven 2.0.6

On 6/8/07, [EMAIL PROTECTED]
<[EMAIL PROTECTED]>
wrote:
>
> Looking a bit deeper I discovered the classpath being used in Eclipse 
> contains a lot more entries than the one being used by maven.
>

Hi Minto

The classpath used to startup maven is different from the one that is
used to build and test your modules.
Hence the dependencies section in your pom.xml file.

Have you included the libraries needed for testing as test-scoped
dependencies in the pom.xml file of the resp. module?

Cheers
Jo


DISCLAIMER
De informatie in deze e-mail is vertrouwelijk en uitsluitend bestemd voor de 
geadresseerde. Indien u niet de geadresseerde bent, wordt u er hierbij op 
gewezen, dat u geen recht heeft kennis te nemen van de rest van deze e-mail, 
deze te gebruiken, te kopieren of te verstrekken aan andere personen dan de 
geadresseerde. Indien u deze e-mail abusievelijk hebt ontvangen, brengt u dan 
alstublieft de afzender op de hoogte, waarbij u bij deze gevraagd wordt het 
originele bericht te vernietigen. Politie Amsterdam-Amstelland is niet 
verantwoordelijk voor de inhoud van deze e-mail en wijst iedere 
aansprakelijkheid af voor en/of in verband met alle gevolgen en/of schade van 
een onjuiste of onvolledige verzending ervan. Tenzij uitdrukkelijk het 
tegendeel blijkt, kunnen aan dit bericht geen rechten worden ontleend. Het 
gebruik van Internet e-mail brengt zekere risico's met zich. Daarom wordt 
iedere aansprakelijkheid voor het gebruik van dit medium door de Politie 
Amsterdam-Amstelland van de hand gewezen. 

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



Re: Classpath issues with maven 2.0.6

2007-06-08 Thread Jo Vandermeeren

On 6/8/07, [EMAIL PROTECTED]
<[EMAIL PROTECTED]>
wrote:


Looking a bit deeper I discovered the classpath being used in Eclipse
contains a lot more entries than the one being used by maven.



Hi Minto

The classpath used to startup maven is different from the one that is used
to build and test your modules.
Hence the dependencies section in your pom.xml file.

Have you included the libraries needed for testing as test-scoped
dependencies in the pom.xml file of the resp. module?

Cheers
Jo


Classpath issues with maven 2.0.6

2007-06-08 Thread Minto.van.der.Sluis


Hi folks

Unfortunately I run into classpath problems when running my unittests
with 'mvn test'.

I have the following situation. To be able to test static blocks in my
classes under various conditions I need to be sure these static block
are executed multiple times. The only thing I know that can achieve this
situation is using a separate classloader for every test. After some
googling I found the ReloadableClassLoader from
http://sourceforge.net/projects/escher .

In eclipse I was able to get this to work and verified that I have a
different classloader for every test. However when running the same
unittest (that worked in eclipse) from 'mvn test'. I run into a
ClassNotFoundException  :-(

Looking a bit deeper I discovered the classpath being used in Eclipse
contains a lot more entries than the one being used by maven. 

Eclipse has:
K:\Sources\Prefs\memoryprefs\target\test-classes
K:\Sources\Prefs\memoryprefs\target\classes

K:\Repositories\maven2\.m2\repository\junit\junit\4.3.1\junit-4.3.1.jar

K:\Repositories\maven2\.m2\repository\org\slf4j\slf4j-api\1.4.0\slf4j-ap
i-1.4.0.jar

K:\Repositories\maven2\.m2\repository\org\slf4j\slf4j-simple\1.4.0\slf4j
-simple-1.4.0.jar

K:\DevTools\eclipse\3.3M6\eclipse\configuration\org.eclipse.osgi\bundles
\70\1\.cp

K:\DevTools\eclipse\3.3M6\eclipse\configuration\org.eclipse.osgi\bundles
\68\1\.cp

Maven has:
K:\DevTools\maven\maven-2.0.6\boot\classworlds-1.1.jar

Looking even deeper I found out that ReloadableClassLoader uses system
property 'java.class.path' to get the actual classpath. 

My question now is, how can I make sure that my classes under test will
be part of the classpath. In other words how can I get maven to add all
necessary dependencies to the "java.class.path" system property.
Alternatively, assuming maven uses java -cp, how can I reach the proper
classpath to feed my custom ClassLoader.

Any help is appreciated.

Kind regards,

Minto van der Sluis

--- Today's code is tomorrow's legacy. ---



DISCLAIMER
De informatie in deze e-mail is vertrouwelijk en uitsluitend bestemd voor de 
geadresseerde. Indien u niet de geadresseerde bent, wordt u er hierbij op 
gewezen, dat u geen recht heeft kennis te nemen van de rest van deze e-mail, 
deze te gebruiken, te kopieren of te verstrekken aan andere personen dan de 
geadresseerde. Indien u deze e-mail abusievelijk hebt ontvangen, brengt u dan 
alstublieft de afzender op de hoogte, waarbij u bij deze gevraagd wordt het 
originele bericht te vernietigen. Politie Amsterdam-Amstelland is niet 
verantwoordelijk voor de inhoud van deze e-mail en wijst iedere 
aansprakelijkheid af voor en/of in verband met alle gevolgen en/of schade van 
een onjuiste of onvolledige verzending ervan. Tenzij uitdrukkelijk het 
tegendeel blijkt, kunnen aan dit bericht geen rechten worden ontleend. Het 
gebruik van Internet e-mail brengt zekere risico's met zich. Daarom wordt 
iedere aansprakelijkheid voor het gebruik van dit medium door de Politie 
Amsterdam-Amstelland van de hand gewezen. 


Re: M2 classpath generation

2007-06-06 Thread Jon Strayer

Excellent!  Thank you very much.  I was assuming that since I had run mvn
package that I could leave package out of the appassembler run.



On 6/6/07, Steven Rowe <[EMAIL PROTECTED]> wrote:


Hi Jon,

This JIRA issue sounds similar:

   

Also, you should be running this goal like so:

   mvn package appassembler:assemble

Steve

Jon Strayer wrote:
> I'm getting this exception when I try  mvn appassembler:assemble
>
> [INFO] Trace
> java.lang.NullPointerException
>at
> org.apache.maven.artifact.installer.DefaultArtifactInstaller.install(
> DefaultArtifactInstaller.java:71)
>at org.codehaus.mojo.appassembler.AssembleMojo.installArtifact(
> AssembleMojo.java:361)
>at org.codehaus.mojo.appassembler.AssembleMojo.execute(
> AssembleMojo.java:299)
>at org.apache.maven.plugin.DefaultPluginManager.executeMojo(
> DefaultPluginManager.java:443)
>at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
> DefaultLifecycleExecutor.java:539)
>
>
> I suspect a configuration error, but I don't know where.
>
> On 6/6/07, Steven Rowe <[EMAIL PROTECTED]> wrote:
>>
>> This Appassembler plugin will do this and more:
>>
>>   http://mojo.codehaus.org/appassembler/appassembler-maven-plugin/
>>
>> Jon Strayer wrote:
>> > I'm currently using maven 2. Most of our applications are batch
>> > applications that run from cron via a bash script. I've written a
>> > plugin that (among other things) will read through the pom and
>> > generate a file that sets the class path correctly for this
>> > application. Is there anything like this for Maven 2?
>>


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





--
Esse Quam Videre
To Be, rather than to Seem


Re: M2 classpath generation

2007-06-06 Thread Steven Rowe
Hi Jon,

This JIRA issue sounds similar:

   

Also, you should be running this goal like so:

   mvn package appassembler:assemble

Steve

Jon Strayer wrote:
> I'm getting this exception when I try  mvn appassembler:assemble
> 
> [INFO] Trace
> java.lang.NullPointerException
>at
> org.apache.maven.artifact.installer.DefaultArtifactInstaller.install(
> DefaultArtifactInstaller.java:71)
>at org.codehaus.mojo.appassembler.AssembleMojo.installArtifact(
> AssembleMojo.java:361)
>at org.codehaus.mojo.appassembler.AssembleMojo.execute(
> AssembleMojo.java:299)
>at org.apache.maven.plugin.DefaultPluginManager.executeMojo(
> DefaultPluginManager.java:443)
>at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
> DefaultLifecycleExecutor.java:539)
> 
> 
> I suspect a configuration error, but I don't know where.
> 
> On 6/6/07, Steven Rowe <[EMAIL PROTECTED]> wrote:
>>
>> This Appassembler plugin will do this and more:
>>
>>   http://mojo.codehaus.org/appassembler/appassembler-maven-plugin/
>>
>> Jon Strayer wrote:
>> > I'm currently using maven 2. Most of our applications are batch
>> > applications that run from cron via a bash script. I've written a
>> > plugin that (among other things) will read through the pom and
>> > generate a file that sets the class path correctly for this
>> > application. Is there anything like this for Maven 2?
>>


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



Re: M2 classpath generation

2007-06-06 Thread Jon Strayer

I'm getting this exception when I try  mvn appassembler:assemble

[INFO] Trace
java.lang.NullPointerException
   at
org.apache.maven.artifact.installer.DefaultArtifactInstaller.install(
DefaultArtifactInstaller.java:71)
   at org.codehaus.mojo.appassembler.AssembleMojo.installArtifact(
AssembleMojo.java:361)
   at org.codehaus.mojo.appassembler.AssembleMojo.execute(
AssembleMojo.java:299)
   at org.apache.maven.plugin.DefaultPluginManager.executeMojo(
DefaultPluginManager.java:443)
   at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
DefaultLifecycleExecutor.java:539)


I suspect a configuration error, but I don't know where.

On 6/6/07, Steven Rowe <[EMAIL PROTECTED]> wrote:


This Appassembler plugin will do this and more:

  http://mojo.codehaus.org/appassembler/appassembler-maven-plugin/

Jon Strayer wrote:
> I'm currently using maven 2. Most of our applications are batch
> applications that run from cron via a bash script. I've written a
> plugin that (among other things) will read through the pom and
> generate a file that sets the class path correctly for this
> application. Is there anything like this for Maven 2?


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





--
Esse Quam Videre
To Be, rather than to Seem


Re: M2 classpath generation

2007-06-06 Thread Steven Rowe
This Appassembler plugin will do this and more:

  http://mojo.codehaus.org/appassembler/appassembler-maven-plugin/

Jon Strayer wrote:
> I'm currently using maven 2. Most of our applications are batch 
> applications that run from cron via a bash script. I've written a
> plugin that (among other things) will read through the pom and
> generate a file that sets the class path correctly for this
> application. Is there anything like this for Maven 2?


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



M2 classpath generation

2007-06-06 Thread Jon Strayer

I'm currently using maven 2.  Most of our applications are batch
applications that run from cron via a bash script.  I've written a plugin
that (among other things) will read through the pom and generate a file that
sets the class path correctly for this application.  Is there anything like
this for Maven 2?

--
Esse Quam Videre
To Be, rather than to Seem


maven-eclipse-plugin: .classpath is not written if packaging is zip

2007-06-05 Thread Graham Leggett
Hi all,

I am trying to get the eclipse plugin to generate an eclipse config that
can be built using PDE (via the maven-pde-plugin).

To do this, the packaging type needs to be "zip". However - when this is
the case, the eclipse plugin refuses to write a .classpath file, and my
project has no dependencies as a result. Changing the packaging to jar
fixes maven-eclipse-plugin, but then breaks maven-pde-plugin.

Is there a way to convince the maven-eclipse plugin to be inside a zip
project _and_ generate a .classpath config file at the same time?

Regards,
Graham
--



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



eclipse plugin for maven - first letter missing in .classpath file

2007-06-02 Thread Marcio Guedes

Hi all. I've found the following e-mail about Eclipse plugin and I
think I have the solution.
Eclipse plugin resolves path attribute using canonical file names. In
some cases, for example when the localRepository [settings.xml] is
setted to a root drive letter in MS-Windows boxes like M:\, the
canonical name maintain the backslash. So, the method that calculates
the relative path, returns the path without the first letter.
There are a workaround to resolve this: Never use a root drive letter
(or root / in posix boxes)   as localRepository. I suggest to use
instead a sub folder.
I've posted a patch in Jira to fix that problem, of course, after
someone else validate and test that patch.

Regards

Márcio Guedes

http://jira.codehaus.org/browse/MECLIPSE-261



Hello



I have a problem with eclipse plugin for maven 2 (i'm using maven
2.0.6). it generates wrong .classpath file - all classpath entries
describing external jars have missing first letter (after M2_REPO env
variable). let take an example:





i found that someone already had this problem with maven, but there
was no solution for it.



do anybody know how to deal with that ?



thanks in advance



Kamil Pietak


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



Re: How to tell Maven where to find jar (specify classpath)

2007-06-02 Thread nicolas de loof

You can also point to an existing location in maven public repo (
http://repo1.maven.org/maven2/com/oracle/)

When trying to compile, maven will complain not finding the dependecy and
output the command required to install the file in the local repository. The
POM gives the URL to download the jar

You may also deploy it in a corporate/private repository, used as a proxy to
maven repo, so that developpers don't have to wory about where it comes
from.

Nico.

2007/6/2, Michael Meyer <[EMAIL PROTECTED]>:


Hi
you could try adding the dependency with scope "system" [1].


  oracle
  oracle
  x.x.x
  system
  ${basedir}/lib/oracle.jar


Cheers, michael

[1]
http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html

SiSi'mon schrieb:
> We have a product we wish to deliver that requires compliation.  We have
a
> pom.xml file that specifies all the dependencies but there is one
dependency
> (Oracle jdbc jars) for which there is no repository so we must package
the
> .jar files in a /lib/ directory under our application.
>
> Outside of this all dependencies can be handled by Maven2.  How do you
> specify the location of the jar or class files on the maven command
line?
> we need to tell maven where the ojdbc jars are when it runs.
>
> thanks
>
> Si'mon


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




Re: How to tell Maven where to find jar (specify classpath)

2007-06-02 Thread Michael Meyer

Hi
you could try adding the dependency with scope "system" [1].


  oracle
  oracle
  x.x.x
  system
  ${basedir}/lib/oracle.jar


Cheers, michael

[1] 
http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html

SiSi'mon schrieb:

We have a product we wish to deliver that requires compliation.  We have a
pom.xml file that specifies all the dependencies but there is one dependency
(Oracle jdbc jars) for which there is no repository so we must package the
.jar files in a /lib/ directory under our application.

Outside of this all dependencies can be handled by Maven2.  How do you
specify the location of the jar or class files on the maven command line? 
we need to tell maven where the ojdbc jars are when it runs.


thanks

Si'mon



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



Re: How to tell Maven where to find jar (specify classpath)

2007-06-01 Thread Mark Derricutt

Could you not include the jar and a pom for it in a repository in your
distribution relative to the pom you mentioned originally - then reference
this repo relative to your pom?

On 6/1/07, SiSi'mon <[EMAIL PROTECTED]> wrote:



Is there a way to tell maven about another jar?




Re: Access to the full classpath when running under Surefire (WAS: [Maven 2])

2007-05-31 Thread James Abley

On 23/05/07, Lasse Koskela <[EMAIL PROTECTED]> wrote:


Oops. Sorry about the ambiguous title in my previous post... I changed
it to something more communicative.

Lasse

On 5/23/07, Lasse Koskela <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm trying to convert the open source JUnit extension called JspTest
> to use Maven2 for the build and I'm running into trouble with how
> Maven's Surefire test runner plugin seems to "hide" the classpath from
> the executing code.
>
> The issue stems from the need for a unit test to be able to compile
> Java source code (generated from JSP source files), which obviously
> needs all sorts of J2EE stuff in the classpath. These dependencies
> have been defined in the pom.xml and are visible just fine when
> compiling the framework itself and when running the tests, but when
> those tests (indirectly) attempt to use the same dependencies to build
> up a classpath for a new "javac" process I get all kinds of
> "symbol/package/class not found" compilation errors because
> System.getProperty("java.class.path") returns only some
> maven/surefire/plexus libraries and not a single dependency (not even
> the "target/classes" or "target/test-classes" directories).
>
> If I were talking about a plugin, I could have the dependencies be
> injected to the Mojo through properties but I'm not talking about a
> plugin so that's not an option.
>
> So, I guess my question is how can I get access to the Maven
> dependencies and/or the full classpath?
>



Hi Lasse,

I was hoping to see an answer to this since I had a similar issue. I have a
class that executes processes. I wanted to write tests for this class, to
ensure that it does what I think it does, and make various assertions about
the exit status and stdout / stderr of the process being tested.

Within Eclipse, the System property java.class.path works well, but not in
maven2. So I resorted to manually constructing the classpath myself. Not
ideal, but I didn't see a system property or similar with the full test
classpath available.

   public class ClasspathBuilder {

   /**
    * Path to maven repository.
*/
   private final String mavenRepository;

   /**
* Classpath being constructed.
*/
   private StringBuffer classpath;

   /**
* The base directory used to build a new entry.
*/
   private String basedir;

   /**
* Create a new ClasspathBuilder.
*
*/
   public ClasspathBuilder() {
   mavenRepository = joinPaths(joinPaths(System
   .getProperty("user.home"), ".m2"), "repository");
   basedir = mavenRepository;
   classpath = new StringBuffer(".");
   }

   /**
* Set the base directory.
*
* @param files
*an array of files consituting the base directory
*/
   public void setBaseDir(String[] files) {
   StringBuffer buf = new StringBuffer(files[0]);

   for (int i = 1, n = files.length; i < n; ++i) {
   buf.append(joinPaths(buf.toString(), files[i]));
   }
   basedir = buf.toString();
   }

   /**
* Create a new Entry.
*
* @param files
*string array of file names, which will be the
directories
*in the path below the $MAVEN_HOME/repository
*/
   public void addEntry(String[] files) {
   StringBuffer entry = new StringBuffer();
   entry.append(basedir);
   for (int i = 0, n = files.length; i < n; ++i) {
   entry.append(File.separatorChar);
   entry.append(files[i]);
   }
   classpath.append(File.pathSeparatorChar);
   classpath.append(entry.toString());
   }

   /**
* Join the paths.
*
* @param root
*the root path.
* @param file
*the file / directory to append.
* @return return the newly extended path
*/
   private String joinPaths(String root, String file) {
   StringBuffer buf = new StringBuffer(root);
   buf.append(File.separatorChar);
   buf.append(file);
   return buf.toString();
   }

   /**
* Return the constructed classpath.
*
* @return the classpath
*/
   public String getClasspath() {
   return classpath.toString();
   }

   /**
* [EMAIL PROTECTED]
*/
   public String toString() {
   return getClasspath();
   }

   }


and using it like this:

   /*
* This only works within the IDE - at least within Eclipse
*/
   // return System.getProperty("java.class.path&

Re: How to tell Maven where to find jar (specify classpath)

2007-05-31 Thread Carlos Sanchez

On 5/31/07, SiSi'mon <[EMAIL PROTECTED]> wrote:


We do not have the ability to run a maven repository for customers to serve
them and oracle.jar - too many headaches and approval and hoops to jump
through with IT.

Is there a way to tell maven about another jar?


no, only what people already told you about install:install-file



Or is there a maven repository out there with Oracle jars?


no



thanks


Si'mon


Wendy Smoak-3 wrote:
>
> On 5/31/07, SiSi'mon <[EMAIL PROTECTED]> wrote:
>
>> We have a product we wish to deliver that requires compliation.  We have
>> a
>> pom.xml file that specifies all the dependencies but there is one
>> dependency
>> (Oracle jdbc jars) for which there is no repository so we must package
>> the
>> .jar files in a /lib/ directory under our application.
>
> Instead, you should either install these jars in your local
> repostiory, or establish an internal corporate repository to share
> them among your development team (assuming that's allowed by the
> license.)
>
> --
> Wendy
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>

--
View this message in context: 
http://www.nabble.com/How-to-tell-Maven-where-to-find-jar-%28specify-classpath%29-tf3848482s177.html#a10901912
Sent from the Maven - Users mailing list archive at Nabble.com.


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





--
I could give you my word as a Spaniard.
No good. I've known too many Spaniards.
-- The Princess Bride

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



Re: How to tell Maven where to find jar (specify classpath)

2007-05-31 Thread SiSi'mon

We do not have the ability to run a maven repository for customers to serve
them and oracle.jar - too many headaches and approval and hoops to jump
through with IT.

Is there a way to tell maven about another jar?

Or is there a maven repository out there with Oracle jars?

thanks


Si'mon


Wendy Smoak-3 wrote:
> 
> On 5/31/07, SiSi'mon <[EMAIL PROTECTED]> wrote:
> 
>> We have a product we wish to deliver that requires compliation.  We have
>> a
>> pom.xml file that specifies all the dependencies but there is one
>> dependency
>> (Oracle jdbc jars) for which there is no repository so we must package
>> the
>> .jar files in a /lib/ directory under our application.
> 
> Instead, you should either install these jars in your local
> repostiory, or establish an internal corporate repository to share
> them among your development team (assuming that's allowed by the
> license.)
> 
> -- 
> Wendy
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/How-to-tell-Maven-where-to-find-jar-%28specify-classpath%29-tf3848482s177.html#a10901912
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Re: How to tell Maven where to find jar (specify classpath)

2007-05-31 Thread Wendy Smoak

On 5/31/07, SiSi'mon <[EMAIL PROTECTED]> wrote:


We have a product we wish to deliver that requires compliation.  We have a
pom.xml file that specifies all the dependencies but there is one dependency
(Oracle jdbc jars) for which there is no repository so we must package the
.jar files in a /lib/ directory under our application.


Instead, you should either install these jars in your local
repostiory, or establish an internal corporate repository to share
them among your development team (assuming that's allowed by the
license.)

--
Wendy

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



How to tell Maven where to find jar (specify classpath)

2007-05-31 Thread SiSi'mon

We have a product we wish to deliver that requires compliation.  We have a
pom.xml file that specifies all the dependencies but there is one dependency
(Oracle jdbc jars) for which there is no repository so we must package the
.jar files in a /lib/ directory under our application.

Outside of this all dependencies can be handled by Maven2.  How do you
specify the location of the jar or class files on the maven command line? 
we need to tell maven where the ojdbc jars are when it runs.

thanks

Si'mon
-- 
View this message in context: 
http://www.nabble.com/How-to-tell-Maven-where-to-find-jar-%28specify-classpath%29-tf3848482s177.html#a10900554
Sent from the Maven - Users mailing list archive at Nabble.com.


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



WAR plugin issue with classpath prefixes

2007-05-24 Thread Alexander Sack

Is there a way to set the default classpath prefix in the manifest of a
WAR?  I can do it all day in a JAR using the  tag but it
seems the WAR plugin doesn't support this which to me would be a bad
oversight.  I rather not include the JARS in WEB-INF/lib and my EAR's lib
directory (but it works).

-aps

--
"What lies behind us and what lies in front of us is of little concern to
what lies within us." -Ralph Waldo Emerson


Re: Problem with classpath order

2007-05-24 Thread Wayne Fay

I assume he meant CLDC (Connected Limited Device Configuration) aka
J2ME (Java 2 Mobile Edition).

I strongly agree with the other responses suggesting that you refactor
things rather proceeding with this approach!

Wayne

On 5/24/07, Thorsten Heit <[EMAIL PROTECTED]> wrote:

Hi,

> The reason is CDC..

CDC = ?
(sorry, don't actually know what it is)

> There are some classes does not exist, so I have to
> implement them, however, to make sure I can run my applications on PC as
> well, I need same naming...extra method is for legacy reasons.

I'd think about refactoring/redesigning the corresponding classes in your 
application that cause these special treatment...


Regards

Thorsten

-
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: Problem with classpath order

2007-05-24 Thread Andrew Williams
I think Sun would not really like this :) You can cause very serious  
security violations in this manner.
Can you not subclass File (com.my.File) and use that everywhere  
instead? It can extend File so you

have the same sort of behaviour...

Andy

On 23 May 2007, at 14:53, redhatvswin wrote:



Hm..Thanks

The reason is CDC..There are some classes does not exist, so I have to
implement them, however, to make sure I can run my applications on  
PC as

well, I need same naming...extra method is for legacy reasons.



Thorsten Heit-3 wrote:


Hi,


I have following problem and I am kind of stuck.
I have project that depends on project where I override some java
standard
classes and sometimes I have extra methods in there.
When i use eclipse, I can change order of classpath to have my  
Maven2
Dependencies over the JRE. However, when I try to install or  
compile, I

can
not because java complains that method not found in class  
java.io.File,

for
example. Is there a way to change this in maven to make sure  
compiler

first
looks classes in my dependencies and then in java libraries.


AFAIK no.

Just for curiosity:
What's your use case that you override Java standard classes? You  
know

that this can cause more or less serious problems trying to run your
application on another machine because your classes perhaps will  
not be

used/found...?

Why don't you just create subclasses of them?


Regards

Thorsten

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





--
View this message in context: http://www.nabble.com/Problem-with- 
classpath-order-tf3803436s177.html#a10764313

Sent from the Maven - Users mailing list archive at Nabble.com.


-
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: Need testSourceDirectory to come before dependencies on classpath during surefire run

2007-05-24 Thread Steven Cummings

In the long-run yes, but the use-case is trying to convert a bulk of
projects to Maven 2. So that's why I said I'm just wanting to see how
possible this is. I understand it would be a complete hack, but I have to
know my actual options before I can weigh them. I asked because as I see it
right now, this isn't possible at all (without recompiling surefire) and I
wanted to know if I was correct in that conclusion. Thanks.

/S

On 5/24/07, Gregory Kick <[EMAIL PROTECTED]> wrote:


if it looks like a hack, sounds like a hack, smells like a hack...

what's your specific use case for this?  it seems like you'd probably
be better off with a design change than relying on classpath ordering.

On 5/23/07, Steven Cummings <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I looked in the archives before posting and the closest thing I could
find
> to my particular situation is all of the messages surrounding
> http://jira.codehaus.org/browse/MNG-1412 (the ordering of the
dependencies
> on the classpath).
>
> I need a specific class to hide another that is in a needed dependency
and
> control this ordering. Unlike with the previous discussion, my preferred
> version lives in the testSourceDirectory. When I run "mvn test" surefire
> seems to have all of the dependencies loaded on the classpath *before*
> testSourceDirectory. I know that one possibility would be to move this
class
> to a new artifact or another existing artifact and make it a dependency,
but
> that isn't a viable solution right now as I'm doing a bulk conversion of
> projects to Maven 2. So right now, I'm just wanting to know, is this
> possible? Is there a way to tell surefire to order the
testSourceDirectory
> before any dependencies on the classpath when it runs? Thanks.
>
> --
> Steven Cummings
>


--
Gregory Kick
http://kickstyle.net/

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





--
Steven Cummings


Re: Problem with classpath order

2007-05-24 Thread Thorsten Heit
Hi,

> The reason is CDC..

CDC = ?
(sorry, don't actually know what it is)

> There are some classes does not exist, so I have to
> implement them, however, to make sure I can run my applications on PC as
> well, I need same naming...extra method is for legacy reasons.

I'd think about refactoring/redesigning the corresponding classes in your 
application that cause these special treatment...


Regards

Thorsten

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



Re: Need testSourceDirectory to come before dependencies on classpath during surefire run

2007-05-23 Thread Gregory Kick

if it looks like a hack, sounds like a hack, smells like a hack...

what's your specific use case for this?  it seems like you'd probably
be better off with a design change than relying on classpath ordering.

On 5/23/07, Steven Cummings <[EMAIL PROTECTED]> wrote:

Hello,

I looked in the archives before posting and the closest thing I could find
to my particular situation is all of the messages surrounding
http://jira.codehaus.org/browse/MNG-1412 (the ordering of the dependencies
on the classpath).

I need a specific class to hide another that is in a needed dependency and
control this ordering. Unlike with the previous discussion, my preferred
version lives in the testSourceDirectory. When I run "mvn test" surefire
seems to have all of the dependencies loaded on the classpath *before*
testSourceDirectory. I know that one possibility would be to move this class
to a new artifact or another existing artifact and make it a dependency, but
that isn't a viable solution right now as I'm doing a bulk conversion of
projects to Maven 2. So right now, I'm just wanting to know, is this
possible? Is there a way to tell surefire to order the testSourceDirectory
before any dependencies on the classpath when it runs? Thanks.

--
Steven Cummings




--
Gregory Kick
http://kickstyle.net/

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



Need testSourceDirectory to come before dependencies on classpath during surefire run

2007-05-23 Thread Steven Cummings

Hello,

I looked in the archives before posting and the closest thing I could find
to my particular situation is all of the messages surrounding
http://jira.codehaus.org/browse/MNG-1412 (the ordering of the dependencies
on the classpath).

I need a specific class to hide another that is in a needed dependency and
control this ordering. Unlike with the previous discussion, my preferred
version lives in the testSourceDirectory. When I run "mvn test" surefire
seems to have all of the dependencies loaded on the classpath *before*
testSourceDirectory. I know that one possibility would be to move this class
to a new artifact or another existing artifact and make it a dependency, but
that isn't a viable solution right now as I'm doing a bulk conversion of
projects to Maven 2. So right now, I'm just wanting to know, is this
possible? Is there a way to tell surefire to order the testSourceDirectory
before any dependencies on the classpath when it runs? Thanks.

--
Steven Cummings


Re: Problem with classpath order

2007-05-23 Thread redhatvswin

Hm..Thanks

The reason is CDC..There are some classes does not exist, so I have to
implement them, however, to make sure I can run my applications on PC as
well, I need same naming...extra method is for legacy reasons.



Thorsten Heit-3 wrote:
> 
> Hi,
> 
>> I have following problem and I am kind of stuck.
>> I have project that depends on project where I override some java
>> standard
>> classes and sometimes I have extra methods in there. 
>> When i use eclipse, I can change order of classpath to have my Maven2
>> Dependencies over the JRE. However, when I try to install or compile, I
>> can
>> not because java complains that method not found in class java.io.File,
>> for
>> example. Is there a way to change this in maven to make sure compiler
>> first
>> looks classes in my dependencies and then in java libraries.
> 
> AFAIK no.
> 
> Just for curiosity:
> What's your use case that you override Java standard classes? You know
> that this can cause more or less serious problems trying to run your
> application on another machine because your classes perhaps will not be
> used/found...?
> 
> Why don't you just create subclasses of them?
> 
> 
> Regards
> 
> Thorsten
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Problem-with-classpath-order-tf3803436s177.html#a10764313
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Re: Problem with classpath order

2007-05-23 Thread Thorsten Heit
Hi,

> I have following problem and I am kind of stuck.
> I have project that depends on project where I override some java standard
> classes and sometimes I have extra methods in there. 
> When i use eclipse, I can change order of classpath to have my Maven2
> Dependencies over the JRE. However, when I try to install or compile, I
> can
> not because java complains that method not found in class java.io.File,
> for
> example. Is there a way to change this in maven to make sure compiler
> first
> looks classes in my dependencies and then in java libraries.

AFAIK no.

Just for curiosity:
What's your use case that you override Java standard classes? You know that 
this can cause more or less serious problems trying to run your application on 
another machine because your classes perhaps will not be used/found...?

Why don't you just create subclasses of them?


Regards

Thorsten

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



Problem with classpath order

2007-05-23 Thread redhatvswin

Dear all.

I have following problem and I am kind of stuck.
I have project that depends on project where I override some java standard
classes and sometimes I have extra methods in there. 
When i use eclipse, I can change order of classpath to have my Maven2
Dependencies over the JRE. However, when I try to install or compile, I can
not because java complains that method not found in class java.io.File, for
example. Is there a way to change this in maven to make sure compiler first
looks classes in my dependencies and then in java libraries.

Thank you 

redhatvswin
-- 
View this message in context: 
http://www.nabble.com/Problem-with-classpath-order-tf3803436s177.html#a10762060
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Access to the full classpath when running under Surefire (WAS: [Maven 2])

2007-05-22 Thread Lasse Koskela

Oops. Sorry about the ambiguous title in my previous post... I changed
it to something more communicative.

Lasse

On 5/23/07, Lasse Koskela <[EMAIL PROTECTED]> wrote:

Hi,

I'm trying to convert the open source JUnit extension called JspTest
to use Maven2 for the build and I'm running into trouble with how
Maven's Surefire test runner plugin seems to "hide" the classpath from
the executing code.

The issue stems from the need for a unit test to be able to compile
Java source code (generated from JSP source files), which obviously
needs all sorts of J2EE stuff in the classpath. These dependencies
have been defined in the pom.xml and are visible just fine when
compiling the framework itself and when running the tests, but when
those tests (indirectly) attempt to use the same dependencies to build
up a classpath for a new "javac" process I get all kinds of
"symbol/package/class not found" compilation errors because
System.getProperty("java.class.path") returns only some
maven/surefire/plexus libraries and not a single dependency (not even
the "target/classes" or "target/test-classes" directories).

If I were talking about a plugin, I could have the dependencies be
injected to the Mojo through properties but I'm not talking about a
plugin so that's not an option.

So, I guess my question is how can I get access to the Maven
dependencies and/or the full classpath?


best regards,
Lasse


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



Re: Setting classpath during junit execution

2007-05-18 Thread Jim Crossley
"Larry Suto" <[EMAIL PROTECTED]> writes:

> Hi was wondering if anyone knows how I would set a classpath to a jdbc
> properties file that is required by by a Junit test executed during
> the Maven build.
> 
> Would it work if I placed it in the test resources area.

Yes.  Anything residing in src/test/resources will be picked up from
the classpath *before* anything in src/main/resources.

Jim

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



Setting classpath during junit execution

2007-05-18 Thread Larry Suto

Hi was wondering if anyone knows how I would set a classpath to a jdbc
properties file that is required by by a Junit test executed during
the Maven build.

Would it work if I placed it in the test resources area.

Thanks,

Larry

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



eclipse plugin for maven - first letter missing in .classpath file

2007-05-18 Thread Kamil Piętak

Hello

I have a problem with eclipse plugin for maven 2 (i'm using maven
2.0.6). it generates wrong .classpath file - all classpath entries
describing external jars have missing first letter (after M2_REPO env
variable). let take an example:



i found that someone already had this problem with maven, but there
was no solution for it.

do anybody know how to deal with that ?

thanks in advance

Kamil Pietak

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



Re: Runtime dependencies in Eclipse classpath

2007-05-17 Thread Larry Meadors

Eclipse is not Maven, and Maven is not Eclipse - you are kind of
comparing apples to orangutans.

Eclipse makes no differentiation between compile time and run time,
but Maven is different - it's a build tool, not an IDE.

As I understand it, compile time means "what I need to compile this
thing", but runtime means "what I need to run the beast."

An example would be JDBC drivers. I don't need the Oracle JDBC driver
jar to compile my application (unless I did something really deeply
profoundly wrong) but I do need it to *run* my application.

Larry


On 5/16/07, lightbulb432 <[EMAIL PROTECTED]> wrote:


So "runtime" seems very similar to the "compile" scope type. Could somebody
please explain the difference?

The Maven documentation seems to imply something about transitive
dependencies, but I don't understand what it's trying to say.

Thanks.



Larry Meadors-2 wrote:
>
> I'd assume that it's there so that you can run your app from the IDE -
> that's the behavior I'd expect.
>
> Larry
>
>
> On 5/16/07, lightbulb432 <[EMAIL PROTECTED]> wrote:
>>
>> Why are dependencies with a scope of "runtime" added to Eclipse's
>> .classpath
>> file? I thought the point of runtime is that it's not a compile-time
>> dependency; therefore, why the addition to the .classpath?
>>
>> Perhaps someone can correct me, but my understanding of runtime scope is
>> that it is not included in the compile-time classpath, but is added to
>> the
>> JAR or WAR upon packaging - is this an accurate statement?
>>
>> Thanks.
>> --
>> View this message in context:
>> 
http://www.nabble.com/Runtime-dependencies-in-Eclipse-classpath-tf3769914s177.html#a10658508
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> -
>> 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]
>
>
>

--
View this message in context: 
http://www.nabble.com/Runtime-dependencies-in-Eclipse-classpath-tf3769914s177.html#a10658694
Sent from the Maven - Users mailing list archive at Nabble.com.


-
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: Runtime dependencies in Eclipse classpath

2007-05-16 Thread lightbulb432

So "runtime" seems very similar to the "compile" scope type. Could somebody
please explain the difference? 

The Maven documentation seems to imply something about transitive
dependencies, but I don't understand what it's trying to say.

Thanks.



Larry Meadors-2 wrote:
> 
> I'd assume that it's there so that you can run your app from the IDE -
> that's the behavior I'd expect.
> 
> Larry
> 
> 
> On 5/16/07, lightbulb432 <[EMAIL PROTECTED]> wrote:
>>
>> Why are dependencies with a scope of "runtime" added to Eclipse's
>> .classpath
>> file? I thought the point of runtime is that it's not a compile-time
>> dependency; therefore, why the addition to the .classpath?
>>
>> Perhaps someone can correct me, but my understanding of runtime scope is
>> that it is not included in the compile-time classpath, but is added to
>> the
>> JAR or WAR upon packaging - is this an accurate statement?
>>
>> Thanks.
>> --
>> View this message in context:
>> http://www.nabble.com/Runtime-dependencies-in-Eclipse-classpath-tf3769914s177.html#a10658508
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> -
>> 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]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Runtime-dependencies-in-Eclipse-classpath-tf3769914s177.html#a10658694
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Re: Runtime dependencies in Eclipse classpath

2007-05-16 Thread Larry Meadors

I'd assume that it's there so that you can run your app from the IDE -
that's the behavior I'd expect.

Larry


On 5/16/07, lightbulb432 <[EMAIL PROTECTED]> wrote:


Why are dependencies with a scope of "runtime" added to Eclipse's .classpath
file? I thought the point of runtime is that it's not a compile-time
dependency; therefore, why the addition to the .classpath?

Perhaps someone can correct me, but my understanding of runtime scope is
that it is not included in the compile-time classpath, but is added to the
JAR or WAR upon packaging - is this an accurate statement?

Thanks.
--
View this message in context: 
http://www.nabble.com/Runtime-dependencies-in-Eclipse-classpath-tf3769914s177.html#a10658508
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Runtime dependencies in Eclipse classpath

2007-05-16 Thread lightbulb432

Why are dependencies with a scope of "runtime" added to Eclipse's .classpath
file? I thought the point of runtime is that it's not a compile-time
dependency; therefore, why the addition to the .classpath?

Perhaps someone can correct me, but my understanding of runtime scope is
that it is not included in the compile-time classpath, but is added to the
JAR or WAR upon packaging - is this an accurate statement?

Thanks.
-- 
View this message in context: 
http://www.nabble.com/Runtime-dependencies-in-Eclipse-classpath-tf3769914s177.html#a10658508
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Problems generating .classpath

2007-05-16 Thread Sancheski

Hi all
I am having some problems generating .classpath file using eclipse:eclipse
goal. I have never experienced this problem before. I also had to add the
plugin configuration info showed below to generate the .project file
properly (without this config, the .project file did not take java nature as
usual). My question is what I am doing wrong and what I should do to
generate the .classpath file. Thanks in advance


  
   ...
  
 org.apache.maven.plugins
 maven-eclipse-plugin
 
 

  org.eclipse.ajdt.ui.ajnature


  org.eclipse.jdt.core.javanature

 
 

  org.eclipse.ajdt.core.ajbuilder


  org.eclipse.jdt.core.javabuilder

 
 
   
  ...
  

-- 
View this message in context: 
http://www.nabble.com/Problems-generating-.classpath-tf3764036s177.html#a10639951
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Re: classpath clarification

2007-05-15 Thread Monty Zukowski
Thanks.  Using either of your suggestions leads to this stacktrace:

java.lang.ClassNotFoundException: 
com.temboo.arcturus.test.choreo.ExpressionChoreoBasicsTest
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at 
org.codehaus.classworlds.RealmClassLoader.loadClassDirect(RealmClassLoader.java:195)
at 
org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:255)
at 
org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:274)
at 
org.codehaus.classworlds.DefaultClassRealm.loadClass(DefaultClassRealm.java:274)
at 
org.codehaus.classworlds.RealmClassLoader.loadClass(RealmClassLoader.java:214)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at 
com.temboo.arcturus.maven_testsuite_plugin.TestsuitePlugin.execute(TestsuitePlugin.java:44)

Thanks for everyone's help on this!

Monty

 Original Message 
From: Marcel Schutte <[EMAIL PROTECTED]>
To: Maven Users List 
Sent: Tuesday, May 15, 2007 12:11:30 AM
Subject: Re: classpath clarification

Hi Monty,

You shouldn't use ClassLoader.getSystemClassLoader() to lookup your class. 
Maven uses a hierarchy of classloaders and by specifying that you want the 
systemclassloader, you bypass this completely. Instead, try with 
'Class.forName("com.temboo.arcturus.test.choreo.ExpressionChoreoBasicsTest")' 
or 
'Thread.currentThread().getContextClassLoader().loadClass("com.temboo.arcturus.test.choreo.ExpressionChoreoBasicsTest")'.

A similar reasoning holds for System.getProperty("java.class.path"). Once you 
have a Class instance 'clazz' you can use 
'clazz.getProtectionDomain().getCodeSource().getLocation()' instead.

Regards,
Marcel

- Original Message 
From: Monty Zukowski <[EMAIL PROTECTED]>
To: Maven Users List 
Sent: Monday, May 14, 2007 11:29:46 PM
Subject: Re: classpath clarification

From: Wayne Fay <[EMAIL PROTECTED]>
> You need to tag your mojo with:
> @requiresDependencyResolution test

> Read more here:
> http://maven.apache.org/developers/mojo-api-specification.html

That didn't seem to help:
/**
 * @goal testsuite
 * @description Will run a testsuite
 * @requiresDependencyResolution test
 * @phase test
 */

public class TestsuitePlugin
extends AbstractMojo
{

/**
 * @parameter expression="${project}"
 * @required
     */
private MavenProject project;

public void execute()
throws MojoExecutionException
{
String classpath = System.getProperty("java.class.path");
getLog().info("classpath: " + classpath);
try {

ClassLoader.getSystemClassLoader().loadClass("com.temboo.arcturus.test.choreo.ExpressionChoreoBasicsTest");
getLog().info("got the class!");
} catch (ClassNotFoundException e) {
e.printStackTrace();
}

Gives:

[INFO] [arcturustestsuite:testsuite {execution: 1}]
[INFO] classpath: 
/usr/local/maven-2.0.4/core/boot/classworlds-1.1.jar:/usr/lib/j2sdk1.5-sun//lib/tools.jar
java.lang.ClassNotFoundException: 
com.temboo.arcturus.test.choreo.ExpressionChoreoBasicsTest

I assume I should see target/test-classes and friends in the classpath.  When I 
try to load the class I want to run, it fails saying it's not on the classpath.



Thanks again,

Monty






 

Get your own web address.  
Have a HUGE year through Yahoo! Small Business.
http://smallbusiness.yahoo.com/domains/?p=BESTDEAL

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







Re: classpath clarification

2007-05-15 Thread Marcel Schutte
Hi Monty,

You shouldn't use ClassLoader.getSystemClassLoader() to lookup your class. 
Maven uses a hierarchy of classloaders and by specifying that you want the 
systemclassloader, you bypass this completely. Instead, try with 
'Class.forName("com.temboo.arcturus.test.choreo.ExpressionChoreoBasicsTest")' 
or 
'Thread.currentThread().getContextClassLoader().loadClass("com.temboo.arcturus.test.choreo.ExpressionChoreoBasicsTest")'.

A similar reasoning holds for System.getProperty("java.class.path"). Once you 
have a Class instance 'clazz' you can use 
'clazz.getProtectionDomain().getCodeSource().getLocation()' instead.

Regards,
Marcel

- Original Message 
From: Monty Zukowski <[EMAIL PROTECTED]>
To: Maven Users List 
Sent: Monday, May 14, 2007 11:29:46 PM
Subject: Re: classpath clarification

From: Wayne Fay <[EMAIL PROTECTED]>
> You need to tag your mojo with:
> @requiresDependencyResolution test

> Read more here:
> http://maven.apache.org/developers/mojo-api-specification.html

That didn't seem to help:
/**
 * @goal testsuite
 * @description Will run a testsuite
 * @requiresDependencyResolution test
 * @phase test
 */

public class TestsuitePlugin
extends AbstractMojo
{

/**
 * @parameter expression="${project}"
 * @required
 */
private MavenProject project;

public void execute()
throws MojoExecutionException
{
String classpath = System.getProperty("java.class.path");
getLog().info("classpath: " + classpath);
try {

ClassLoader.getSystemClassLoader().loadClass("com.temboo.arcturus.test.choreo.ExpressionChoreoBasicsTest");
getLog().info("got the class!");
    } catch (ClassNotFoundException e) {
e.printStackTrace();
}

Gives:

[INFO] [arcturustestsuite:testsuite {execution: 1}]
[INFO] classpath: 
/usr/local/maven-2.0.4/core/boot/classworlds-1.1.jar:/usr/lib/j2sdk1.5-sun//lib/tools.jar
java.lang.ClassNotFoundException: 
com.temboo.arcturus.test.choreo.ExpressionChoreoBasicsTest

I assume I should see target/test-classes and friends in the classpath.  When I 
try to load the class I want to run, it fails saying it's not on the classpath.



Thanks again,

Monty






 

Get your own web address.  
Have a HUGE year through Yahoo! Small Business.
http://smallbusiness.yahoo.com/domains/?p=BESTDEAL

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



Re: classpath clarification

2007-05-14 Thread Monty Zukowski
From: Wayne Fay <[EMAIL PROTECTED]>
> You need to tag your mojo with:
> @requiresDependencyResolution test

> Read more here:
> http://maven.apache.org/developers/mojo-api-specification.html

That didn't seem to help:
/**
 * @goal testsuite
 * @description Will run a testsuite
 * @requiresDependencyResolution test
 * @phase test
 */

public class TestsuitePlugin
extends AbstractMojo
{

/**
 * @parameter expression="${project}"
 * @required
 */
private MavenProject project;

public void execute()
throws MojoExecutionException
{
String classpath = System.getProperty("java.class.path");
getLog().info("classpath: " + classpath);
try {

ClassLoader.getSystemClassLoader().loadClass("com.temboo.arcturus.test.choreo.ExpressionChoreoBasicsTest");
getLog().info("got the class!");
} catch (ClassNotFoundException e) {
e.printStackTrace();
    }

Gives:

[INFO] [arcturustestsuite:testsuite {execution: 1}]
[INFO] classpath: 
/usr/local/maven-2.0.4/core/boot/classworlds-1.1.jar:/usr/lib/j2sdk1.5-sun//lib/tools.jar
java.lang.ClassNotFoundException: 
com.temboo.arcturus.test.choreo.ExpressionChoreoBasicsTest

I assume I should see target/test-classes and friends in the classpath.  When I 
try to load the class I want to run, it fails saying it's not on the classpath.



Thanks again,

Monty



Re: classpath clarification

2007-05-14 Thread Wayne Fay

You need to tag your mojo with:
@requiresDependencyResolution test

Read more here:
http://maven.apache.org/developers/mojo-api-specification.html

Wayne

On 5/14/07, Monty Zukowski <[EMAIL PROTECTED]> wrote:

I've got my own plugin for my own test framework but don't seem to be getting 
my test classes in the classpath when running the plugin.

For instance:

 
   com.temboo.arcturus.maven_testsuite_plugin
   arcturus-maven-testsuite-plugin
   1.0-SNAPSHOT
   
 
   test
   1
  
   
   
 testsuite
   
 
   
 
...
  public void execute()
   throws MojoExecutionException
   {
   String classpath = System.getProperty("java.class.path");
   getLog().info("classpath: " + classpath);

prints this:
classpath: 
/usr/local/maven-2.0.4/core/boot/classworlds-1.1.jar:/usr/lib/j2sdk1.5-sun//lib/tools.jar

which shows none of the compiled classes in there.  I was expecting since I specified the 
test that it would be set up to have the test classes in the 
classpath already.

So I tried to pass in the classpath I need, something like this:

 
   com.temboo.arcturus.maven_testsuite_plugin
   arcturus-maven-testsuite-plugin
   1.0-SNAPSHOT
   
 
   test
   1
   
   
 
 
 
 
 
   
 ${project.class.path}
 ${basedir}/testng.xml
   
   
 testsuite
   
 
   
 
...
  /**
* @parameter expression="whatever"
* @required
*/
   private String cp;

   public void execute()
   throws MojoExecutionException
   {
   getLog().info("classpath: " + cp);
   String classpath = System.getProperty("java.class.path");
   getLog().info("old classpath: " + classpath);


And that told me that ${project.class.path} was undefined.  So, one question is 
how do I pass the path along to the plugin?

But the big question is, how do I specify that I want this plugin to be run 
with the maven.test.classpath?

Thanks,

Monty




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



classpath clarification

2007-05-14 Thread Monty Zukowski
I've got my own plugin for my own test framework but don't seem to be getting 
my test classes in the classpath when running the plugin.

For instance:

  
com.temboo.arcturus.maven_testsuite_plugin
arcturus-maven-testsuite-plugin
1.0-SNAPSHOT

  
test
1
   


  testsuite

  

  
...
   public void execute()
throws MojoExecutionException
{
    String classpath = System.getProperty("java.class.path");
    getLog().info("classpath: " + classpath);

prints this:
classpath: 
/usr/local/maven-2.0.4/core/boot/classworlds-1.1.jar:/usr/lib/j2sdk1.5-sun//lib/tools.jar

which shows none of the compiled classes in there.  I was expecting since I 
specified the test that it would be set up to have the test 
classes in the classpath already.

So I tried to pass in the classpath I need, something like this:

  
com.temboo.arcturus.maven_testsuite_plugin
arcturus-maven-testsuite-plugin
1.0-SNAPSHOT

  
test
1


  
  
  
  
  

  ${project.class.path}
  ${basedir}/testng.xml


  testsuite

  

  
...
   /**
 * @parameter expression="whatever"
 * @required
 */
private String cp;

public void execute()
throws MojoExecutionException
{
getLog().info("classpath: " + cp);
String classpath = System.getProperty("java.class.path");
getLog().info("old classpath: " + classpath);


And that told me that ${project.class.path} was undefined.  So, one question is 
how do I pass the path along to the plugin?

But the big question is, how do I specify that I want this plugin to be run 
with the maven.test.classpath?

Thanks,

Monty



Provided scope not appearing in classpath

2007-05-14 Thread lightbulb432

Am I right to assume that the "provided" dependency scope should appear in my
.classpath file when I run an eclipse:eclipse, but it should not appear in
the generated WAR when I run a package/install/deploy?

Right now it's not appearing in my .classpath, which seems wrong...

Thanks.
-- 
View this message in context: 
http://www.nabble.com/Provided-scope-not-appearing-in-classpath-tf3753731s177.html#a10608149
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Re: Problems with loading non-Java resources from classpath in JUnit tests

2007-05-14 Thread Wayne Fay

John Casey sent this method a while ago that might be useful:

private File getFile( String resourceName )
{
 ClassLoader cloader = Thread.currentThread().getContextClassLoader();
 URL resource = cloader.getResource( resourceName );

 if ( resource == null )
 {
 throw new IllegalArgumentException( "Could not get resource: " +
resourceName );
 }

 return new File( resource.getPath() );
}

Wayne

On 5/14/07, Rossmanith, Philipp <[EMAIL PROTECTED]> wrote:


> What is the content of "filePath1" ?
It's a string containing the name of the properties file... (It is working in 
Eclipse, so I can exclude a typo or similar as the cause of the error.)

Ciao,
Philipp

> -Mensaje original-
> De: Jörg Schaible [mailto:[EMAIL PROTECTED]
> Enviado el: lunes, 14 de mayo de 2007 10:13
> Para: Maven Users List
> Asunto: RE: Problems with loading non-Java resources from classpath in
> JUnit tests
>
> What is the content of "filePath1" ?
>
> Rossmanith, Philipp wrote on Monday, May 14, 2007 10:00 AM:
>
> > Hi,
> >
> > My resource file (the properties file I am trying to load) is located
> > under {root}src\test\resources. Compiling with Maven puts it under
> > {root}\target\test-classes, along with the Java class files
> > for the unit
> > tests.
> >
> > I also tried to run the tests with the properties-file placed in
> > {root}src\main\resources, but it didn't work, either.
> >
> > Any other suggestions?
> >
> > Thanks in advance,
> > Ciao,
> > Philipp
> >
> >> -Mensaje original-
> >> De: Wayne Fay [mailto:[EMAIL PROTECTED]
> >> Enviado el: domingo, 13 de mayo de 2007 23:36
> >> Para: Maven Users List
> >> Asunto: Re: Problems with loading non-Java resources from classpath
> >> in JUnit tests
> >>
> >
> >> Where is your resource file located in your source code tree?
> >>
> >
> >> It should be under src/main/resources. I will assume it is under
> >> src/main/java -- that's your problem.
> >>
> >
> >> Wayne
> >>
> >
> >> On 5/13/07, Rossmanith, Philipp <[EMAIL PROTECTED]>
> >> wrote:
> >>>
> >>> Hi,
> >>> I have a component that is loading resources/files from the
> > classpath
> >> and for which I have written a JUnit test. However, when I run the
> >> tests with Maven from the command line, they fail - obviously due to
> >> some classpath problems.*)
> >>> My assumption was that target/test-classes would form part of the
> >> classpath, which a test output with maven -X confirmed. **)
> > The idea I
> > got
> >> was that once the resource file (here: a properties file) would be
> >> found if it was contained in this folder. However, if I write out
> >> the classpath programmatically from within the JUnit test, it
> >> doesn't contain the folder.***)
> >>> Please note that running the same test in Eclipse is working if I
> > add
> >> the test/resources folder as a source folder (with output in
> >> target/test- classes).
> >>> Now my question is: How can I make add these non-Java resources to
> > the a
> >> Maven classpath? Is there a way to configure the classpath
> > that Maven
> > is
> >> looking at via the POM?
> >>> Any help on this would be highly appreciated, as I already blew 2
> >>> days on this. I'm using Maven 2.0.6 and JUnit 3.8.1 unit tests.
> >>> Thanks in advance, Ciao, Philipp *) I get a NPE for an input stream
> >>> i create via
> >> ClassLoader.getSystemResourceAsStream(this.filePath1).
> >>> **) From a file dump:
> >>>>>
> >>> [DEBUG] Adding to surefire test classpath: C:\Documents and
> >> Settings\9prossma\.m2\repository\org\codehaus\plexus\plexus-
> >> utils\1.1\plexus-utils-1.1.jar
> >>> [DEBUG] Test Classpath :
> >>> [DEBUG]   C:\Manchester\utilities\target\classes
> >>> [DEBUG]   C:\Manchester\utilities\target\test-classes <<
> >>> ***) System.out.println("Class path: " +
> >> System.getProperty("java.class.path")):
> >>>>>
> >>> Class path: C:\Documents and
> >> Settings\9prossma\.m2\repository\org\apache\maven\surefire\surefire-
> >> api\2.0\surefire-api-2.0.jar;C:\Documents and
> >> Settings\9prossma\.m2\repository\org\codehaus\plexus\plexus-
> >> utils\1.1\plexus-utils-1.1.jar;C:\Doc
> >>> uments an

RE: Problems with loading non-Java resources from classpath in JUnit tests - SOLVED

2007-05-14 Thread Rossmanith, Philipp

FYI: the problem was that I executed my requests against the wrong class 
loader. Having changed the code from
>>
InputStream iStr = ClassLoader
.getSystemResourceAsStream(this.filePath1);
<<
... to...
>>
InputStream iStr = {class name}.class.getClassLoader()
.getResourceAsStream(this.filePath1);
<<
... makes it run like dream :-)

Thanks for your help,
Ciao,
Philipp

> -Mensaje original-
> De: Rossmanith, Philipp
> Enviado el: lunes, 14 de mayo de 2007 10:31
> Para: Maven Users List
> Asunto: RE: Problems with loading non-Java resources from classpath in
> JUnit tests
>
>
> > What is the content of "filePath1" ?
> It's a string containing the name of the properties file... (It is working
> in Eclipse, so I can exclude a typo or similar as the cause of the error.)
>
> Ciao,
> Philipp
>
>
> > -Mensaje original-
> > De: Jörg Schaible [mailto:[EMAIL PROTECTED]
> > Enviado el: lunes, 14 de mayo de 2007 10:13
> > Para: Maven Users List
> > Asunto: RE: Problems with loading non-Java resources from classpath in
> > JUnit tests
> >
>
> > What is the content of "filePath1" ?
> >
>
> > Rossmanith, Philipp wrote on Monday, May 14, 2007 10:00 AM:
> >
>
> > > Hi,
> > >
> > > My resource file (the properties file I am trying to load) is located
> > > under {root}src\test\resources. Compiling with Maven puts it under
> > > {root}\target\test-classes, along with the Java class files
> > > for the unit
> > > tests.
> > >
> > > I also tried to run the tests with the properties-file placed in
> > > {root}src\main\resources, but it didn't work, either.
> > >
> > > Any other suggestions?
> > >
> > > Thanks in advance,
> > > Ciao,
> > > Philipp
> > >
> > >> -Mensaje original-
> > >> De: Wayne Fay [mailto:[EMAIL PROTECTED]
> > >> Enviado el: domingo, 13 de mayo de 2007 23:36
> > >> Para: Maven Users List
> > >> Asunto: Re: Problems with loading non-Java resources from classpath
> > >> in JUnit tests
> > >>
> > >
> > >> Where is your resource file located in your source code tree?
> > >>
> > >
> > >> It should be under src/main/resources. I will assume it is under
> > >> src/main/java -- that's your problem.
> > >>
> > >
> > >> Wayne
> > >>
> > >
> > >> On 5/13/07, Rossmanith, Philipp <[EMAIL PROTECTED]>
> > >> wrote:
> > >>>
> > >>> Hi,
> > >>> I have a component that is loading resources/files from the
> > > classpath
> > >> and for which I have written a JUnit test. However, when I run the
> > >> tests with Maven from the command line, they fail - obviously due to
> > >> some classpath problems.*)
> > >>> My assumption was that target/test-classes would form part of the
> > >> classpath, which a test output with maven -X confirmed. **)
> > > The idea I
> > > got
> > >> was that once the resource file (here: a properties file) would be
> > >> found if it was contained in this folder. However, if I write out
> > >> the classpath programmatically from within the JUnit test, it
> > >> doesn't contain the folder.***)
> > >>> Please note that running the same test in Eclipse is working if I
> > > add
> > >> the test/resources folder as a source folder (with output in
> > >> target/test- classes).
> > >>> Now my question is: How can I make add these non-Java resources to
> > > the a
> > >> Maven classpath? Is there a way to configure the classpath
> > > that Maven
> > > is
> > >> looking at via the POM?
> > >>> Any help on this would be highly appreciated, as I already blew 2
> > >>> days on this. I'm using Maven 2.0.6 and JUnit 3.8.1 unit tests.
> > >>> Thanks in advance, Ciao, Philipp *) I get a NPE for an input stream
> > >>> i create via
> > >> ClassLoader.getSystemResourceAsStream(this.filePath1).
> > >>> **) From a file dump:
> > >>>>>
> > >>> [DEBUG] Adding to surefire test classpath: C:\Documents and
> > >> Settings\9prossma\.m2\repository\org\codehaus\plexus\plexus-
> > >> utils\1.1\plexus-utils-1.1.jar
> > >>> [

RE: Problems with loading non-Java resources from classpath in JUnit tests

2007-05-14 Thread Rossmanith, Philipp

> What is the content of "filePath1" ?
It's a string containing the name of the properties file... (It is working in 
Eclipse, so I can exclude a typo or similar as the cause of the error.)

Ciao,
Philipp

> -Mensaje original-
> De: Jörg Schaible [mailto:[EMAIL PROTECTED]
> Enviado el: lunes, 14 de mayo de 2007 10:13
> Para: Maven Users List
> Asunto: RE: Problems with loading non-Java resources from classpath in
> JUnit tests
>
> What is the content of "filePath1" ?
>
> Rossmanith, Philipp wrote on Monday, May 14, 2007 10:00 AM:
>
> > Hi,
> >
> > My resource file (the properties file I am trying to load) is located
> > under {root}src\test\resources. Compiling with Maven puts it under
> > {root}\target\test-classes, along with the Java class files
> > for the unit
> > tests.
> >
> > I also tried to run the tests with the properties-file placed in
> > {root}src\main\resources, but it didn't work, either.
> >
> > Any other suggestions?
> >
> > Thanks in advance,
> > Ciao,
> > Philipp
> >
> >> -Mensaje original-
> >> De: Wayne Fay [mailto:[EMAIL PROTECTED]
> >> Enviado el: domingo, 13 de mayo de 2007 23:36
> >> Para: Maven Users List
> >> Asunto: Re: Problems with loading non-Java resources from classpath
> >> in JUnit tests
> >>
> >
> >> Where is your resource file located in your source code tree?
> >>
> >
> >> It should be under src/main/resources. I will assume it is under
> >> src/main/java -- that's your problem.
> >>
> >
> >> Wayne
> >>
> >
> >> On 5/13/07, Rossmanith, Philipp <[EMAIL PROTECTED]>
> >> wrote:
> >>>
> >>> Hi,
> >>> I have a component that is loading resources/files from the
> > classpath
> >> and for which I have written a JUnit test. However, when I run the
> >> tests with Maven from the command line, they fail - obviously due to
> >> some classpath problems.*)
> >>> My assumption was that target/test-classes would form part of the
> >> classpath, which a test output with maven -X confirmed. **)
> > The idea I
> > got
> >> was that once the resource file (here: a properties file) would be
> >> found if it was contained in this folder. However, if I write out
> >> the classpath programmatically from within the JUnit test, it
> >> doesn't contain the folder.***)
> >>> Please note that running the same test in Eclipse is working if I
> > add
> >> the test/resources folder as a source folder (with output in
> >> target/test- classes).
> >>> Now my question is: How can I make add these non-Java resources to
> > the a
> >> Maven classpath? Is there a way to configure the classpath
> > that Maven
> > is
> >> looking at via the POM?
> >>> Any help on this would be highly appreciated, as I already blew 2
> >>> days on this. I'm using Maven 2.0.6 and JUnit 3.8.1 unit tests.
> >>> Thanks in advance, Ciao, Philipp *) I get a NPE for an input stream
> >>> i create via
> >> ClassLoader.getSystemResourceAsStream(this.filePath1).
> >>> **) From a file dump:
> >>>>>
> >>> [DEBUG] Adding to surefire test classpath: C:\Documents and
> >> Settings\9prossma\.m2\repository\org\codehaus\plexus\plexus-
> >> utils\1.1\plexus-utils-1.1.jar
> >>> [DEBUG] Test Classpath :
> >>> [DEBUG]   C:\Manchester\utilities\target\classes
> >>> [DEBUG]   C:\Manchester\utilities\target\test-classes <<
> >>> ***) System.out.println("Class path: " +
> >> System.getProperty("java.class.path")):
> >>>>>
> >>> Class path: C:\Documents and
> >> Settings\9prossma\.m2\repository\org\apache\maven\surefire\surefire-
> >> api\2.0\surefire-api-2.0.jar;C:\Documents and
> >> Settings\9prossma\.m2\repository\org\codehaus\plexus\plexus-
> >> utils\1.1\plexus-utils-1.1.jar;C:\Doc
> >>> uments and
> >> Settings\9prossma\.m2\repository\org\apache\maven\surefire\surefire-
> >> booter\2.0\surefire-booter-2.0.jar
> >>> <<
> >>>
> >>> This e-mail may contain confidential or privileged information. Any
> >>> unauthorised copying, use or distribution of this information is
> >>> strictly prohibited.
> >>>
> >>>
> > --

RE: Problems with loading non-Java resources from classpath in JUnit tests

2007-05-14 Thread Jörg Schaible
What is the content of "filePath1" ?

Rossmanith, Philipp wrote on Monday, May 14, 2007 10:00 AM:

> Hi,
> 
> My resource file (the properties file I am trying to load) is located
> under {root}src\test\resources. Compiling with Maven puts it under
> {root}\target\test-classes, along with the Java class files
> for the unit
> tests.
> 
> I also tried to run the tests with the properties-file placed in
> {root}src\main\resources, but it didn't work, either.
> 
> Any other suggestions?
> 
> Thanks in advance,
> Ciao,
> Philipp
> 
>> -Mensaje original-
>> De: Wayne Fay [mailto:[EMAIL PROTECTED]
>> Enviado el: domingo, 13 de mayo de 2007 23:36
>> Para: Maven Users List
>> Asunto: Re: Problems with loading non-Java resources from classpath
>> in JUnit tests 
>> 
> 
>> Where is your resource file located in your source code tree?
>> 
> 
>> It should be under src/main/resources. I will assume it is under
>> src/main/java -- that's your problem.
>> 
> 
>> Wayne
>> 
> 
>> On 5/13/07, Rossmanith, Philipp <[EMAIL PROTECTED]>
>> wrote: 
>>> 
>>> Hi,
>>> I have a component that is loading resources/files from the
> classpath
>> and for which I have written a JUnit test. However, when I run the
>> tests with Maven from the command line, they fail - obviously due to
>> some classpath problems.*)
>>> My assumption was that target/test-classes would form part of the
>> classpath, which a test output with maven -X confirmed. **)
> The idea I
> got
>> was that once the resource file (here: a properties file) would be
>> found if it was contained in this folder. However, if I write out
>> the classpath programmatically from within the JUnit test, it
>> doesn't contain the folder.***)
>>> Please note that running the same test in Eclipse is working if I
> add
>> the test/resources folder as a source folder (with output in
>> target/test- classes).
>>> Now my question is: How can I make add these non-Java resources to
> the a
>> Maven classpath? Is there a way to configure the classpath
> that Maven
> is
>> looking at via the POM?
>>> Any help on this would be highly appreciated, as I already blew 2
>>> days on this. I'm using Maven 2.0.6 and JUnit 3.8.1 unit tests.
>>> Thanks in advance, Ciao, Philipp *) I get a NPE for an input stream
>>> i create via 
>> ClassLoader.getSystemResourceAsStream(this.filePath1).
>>> **) From a file dump:
>>>>> 
>>> [DEBUG] Adding to surefire test classpath: C:\Documents and
>> Settings\9prossma\.m2\repository\org\codehaus\plexus\plexus-
>> utils\1.1\plexus-utils-1.1.jar
>>> [DEBUG] Test Classpath :
>>> [DEBUG]   C:\Manchester\utilities\target\classes
>>> [DEBUG]   C:\Manchester\utilities\target\test-classes <<
>>> ***) System.out.println("Class path: " +
>> System.getProperty("java.class.path")):
>>>>> 
>>> Class path: C:\Documents and
>> Settings\9prossma\.m2\repository\org\apache\maven\surefire\surefire-
>> api\2.0\surefire-api-2.0.jar;C:\Documents and
>> Settings\9prossma\.m2\repository\org\codehaus\plexus\plexus-
>> utils\1.1\plexus-utils-1.1.jar;C:\Doc
>>> uments and
>> Settings\9prossma\.m2\repository\org\apache\maven\surefire\surefire-
>> booter\2.0\surefire-booter-2.0.jar
>>> <<
>>> 
>>> This e-mail may contain confidential or privileged information. Any
>>> unauthorised copying, use or distribution of this information is
>>> strictly prohibited. 
>>> 
>>> 
> -
>>> 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]
> 
> 
> This e-mail may contain confidential or privileged
> information. Any unauthorised
> copying, use or distribution of this information is strictly
> prohibited. 
> 
> -
> 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: Problems with loading non-Java resources from classpath in JUnit tests

2007-05-14 Thread Rossmanith, Philipp

Hi,

My resource file (the properties file I am trying to load) is located
under {root}src\test\resources. Compiling with Maven puts it under
{root}\target\test-classes, along with the Java class files for the unit
tests.

I also tried to run the tests with the properties-file placed in
{root}src\main\resources, but it didn't work, either.

Any other suggestions?

Thanks in advance,
Ciao,
Philipp

> -Mensaje original-
> De: Wayne Fay [mailto:[EMAIL PROTECTED]
> Enviado el: domingo, 13 de mayo de 2007 23:36
> Para: Maven Users List
> Asunto: Re: Problems with loading non-Java resources from classpath in
> JUnit tests
>
> Where is your resource file located in your source code tree?
>
> It should be under src/main/resources. I will assume it is under
> src/main/java -- that's your problem.
>
> Wayne
>
> On 5/13/07, Rossmanith, Philipp <[EMAIL PROTECTED]>
wrote:
> >
> > Hi,
> > I have a component that is loading resources/files from the
classpath
> and for which I have written a JUnit test. However, when I run the
tests
> with Maven from the command line, they fail - obviously due to some
> classpath problems.*)
> > My assumption was that target/test-classes would form part of the
> classpath, which a test output with maven -X confirmed. **) The idea I
got
> was that once the resource file (here: a properties file) would be
found
> if it was contained in this folder. However, if I write out the
classpath
> programmatically from within the JUnit test, it doesn't contain the
> folder.***)
> > Please note that running the same test in Eclipse is working if I
add
> the test/resources folder as a source folder (with output in
target/test-
> classes).
> > Now my question is: How can I make add these non-Java resources to
the a
> Maven classpath? Is there a way to configure the classpath that Maven
is
> looking at via the POM?
> > Any help on this would be highly appreciated, as I already blew 2
days
> on this. I'm using Maven 2.0.6 and JUnit 3.8.1 unit tests.
> > Thanks in advance,
> > Ciao, Philipp
> > *) I get a NPE for an input stream i create via
> ClassLoader.getSystemResourceAsStream(this.filePath1).
> > **) From a file dump:
> > >>
> > [DEBUG] Adding to surefire test classpath: C:\Documents and
> Settings\9prossma\.m2\repository\org\codehaus\plexus\plexus-
> utils\1.1\plexus-utils-1.1.jar
> > [DEBUG] Test Classpath :
> > [DEBUG]   C:\Manchester\utilities\target\classes
> > [DEBUG]   C:\Manchester\utilities\target\test-classes
> > <<
> > ***) System.out.println("Class path: " +
> System.getProperty("java.class.path")):
> > >>
> > Class path: C:\Documents and
> Settings\9prossma\.m2\repository\org\apache\maven\surefire\surefire-
> api\2.0\surefire-api-2.0.jar;C:\Documents and
> Settings\9prossma\.m2\repository\org\codehaus\plexus\plexus-
> utils\1.1\plexus-utils-1.1.jar;C:\Doc
> > uments and
> Settings\9prossma\.m2\repository\org\apache\maven\surefire\surefire-
> booter\2.0\surefire-booter-2.0.jar
> > <<
> >
> > This e-mail may contain confidential or privileged information. Any
> unauthorised
> > copying, use or distribution of this information is strictly
prohibited.
> >
> >
-
> > 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]


This e-mail may contain confidential or privileged information. Any unauthorised
copying, use or distribution of this information is strictly prohibited.

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



Re: Problems with loading non-Java resources from classpath in JUnit tests

2007-05-13 Thread Wayne Fay

Where is your resource file located in your source code tree?

It should be under src/main/resources. I will assume it is under
src/main/java -- that's your problem.

Wayne

On 5/13/07, Rossmanith, Philipp <[EMAIL PROTECTED]> wrote:


Hi,
I have a component that is loading resources/files from the classpath and for 
which I have written a JUnit test. However, when I run the tests with Maven 
from the command line, they fail - obviously due to some classpath problems.*)
My assumption was that target/test-classes would form part of the classpath, 
which a test output with maven -X confirmed. **) The idea I got was that once 
the resource file (here: a properties file) would be found if it was contained 
in this folder. However, if I write out the classpath programmatically from 
within the JUnit test, it doesn't contain the folder.***)
Please note that running the same test in Eclipse is working if I add the 
test/resources folder as a source folder (with output in target/test-classes).
Now my question is: How can I make add these non-Java resources to the a Maven 
classpath? Is there a way to configure the classpath that Maven is looking at 
via the POM?
Any help on this would be highly appreciated, as I already blew 2 days on this. 
I'm using Maven 2.0.6 and JUnit 3.8.1 unit tests.
Thanks in advance,
Ciao, Philipp
*) I get a NPE for an input stream i create via 
ClassLoader.getSystemResourceAsStream(this.filePath1).
**) From a file dump:
>>
[DEBUG] Adding to surefire test classpath: C:\Documents and 
Settings\9prossma\.m2\repository\org\codehaus\plexus\plexus-utils\1.1\plexus-utils-1.1.jar
[DEBUG] Test Classpath :
[DEBUG]   C:\Manchester\utilities\target\classes
[DEBUG]   C:\Manchester\utilities\target\test-classes
<<
***) System.out.println("Class path: " + System.getProperty("java.class.path")):
>>
Class path: C:\Documents and 
Settings\9prossma\.m2\repository\org\apache\maven\surefire\surefire-api\2.0\surefire-api-2.0.jar;C:\Documents
 and 
Settings\9prossma\.m2\repository\org\codehaus\plexus\plexus-utils\1.1\plexus-utils-1.1.jar;C:\Doc
uments and 
Settings\9prossma\.m2\repository\org\apache\maven\surefire\surefire-booter\2.0\surefire-booter-2.0.jar
<<

This e-mail may contain confidential or privileged information. Any unauthorised
copying, use or distribution of this information is strictly prohibited.

-
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: addClasspath does not add the classpath to Manifest

2007-05-13 Thread Jo Vandermeeren

Hi Tom,

Only dependencies with scope "runtime" are added to the classpath.

Cheers
Jo

On 5/11/07, Tom Lambrechts <[EMAIL PROTECTED]> wrote:


When enabling addClasspath the manifest does not contain classpath.
Neither for runtime or compile scope:
Main class and other parameters do work.

Manifest:
-
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: TOLA
Build-Jdk: 1.5.0_07

POM:


org.apache.maven.plugins
maven-jar-plugin



true





Log
[DEBUG] Configuring mojo
'org.apache.maven.plugins:maven-jar-plugin:2.1:jar' -->
[DEBUG]   (f) addClasspath = true
[DEBUG]   (s) manifest =
[EMAIL PROTECTED]
[DEBUG]   (f) archive =
[EMAIL PROTECTED]
[DEBUG]   (f) classesDirectory =
D:\Data\workspace_maven\util.telindus.be\target\classes
[DEBUG]   (f) finalName = be.telindus.util-1.0-SNAPSHOT
[DEBUG]   (f) forceCreation = false
[DEBUG]   (f) outputDirectory =
D:\Data\workspace_maven\util.telindus.be\target
[DEBUG]   (f) project = [EMAIL PROTECTED]
[DEBUG] -- end configuration --
[INFO] [jar:jar]
[DEBUG] isUp2date: false (Input file
D:\Data\workspace_maven\util.telindus.be\pom.properties is newer.)
[INFO] Building jar:
D:\Data\workspace_maven\util.telindus.be\target\be.telindus.util-1.0-SNA
PSHOT.jar
[DEBUG] adding directory META-INF/
[DEBUG] adding entry META-INF/MANIFEST.MF
[DEBUG] adding directory be/
ETC




Re: addClasspath does not add the classpath to Manifest

2007-05-13 Thread Wayne Fay

Not sure what to tell you, Tom. Here's my results with the same
config; it works for me.

Manifest.mf file:
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: WFay
Build-Jdk: 1.5.0_06
Class-Path: jaxme-api-0.3.jar saxon-6.5.3.jar log4j-1.2.12.jar jaxp-ap
i-1.3.jar xml-apis-1.3.04.jar logkit-1.0.1.jar jstl-1.1.2.jar ..snip..

Pom.xml config:
 
   org.apache.maven.plugins
   maven-jar-plugin
   
 
   
 true
   
 
   
 

mvn -X output:
[DEBUG] Configuring mojo 'org.apache.maven.plugins:maven-jar-plugin:2.1:jar' -->
[DEBUG]   (f) addClasspath = true
[DEBUG]   (s) manifest = [EMAIL PROTECTED]
[DEBUG]   (f) archive =
[EMAIL PROTECTED]
[DEBUG]   (f) classesDirectory =
C:\cvs_root\xyz2.1.2\svn_ecit3\XyzLib\target\classes
[DEBUG]   (f) finalName = xyz-lib-2.1.2-SNAPSHOT
[DEBUG]   (f) forceCreation = false
[DEBUG]   (f) outputDirectory = C:\cvs_root\xyz2.1.2\svn_ecit3\XyzLib\target
[DEBUG]   (f) project = [EMAIL PROTECTED]
[DEBUG] -- end configuration --

Wayne

On 5/11/07, Tom Lambrechts <[EMAIL PROTECTED]> wrote:

When enabling addClasspath the manifest does not contain classpath.
Neither for runtime or compile scope:
Main class and other parameters do work.

Manifest:
-
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: TOLA
Build-Jdk: 1.5.0_07

POM:


   org.apache.maven.plugins
   maven-jar-plugin
   
   
   
   true
   
   
   


Log
[DEBUG] Configuring mojo
'org.apache.maven.plugins:maven-jar-plugin:2.1:jar' -->
[DEBUG]   (f) addClasspath = true
[DEBUG]   (s) manifest =
[EMAIL PROTECTED]
[DEBUG]   (f) archive =
[EMAIL PROTECTED]
[DEBUG]   (f) classesDirectory =
D:\Data\workspace_maven\util.telindus.be\target\classes
[DEBUG]   (f) finalName = be.telindus.util-1.0-SNAPSHOT
[DEBUG]   (f) forceCreation = false
[DEBUG]   (f) outputDirectory =
D:\Data\workspace_maven\util.telindus.be\target
[DEBUG]   (f) project = [EMAIL PROTECTED]
[DEBUG] -- end configuration --
[INFO] [jar:jar]
[DEBUG] isUp2date: false (Input file
D:\Data\workspace_maven\util.telindus.be\pom.properties is newer.)
[INFO] Building jar:
D:\Data\workspace_maven\util.telindus.be\target\be.telindus.util-1.0-SNA
PSHOT.jar
[DEBUG] adding directory META-INF/
[DEBUG] adding entry META-INF/MANIFEST.MF
[DEBUG] adding directory be/
ETC




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



Problems with loading non-Java resources from classpath in JUnit tests

2007-05-13 Thread Rossmanith, Philipp

Hi,
I have a component that is loading resources/files from the classpath and for 
which I have written a JUnit test. However, when I run the tests with Maven 
from the command line, they fail - obviously due to some classpath problems.*)
My assumption was that target/test-classes would form part of the classpath, 
which a test output with maven -X confirmed. **) The idea I got was that once 
the resource file (here: a properties file) would be found if it was contained 
in this folder. However, if I write out the classpath programmatically from 
within the JUnit test, it doesn't contain the folder.***)
Please note that running the same test in Eclipse is working if I add the 
test/resources folder as a source folder (with output in target/test-classes).
Now my question is: How can I make add these non-Java resources to the a Maven 
classpath? Is there a way to configure the classpath that Maven is looking at 
via the POM?
Any help on this would be highly appreciated, as I already blew 2 days on this. 
I'm using Maven 2.0.6 and JUnit 3.8.1 unit tests.
Thanks in advance,
Ciao, Philipp
*) I get a NPE for an input stream i create via 
ClassLoader.getSystemResourceAsStream(this.filePath1).
**) From a file dump:
>>
[DEBUG] Adding to surefire test classpath: C:\Documents and 
Settings\9prossma\.m2\repository\org\codehaus\plexus\plexus-utils\1.1\plexus-utils-1.1.jar
[DEBUG] Test Classpath :
[DEBUG]   C:\Manchester\utilities\target\classes
[DEBUG]   C:\Manchester\utilities\target\test-classes
<<
***) System.out.println("Class path: " + System.getProperty("java.class.path")):
>>
Class path: C:\Documents and 
Settings\9prossma\.m2\repository\org\apache\maven\surefire\surefire-api\2.0\surefire-api-2.0.jar;C:\Documents
 and 
Settings\9prossma\.m2\repository\org\codehaus\plexus\plexus-utils\1.1\plexus-utils-1.1.jar;C:\Doc
uments and 
Settings\9prossma\.m2\repository\org\apache\maven\surefire\surefire-booter\2.0\surefire-booter-2.0.jar
<<

This e-mail may contain confidential or privileged information. Any unauthorised
copying, use or distribution of this information is strictly prohibited.

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



addClasspath does not add the classpath to Manifest

2007-05-11 Thread Tom Lambrechts
When enabling addClasspath the manifest does not contain classpath.
Neither for runtime or compile scope:
Main class and other parameters do work.

Manifest: 
-
Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Built-By: TOLA
Build-Jdk: 1.5.0_07

POM:


org.apache.maven.plugins
maven-jar-plugin



true





Log
[DEBUG] Configuring mojo
'org.apache.maven.plugins:maven-jar-plugin:2.1:jar' -->
[DEBUG]   (f) addClasspath = true
[DEBUG]   (s) manifest =
[EMAIL PROTECTED]
[DEBUG]   (f) archive =
[EMAIL PROTECTED]
[DEBUG]   (f) classesDirectory =
D:\Data\workspace_maven\util.telindus.be\target\classes
[DEBUG]   (f) finalName = be.telindus.util-1.0-SNAPSHOT
[DEBUG]   (f) forceCreation = false
[DEBUG]   (f) outputDirectory =
D:\Data\workspace_maven\util.telindus.be\target
[DEBUG]   (f) project = [EMAIL PROTECTED]
[DEBUG] -- end configuration --
[INFO] [jar:jar]
[DEBUG] isUp2date: false (Input file
D:\Data\workspace_maven\util.telindus.be\pom.properties is newer.)
[INFO] Building jar:
D:\Data\workspace_maven\util.telindus.be\target\be.telindus.util-1.0-SNA
PSHOT.jar
[DEBUG] adding directory META-INF/
[DEBUG] adding entry META-INF/MANIFEST.MF
[DEBUG] adding directory be/
ETC



Customizing generated Eclipse .classpath file

2007-05-10 Thread lightbulb432

I'd like to specify based on properties in profiles.xml some values for
Eclipse's .classpath file. How could I do this? (i.e. Where in the
profiles.xml you could specify the path of a Java Build Path variable, for
example, and the generated .classpath file for the eclipse:eclipse goal
would contain that value.) Would this be some kind of "filter"?

Thanks.
-- 
View this message in context: 
http://www.nabble.com/Customizing-generated-Eclipse-.classpath-file-tf3721918s177.html#a10414288
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Re: Manage Maven Classpath

2007-05-03 Thread Wayne Fay

Not that I am aware of, at least, not without hacking some internal
Maven classes.

Wayne

On 5/3/07, GreJ <[EMAIL PROTECTED]> wrote:



Hi,

it's a simple question, and i think that the answer is "no", but i need a
confirmation ;)

Is it possible to manage manually the MavenClasspath ?

Thanks.
--
View this message in context:
http://www.nabble.com/Manage-Maven-Classpath-tf3685869s177.html#a10302892
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Manage Maven Classpath

2007-05-03 Thread GreJ


Hi, 

it's a simple question, and i think that the answer is "no", but i need a
confirmation ;)

Is it possible to manage manually the MavenClasspath ? 

Thanks. 
-- 
View this message in context: 
http://www.nabble.com/Manage-Maven-Classpath-tf3685869s177.html#a10302892
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Prepending a folder to a plugin's classpath

2007-04-25 Thread William Ferguson
Sorry if this is a niave question, but I haven't had much success
Googling it.
 
We have a plugin that uses Velocity to generate some of our source.
The plugin needs to look for overridden Velocity templates in a project
specific location before using those contained within the plugin.
At this point velocity has been configured to use the
ClasspathResourceLoader.
 
How can I ensure that the Plugin puts the project specific classpath
resources ahead of the resources contained in the Plugin?
Is there any Maven mechanism that can be used to prepend to the plugin
classpath?
Or do I need to set a new Classloader inside the plugin that looks for
project resources before delegating to the pre-existing Classloader? And
if so, does anyone know where to find such an inverted Classloader?
 
William


Re: Dynamic jar manifest classpath based on groupId, artifactId and version in repository

2007-04-24 Thread Geoffrey De Smet




Jerome Lacoste schreef:

On 4/23/07, Geoffrey De Smet <[EMAIL PROTECTED]> wrote:

I also have a dependency on spring-core:
/repo/org/springframework/spring-core/2.0.2/spring-core-2.0.2.jar

So I need a different classpathPrefix depending on the dependency.


what is your use case ?

I am not sure that the repository-like structure allowed by the
assembly plugin was designed to allow you to run your app from the
generated repository.

Some suggestions:
1- don't assemble as a maven repository (do you really need it ?)

For the sake of namespacing, yes:
/org/foo/bar-1.0.jar
/org/doo/bar-1.0.jar
are 2 different jars, with different classes.


2- don't depend on the generated classpath (e.g. use a wrapper to
start your app)
You mean a shell script? Then we need to keep 2 verions in sync: 
wrapper.bat and wrapper.sh.


Or do you mean a wrapper jar? We have separate processes that reuse the 
same jars and want to minimize network traffic.


How can we avoid having to rewrite the classpath with each dependency 
change in this case?



3- rewrite the generated classpath once your repository has been created.

In the jar? Problem is we need the groupId of each artifact.


4- patch the jar plugin to accept a classpath generator that matches
your requirement

That would be the full solution.



I would pick option 1 or 3.

Cheers,

J


With kind regards,
Geoffrey De Smet


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



Test classpath

2007-04-23 Thread Steven Rowe
Under Maven v2.0.6, with Surefire plugin v2.3, the directory containing
the .class files generated by the test-compile phase
(${basedir}/target/test-classes/) is not included in java.class.path
when I run "mvn test".  (I got this info from the
target/surefire-reports/TEST-.xml file for a failing test class.)

This is a problem for me because one of my tests expects to be able to
find the test .class files in the classpath, but can't under Maven 2,
and so is failing.

Under both Maven 1.1-beta-3 and IntelliJ IDEA, the generated test class
files directory is included in java.class.path, so my test is succeeding.

Is there anything I can do to change this?  Explicitly including
target/test-classes in the
surefire plugin's configuration seems to have no effect.

Thanks,
Steve


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



Re: Dynamic jar manifest classpath based on groupId, artifactId and version in repository

2007-04-23 Thread Jerome Lacoste

On 4/23/07, Geoffrey De Smet <[EMAIL PROTECTED]> wrote:

I also have a dependency on spring-core:
/repo/org/springframework/spring-core/2.0.2/spring-core-2.0.2.jar

So I need a different classpathPrefix depending on the dependency.


what is your use case ?

I am not sure that the repository-like structure allowed by the
assembly plugin was designed to allow you to run your app from the
generated repository.

Some suggestions:
1- don't assemble as a maven repository (do you really need it ?)
2- don't depend on the generated classpath (e.g. use a wrapper to
start your app)
3- rewrite the generated classpath once your repository has been created.
4- patch the jar plugin to accept a classpath generator that matches
your requirement

I would pick option 1 or 3.

Cheers,

J

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



Re: Dynamic jar manifest classpath based on groupId, artifactId and version in repository

2007-04-23 Thread Geoffrey De Smet

I also have a dependency on spring-core:
/repo/org/springframework/spring-core/2.0.2/spring-core-2.0.2.jar

So I need a different classpathPrefix depending on the dependency.


With kind regards,
Geoffrey De Smet

Ian Springer schreef:

Hi,

Add:

../../../../org/ggg/ggg-core/1.0/

as a child element of the  element.

Ian

Geoffrey De Smet wrote:

Hi all,

With the assembly plugin I can put all my module jars in repository 
like structure:


/repo/org/ggg/ggg-core/1.0/ggg-core-1.0.jar
/repo/org/ggg/ggg-ftp-app/1.0/ggg-ftp-app-1.0.jar depends on ggg-core
/repo/org/ggg/ggg-http-app/1.0/ggg-http-app-1.0.jar depends on ggg-core

I've configured the maven-jar-plugin as such:
  
org.apache.maven.plugins
maven-jar-plugin

  

  org.ggg.ftpapp.FtpMain
  true

  

  

And now the manifest contains an entry
"ggg-core-1.0.jar".
The problem is that this needs to be 
"../../../../org/ggg/ggg-core/1.0/ggg-core-1.0.jar"


How I make that happen?




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



Re: Dynamic jar manifest classpath based on groupId, artifactId and version in repository

2007-04-23 Thread Ian Springer

Hi,

Add:

../../../../org/ggg/ggg-core/1.0/

as a child element of the  element.

Ian

Geoffrey De Smet wrote:

Hi all,

With the assembly plugin I can put all my module jars in repository like 
structure:


/repo/org/ggg/ggg-core/1.0/ggg-core-1.0.jar
/repo/org/ggg/ggg-ftp-app/1.0/ggg-ftp-app-1.0.jar depends on ggg-core
/repo/org/ggg/ggg-http-app/1.0/ggg-http-app-1.0.jar depends on ggg-core

I've configured the maven-jar-plugin as such:
  
org.apache.maven.plugins
maven-jar-plugin

  

  org.ggg.ftpapp.FtpMain
  true

  

  

And now the manifest contains an entry
"ggg-core-1.0.jar".
The problem is that this needs to be 
"../../../../org/ggg/ggg-core/1.0/ggg-core-1.0.jar"


How I make that happen?




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



Dynamic jar manifest classpath based on groupId, artifactId and version in repository

2007-04-23 Thread Geoffrey De Smet

Hi all,

With the assembly plugin I can put all my module jars in repository like 
structure:


/repo/org/ggg/ggg-core/1.0/ggg-core-1.0.jar
/repo/org/ggg/ggg-ftp-app/1.0/ggg-ftp-app-1.0.jar depends on ggg-core
/repo/org/ggg/ggg-http-app/1.0/ggg-http-app-1.0.jar depends on ggg-core

I've configured the maven-jar-plugin as such:
  
org.apache.maven.plugins
maven-jar-plugin

  

  org.ggg.ftpapp.FtpMain
  true

  

  

And now the manifest contains an entry
"ggg-core-1.0.jar".
The problem is that this needs to be 
"../../../../org/ggg/ggg-core/1.0/ggg-core-1.0.jar"


How I make that happen?

--
With kind regards,
Geoffrey De Smet


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



M2: Classpath reference in ant-based mojos?

2007-04-17 Thread Dave Syer

I have some issues trying to get an ant-based mojo to work (need access to a
classpath ref in the ant script of the mojo - similar to
http://www.nabble.com/-m2--Ant-driven-plugins-and-classpath-refid%27s-tf937983s177.html#a2429897).
 
Anyone know how to do that?

Are Ant Mojos still supported / available in 2.0.6?  I find only a reference
to 2.0.4 source code on the plugin website.  Actually I can't find a website
for the plugin that doesn't include the 2.0.4 label in the URL (e.g.
http://maven.apache.org/ref/2.0.4/maven-plugin-tools/maven-plugin-tools-ant). 
Is it still available?
-- 
View this message in context: 
http://www.nabble.com/M2%3A-Classpath-reference-in-ant-based-mojos--tf3592292s177.html#a10039089
Sent from the Maven - Users mailing list archive at Nabble.com.


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



Re: How to generate manifest ClassPath entries for a web project?

2007-04-12 Thread Marcel Schutte
See http://jira.codehaus.org/browse/MEAR-60 for a suggested improvement to the 
'downside' of this solution. Please vote for this issue if you want it fixed.

Regards,
Marcel

- Original Message 
From: Manos Batsis <[EMAIL PROTECTED]>
To: Maven Users List <[EMAIL PROTECTED]>
Sent: Thursday, April 12, 2007 6:50:09 PM
Subject: Re: How to generate manifest ClassPath entries for a web project?

Johan Eltes wrote:
> I'd like have all dependent jars of all modules of my enterprise 
> application bundled in the ear - not in WEB-INF/lib directories of my 
> war files. Is this possible with maven 2? I would also like maven to 
> generate the required ClassPath entries in the war manifest file. I've 
> found out how to accomplish the same tasks for ejb projects, but haven't 
> found any hints on war projects.

md4j-quickstarter does that for it's ejb and war modules. The downside 
is you have to duplicate deps in the ear pom. See the ear and war pom in 
[1] and [2] respectively.

[1] 
http://md4j.cvs.sourceforge.net/md4j/md4j-quickstarter-mvn/ear/pom.xml?view=markup
[2] 
http://md4j.cvs.sourceforge.net/md4j/md4j-quickstarter-mvn/web/pom.xml?view=markup


hth,

Manos

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






   

Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.
http://autos.yahoo.com/new_cars.html 

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



<    4   5   6   7   8   9   10   11   12   13   >