You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Henrik <he...@team11.org> on 2009/05/07 13:03:53 UTC

Exclude dependency from scope runtime test classpath

Hi,

I was wondering if there is a way to remove a dependency from the test 
classpath when using <scope>runtime</scope>
I want to make sure that the jar file is only used when running the 
application and not when testing it.

So it really comes down to, I want to have the dependency (jar file) but 
i don't want to add it to compile or test classpath.

Thanks,

Henrik

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


Re: Exclude dependency from scope runtime test classpath

Posted by Henrik <he...@team11.org>.
The jar file in question is a 3:de part jar that we can't and should not 
change. The application depends on the jar for a certain specific 
operation, but not for the building and testing of the module itself.

Don't ask me why, not my idea :)

We use the jar only to Acceptance test the application.
The problem is that the jar (dependency) is loaded in a separate 
classloader when you are running the application and are using the 
specific operation.

I use runtime scope for now and see if I can solve it some other way later.

Thanks for all help. Keep up the good work on Maven.

Henrik

Cummings,Steven skrev:
> Can the tests be in a separate jar? If so they could include the original jar with the code to test but exclude dependencies as needed.
>
> Steven
>
> -----Original Message-----
> From: Henrik [mailto:henrik@team11.org] 
> Sent: Thursday, May 07, 2009 6:04 AM
> To: users@maven.apache.org
> Subject: Exclude dependency from scope runtime test classpath
>
> Hi,
>
> I was wondering if there is a way to remove a dependency from the test 
> classpath when using <scope>runtime</scope>
> I want to make sure that the jar file is only used when running the 
> application and not when testing it.
>
> So it really comes down to, I want to have the dependency (jar file) but 
> i don't want to add it to compile or test classpath.
>
> Thanks,
>
> Henrik
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
> ----------------------------------------------------------------------
> CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>   


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


RE: Exclude dependency from scope runtime test classpath

Posted by "Cummings,Steven" <St...@Cerner.com>.
Can the tests be in a separate jar? If so they could include the original jar with the code to test but exclude dependencies as needed.

Steven

-----Original Message-----
From: Henrik [mailto:henrik@team11.org] 
Sent: Thursday, May 07, 2009 6:04 AM
To: users@maven.apache.org
Subject: Exclude dependency from scope runtime test classpath

Hi,

I was wondering if there is a way to remove a dependency from the test 
classpath when using <scope>runtime</scope>
I want to make sure that the jar file is only used when running the 
application and not when testing it.

So it really comes down to, I want to have the dependency (jar file) but 
i don't want to add it to compile or test classpath.

Thanks,

Henrik

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

----------------------------------------------------------------------
CONFIDENTIALITY NOTICE This message and any included attachments are from Cerner Corporation and are intended only for the addressee. The information contained in this message is confidential and may constitute inside or non-public information under international, federal, or state securities laws. Unauthorized forwarding, printing, copying, distribution, or use of such information is strictly prohibited and may be unlawful. If you are not the addressee, please promptly delete this message and notify the sender of the delivery error by e-mail or you may call Cerner's corporate offices in Kansas City, Missouri, U.S.A at (+1) (816)221-1024.

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


Re: artifact for jaxb2

Posted by Anders Hammar <an...@hammar.net>.
http://lmgtfy.com/?q=jaxb+maven+plugin&l=1

On Thu, Jun 4, 2009 at 12:38, Koxkorrita <ko...@laudio.info> wrote:
> hello
> i am tring for finding one artifact for generate the classes from one xsd
> file.
> my pourpose is into one second step generate one WS using jax-ws but i dont
> find one artifact for generate , from one xsd, using jasb2, the classes.
> i have one xsd and i want to use one "generate" goal for this pourpose.
>
> can you help me?
> thanks
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

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


artifact for jaxb2

Posted by Koxkorrita <ko...@laudio.info>.
hello
i am tring for finding one artifact for generate the classes from one xsd
file.
my pourpose is into one second step generate one WS using jax-ws but i dont
find one artifact for generate , from one xsd, using jasb2, the classes.
i have one xsd and i want to use one "generate" goal for this pourpose.

can you help me?
thanks



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


Re: Exclude dependency from scope runtime test classpath

Posted by Baptiste MATHUS <ml...@batmat.net>.
Ar@#~$, sorry. I meant "by using profiles". This way you could add any
dependency with any scope you like under different circumstances.

2009/6/4 Baptiste MATHUS <ml...@batmat.net>

> Well, I guess you could do that by using, couldn't you?
>
> Cheers
>
> 2009/6/4 ljnelson <lj...@gmail.com>
>
>
>>
>> Baptiste MATHUS wrote:
>> >
>> > I guess you can file an enhancement request for this use, but I'm not
>> sure
>> > it would really make sense. Since you're likely to want to test this
>> kind
>> > of
>> > dependency too in your tests. At least, IMO you'll have to provide a
>> good
>> > use case to justify this new feature.
>> >
>>
>> Hello; I'd like to add to this issue by supplying a compile-time-only
>> scope
>> use case.
>>
>> When building JPA applications, often one wants to compile in support for
>> all the various annotations from the persistence providers (Hibernate,
>> EclipseLink and OpenJPA).  I would like to make it so that all three of
>> these libraries are available only at compile time, but only [i]one[/i] of
>> them is available at test time.
>>
>> Currently I have them all specified as scope=provided, and while that
>> works,
>> I would really like to test my classes in the presence of only one of
>> these
>> libraries, not all three.  To put it another way, I want to ensure that
>> although I reference EclipseLink annotations in my project, I don't need
>> EclipseLink on the runtime/test path.  I have no way of doing this that I
>> know of inside my Maven project.
>>
>> Thoughts?
>>
>> Thanks,
>> Laird
>> --
>> View this message in context:
>> http://www.nabble.com/Exclude-dependency-from-scope-runtime-test-classpath-tp23424431p23875222.html
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
>
> --
> Baptiste <Batmat> MATHUS - http://batmat.net
> Sauvez un arbre,
> Mangez un castor !
>



-- 
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !

Re: Exclude dependency from scope runtime test classpath

Posted by ljnelson <lj...@gmail.com>.

Baptiste MATHUS wrote:
> 
> Well, I guess you could do that by using, couldn't you?
> 

Not that I can see.

I need OpenJPA, Hibernate and EclipseLink classes at compile time no matter
what profile(s) may happen to be active, but only, say, OpenJPA at test
time.  Can profiles do that?  If so, how?

Thanks,
Laird
-- 
View this message in context: http://www.nabble.com/Exclude-dependency-from-scope-runtime-test-classpath-tp23424431p23878578.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Exclude dependency from scope runtime test classpath

Posted by Baptiste MATHUS <ml...@batmat.net>.
Well, I guess you could do that by using, couldn't you?

Cheers

2009/6/4 ljnelson <lj...@gmail.com>

>
>
> Baptiste MATHUS wrote:
> >
> > I guess you can file an enhancement request for this use, but I'm not
> sure
> > it would really make sense. Since you're likely to want to test this kind
> > of
> > dependency too in your tests. At least, IMO you'll have to provide a good
> > use case to justify this new feature.
> >
>
> Hello; I'd like to add to this issue by supplying a compile-time-only scope
> use case.
>
> When building JPA applications, often one wants to compile in support for
> all the various annotations from the persistence providers (Hibernate,
> EclipseLink and OpenJPA).  I would like to make it so that all three of
> these libraries are available only at compile time, but only [i]one[/i] of
> them is available at test time.
>
> Currently I have them all specified as scope=provided, and while that
> works,
> I would really like to test my classes in the presence of only one of these
> libraries, not all three.  To put it another way, I want to ensure that
> although I reference EclipseLink annotations in my project, I don't need
> EclipseLink on the runtime/test path.  I have no way of doing this that I
> know of inside my Maven project.
>
> Thoughts?
>
> Thanks,
> Laird
> --
> View this message in context:
> http://www.nabble.com/Exclude-dependency-from-scope-runtime-test-classpath-tp23424431p23875222.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !

Re: Exclude dependency from scope runtime test classpath

Posted by ljnelson <lj...@gmail.com>.

Baptiste MATHUS wrote:
> 
> I guess you can file an enhancement request for this use, but I'm not sure
> it would really make sense. Since you're likely to want to test this kind
> of
> dependency too in your tests. At least, IMO you'll have to provide a good
> use case to justify this new feature.
> 

Hello; I'd like to add to this issue by supplying a compile-time-only scope
use case.

When building JPA applications, often one wants to compile in support for
all the various annotations from the persistence providers (Hibernate,
EclipseLink and OpenJPA).  I would like to make it so that all three of
these libraries are available only at compile time, but only [i]one[/i] of
them is available at test time.

Currently I have them all specified as scope=provided, and while that works,
I would really like to test my classes in the presence of only one of these
libraries, not all three.  To put it another way, I want to ensure that
although I reference EclipseLink annotations in my project, I don't need
EclipseLink on the runtime/test path.  I have no way of doing this that I
know of inside my Maven project.

Thoughts?

Thanks,
Laird
-- 
View this message in context: http://www.nabble.com/Exclude-dependency-from-scope-runtime-test-classpath-tp23424431p23875222.html
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Exclude dependency from scope runtime test classpath

Posted by Baptiste MATHUS <ml...@batmat.net>.
I don't think it is. The only existing scopes are those listed here:
http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Scope

I guess you can file an enhancement request for this use, but I'm not sure
it would really make sense. Since you're likely to want to test this kind of
dependency too in your tests. At least, IMO you'll have to provide a good
use case to justify this new feature.

Cheers.

2009/5/7 Henrik <he...@team11.org>

> Hi,
>
> I was wondering if there is a way to remove a dependency from the test
> classpath when using <scope>runtime</scope>
> I want to make sure that the jar file is only used when running the
> application and not when testing it.
>
> So it really comes down to, I want to have the dependency (jar file) but i
> don't want to add it to compile or test classpath.
>
> Thanks,
>
> Henrik
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !

Re: Exclude dependency from scope runtime test classpath

Posted by Baptiste MATHUS <ml...@batmat.net>.
As explained in the documentation, provided is "much like compile", and
"[...] available on the compilation and test classpath.

Cheers.

2009/5/7 Fabien Kruba <fa...@gmail.com>

> Hi.
>
> did you tried "provided" scope instead?
>
>  Hi,
>>
>> I was wondering if there is a way to remove a dependency from the test
>> classpath when using <scope>runtime</scope>
>> I want to make sure that the jar file is only used when running the
>> application and not when testing it.
>>
>> So it really comes down to, I want to have the dependency (jar file) but i
>> don't want to add it to compile or test classpath.
>>
>> Thanks,
>>
>> Henrik
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !

Re: Exclude dependency from scope runtime test classpath

Posted by Fabien Kruba <fa...@gmail.com>.
Hi.

did you tried "provided" scope instead?
> Hi,
>
> I was wondering if there is a way to remove a dependency from the test 
> classpath when using <scope>runtime</scope>
> I want to make sure that the jar file is only used when running the 
> application and not when testing it.
>
> So it really comes down to, I want to have the dependency (jar file) 
> but i don't want to add it to compile or test classpath.
>
> Thanks,
>
> Henrik
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>


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