Skip to main content

How to get javaee.jar (the implementation of GlassFish, not the pure API jar) with maven?

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
4 replies [Last post]
mkarg
Offline
Joined: 2007-12-09

Hello GlassFish Community,

I want to run unit tests with maven, so as a runtime replacement for the
pure-API "javaee-api" JAR (Maven coordinates = javax:javae-api:6) I need
to add a dependency on a "real" implementation of javaee.jar (which
includes the real classes for e. g. javax.ejb.EJBException and so
on).What are the coordinates to get this?

Thanks!

Markus

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Redema
Offline
Joined: 2012-07-16

Hi Markus,

when you open the javaee.jar of the glassfish 3.1.x, you find in the manifest file that the Class-Path is filled with references to jar files in mostly the modules directory.

There you also see that the "modules/javax.ejb.jar" is used now.
This jar holds the java.ejb classes as you want.

Please try to find the maven settings from the "modules/javax.ejb.jar" to import this jar file.

See the javaee.jar manifest file for all other jar files you need.

Hope this answers your question.

Regards,

Martin.

mkarg
Offline
Joined: 2007-12-09

Great! Exactly what I searched for! :-)

Maven Central contains it. To depend on it, the following coordinates (GAV) are needed:

org.glassfish.main.ejb
javax.ejb
[3.1, 3.2)

I wonder why the Java EE module teams do not simply publish these GAV coordinates on their particular web sites?

Thanks a lot!
-Markus

rjdkolb
Offline
Joined: 2006-07-20

Hi Markus

On 25 July 2012 09:57, Markus Karg wrote:

> I want to run unit tests with maven, so as a runtime replacement for the
> pure-API „javaee-api” JAR (Maven coordinates = javax:javae-api:6) I need to
> add a dependency on a “real” implementation of javaee.jar (which includes
> the real classes for e. g. javax.ejb.EJBException and so on).What are the
> coordinates to get this?
>

This is not really answering your question. So forgive me.

If you want to write unit tests for Glassfish, why not try Arquillian ?
http://www.jboss.org/arquillian.html (it works for Glassfish as well)
http://nosoftskills.com/2011/01/unit-testing-services-arquillian/

regards
Richard.

mkarg
Offline
Joined: 2007-12-09

I am not using aquillian because I do neither want nor need a full integration test. I simply want to run a runit test on a class which is using javax.ejb.EJBException due to legacy reasons. Arquillian is far too heavy weight for this, as I simply need one missing class.