Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
296 views
in Technique[技术] by (71.8m points)

java - Maven: javaee-api vs jboss-javaee-6.0

I want a Java JEE6 project built with maven, and I want it standard

So, I put this in my pom.xml:

<dependency>
    <groupId>javax</groupId>
    <artifactId>javaee-api</artifactId>
    <version>6.0</version>
    <scope>provided</scope>
</dependency>

A project like this, it is supposed to run in every JEE6 container compatible (jboss, geronimo, glashfish, etc.)

Then, why this jboss dependency exists?

<dependency>
    <groupId>org.jboss.spec</groupId>
    <artifactId>jboss-javaee-6.0</artifactId>
    <version>3.0.2.Final</version>
    <scope>provided</scope>
 </dependency>

If I use it, am I tied to jboss so I can only use this server with this application?

Is it not preferable to always use the standard javaee-api?

Thank you!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The standard api is crippled, i. e. method bodies are missing. This turns out when testing. I have once run into this pitfall and was not very happy with it.

Therefore it is advisiable to use another package as reference.

You can have a closer look on Adam Biens Blog

You can also make profiles for different deployment environments if you really need. However, essentially I agree, this is sadly not a very pleasant circumstance.

For having issues with testing, you can have a look at this thread.

Edit:
By the way, since now this might be interessting. This issue is gone for the javaee-(web-)api for Java EE 7 (source)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...