- Hands-On Cloud Development with WildFly
- Tomasz Adamski
- 160字
- 2021-08-27 19:38:48
Using thin JARs
You will be able to create a thin JAR. A thin JAR does not contain its Maven dependencies and loads them during application startup from a local or remote Maven repository.
Let's take a look at an example:
(...)
<build>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>${version.war.plugin}</version>
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
</configuration>
</plugin>
<plugin>
<groupId>org.wildfly.swarm</groupId>
<artifactId>wildfly-swarm-plugin</artifactId>
<version>${version.wildfly.swarm}</version>
<!-- 1 -->
<configuration>
<bundleDependencies>false</bundleDependencies>
</configuration>
<executions>
<execution>
<goals>
<goal>package</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
(...)
When we build the application and look at the target directory, we get the following result:

Note that in the preceding scenario, all the JARs are very small with the runnable JAR of 744 KB.
You also have the possibility to mix thin JARs with hollow JARs. The runnable JAR does not contain the application that has to be deployed on it, so it has to be run in the same way as in the preceding example:
java jar catalog-1.0-hollow-swarm.jar catalog-1.0.war
Both the server and the deployment do not contain bundled dependencies, so they have to be loaded from the Maven repository using the application deployment.
- 物聯網標準化指南
- 網絡云百問百答
- 從區塊鏈到Web3:構建未來互聯網生態
- 數字烏托邦
- Hands-On Chatbots and Conversational UI Development
- TCP/IP入門經典(第5版)
- 物聯網信息安全
- 物聯網概論(第2版)
- Hands-On Full Stack Development with Spring Boot 2 and React(Second Edition)
- SD-WAN架構與技術(第2版)
- 物聯網時代
- Microsoft Dynamics CRM 2011 Applications(MB2-868) Certification Guide
- Mastering Dart
- 大型企業微服務架構實踐與運營
- 精通SEO:100%網站流量提升密碼