- Java EE 8 High Performance
- Romain Manni Bucau
- 236字
- 2021-06-30 19:14:25
The application server
Java EE defines specifications and, therefore, you can find several different implementations. Each major vendor has its own server but, of course, for us and Java EE, a lot of servers are fully open source. As Java EE 8 is very recent, we will use GlassFish, which is the reference implementation and is therefore the first one to be compliant with the specification (it must be released with the specification). However, there are a lot of alternatives (such as Apache TomEE, Wildfly, Payara, Liberty Profile, and so on), which will probably follow in the coming months.
GlassFish can be downloaded from its website (https://javaee.github.io/glassfish/download). We need the 5.x version to target Java EE 8, but due to its early release, a major part of this book will work with the previous versions.
If you want to integrate it with your development environment (and Maven), you can add the GlassFish repository to pom.xml, as follows:
<pluginRepository>
<id>maven-java-net</id>
<url>https://maven.java.net/content/groups/promoted/</url>
</pluginRepository>
Add the GlassFish plugin without forgetting to specify the version of the server in order to override the default one, which is now quite old:
<plugin> <!-- glassfish.version = 5.0 -->
<groupId>org.glassfish.embedded</groupId>
<artifactId>maven-embedded-glassfish-plugin</artifactId>
<version>3.1.2.2</version>
<configuration>
<app>target/${project.build.finalName}</app>
<port>9090</port>
<contextRoot>${project.artifactId}</contextRoot>
</configuration>
<dependencies>
<dependency>
<groupId>org.glassfish.main.common</groupId>
<artifactId>simple-glassfish-api</artifactId>
<version>${glassfish.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.main.extras</groupId>
<artifactId>glassfish-embedded-all</artifactId>
<version>${glassfish.version}</version>
</dependency>
</dependencies>
</plugin>
With this setup, you can run the following command to package the application as war and deploy it in GlassFish:
$ mvn package embedded-glassfish:run
To shut down the server, type X and ENTER.
- 全屋互聯:智能家居系統開發指南
- Linux網絡管理與配置(第2版)
- Windows Server 2019 Cookbook
- Linux系統文件安全實戰全攻略
- VMware Horizon View 6 Desktop Virtualization Cookbook
- Ubuntu Linux操作系統
- Ganglia系統監控
- 云原生落地:產品、架構與商業模式
- 統信UOS應用開發進階教程
- Java EE 8 High Performance
- openEuler操作系統核心技術與行業應用實踐
- 完美應用Ubuntu(第4版)
- 鴻蒙HarmonyOS應用開發從入門到精通
- 微軟360度
- Microsoft Azure Administrator:Exam Guide AZ-103