java javaee-api 和 javaee-web-api 有什么区别?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16789020/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is the difference between javaee-api and javaee-web-api?
提问by kevin847
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.
我意识到根据 Java servlet 规范等进行编译需要这些依赖项,但我不清楚它们之间的区别,以及何时应该使用一个而不是另一个。
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>
回答by maba
The javaee-web-api
is supposed to support the Java EE Web Profile.
本javaee-web-api
应该支持的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.
在 Java EE 6 中引入的 Web Profile 从根本上简化了平台,使轻量级、敏捷、引人注目的应用程序服务器的新曙光得以创建,重点关注 Web 应用程序开发。
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
andthat the xml
library seems to be larger in the javaee-api
.
但是,如果您比较两个不同的 jar 文件,它们之间几乎没有什么不同。我打开了他们在7-ZIP和这两张截图显示了只(据我所知)的差异,即没有在对JMS不支持javaee-web-api
与该xml
库似乎在更大javaee-api
。
javaee-api
javaee-api
javaee-web-api
javaee-web-api