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

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>
主站蜘蛛池模板: 西盟| 通河县| 会宁县| 湟中县| 黄冈市| 蓬溪县| 永清县| 定远县| 石台县| 永嘉县| 重庆市| 全州县| 秀山| 昌吉市| 津市市| 克拉玛依市| 工布江达县| 雷山县| 佳木斯市| 澳门| 额尔古纳市| 巴林右旗| 秭归县| 绥滨县| 塔河县| 宜城市| 花莲县| 大港区| 青田县| 盘锦市| 云安县| 鄂尔多斯市| 廉江市| 东辽县| 犍为县| 固镇县| 绥宁县| 嘉禾县| 绥芬河市| 延津县| 两当县|