官术网_书友最值得收藏!

The build

The only dependency Java EE requires is the Java EE API:

<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>${javaee-api.version}</version> <!-- 8.0 -->
<scope>provided</scope>
</dependency>
If you prefer, you can indeed register all the individual specifications, but it will require more work to maintain the list with Java EE upgrades. For this reason, the bundle is often preferred.

Here, the point is to ensure that the API is provided, which means it will not be packaged in the deliverable and will inherit from the server API. The server providing the services associated with the API also provides the API with the right supported version and the right defaults matching the built-in implementations.

Since Java EE 6, there are two main flavors of Java EE: the web profile and the full profile. The web profile is a light version, with only half the specifications compared with the full profile, more or less. The web profile supports only web applications and, therefore, war files. Most of this book will work with a web profile server, so we will package our application as war:

<packaging>war</packaging>

Since we need Java 8, don't forget to configure the Java source and target version in the build. It can be done in different ways, but configuring maven-compiler-plugin as follows is an efficient one:

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
主站蜘蛛池模板: 扬州市| 介休市| 广平县| 揭西县| 盐边县| 新乡县| 民县| 开化县| 高邑县| 冕宁县| 永丰县| 朝阳区| 马龙县| 祁门县| 平远县| 海安县| 太白县| 晋城| 梁平县| 阿拉善盟| 德格县| 四子王旗| 上蔡县| 阿克苏市| 兖州市| 那曲县| 顺平县| 樟树市| 百色市| 陇南市| 荔波县| 类乌齐县| 南汇区| 新乡县| 垣曲县| 谢通门县| 乐亭县| 沈阳市| 乳山市| 辽宁省| 通江县|