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]