32

I realise these dependencies are required for compiling against Java servlet specification, and so on, but I'm not clear on the differences between them, and when I should use one as opposed to the other.

What is the difference between them? Is one a superset of the other?

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

dependency>
  <groupId>javax</groupId>
  <artifactId>javaee-web-api</artifactId>
  <version>6.0</version>
  <scope>provided</scope>
</dependency>
Rohit
  • 3,401
  • 4
  • 33
  • 60
kevin847
  • 1,058
  • 1
  • 7
  • 15

1 Answers1

43

The javaee-web-api is supposed to support the Java EE Web Profile.

Introduced in Java EE 6, the Web Profile radically streamlines the platform and enables the creation of a new dawn of lightweight, agile, compelling application servers with a laser focus on web application development.

However if you compare the two different jar files there is little that differs between them. I opened them up in 7-zip and these two screenshots shows the only (AFAIK) differences, namely that there is no support for JMS in the javaee-web-api and that the xml library seems to be larger in the javaee-api.

javaee-api

enter image description here

javaee-web-api

enter image description here

maba
  • 47,113
  • 10
  • 108
  • 118
  • 4
    This is a bit misleading answer. You may see the right answer here https://stackoverflow.com/questions/24239978/java-ee-web-profile-vs-java-ee-full-platform – abbas Sep 28 '18 at 14:53