Skip to Content
Java持续交付
book

Java持续交付

by Daniel Bryant, Abraham Marín-Pérez
November 2019
Beginner to intermediate
406 pages
9h 21m
Chinese
Publishing House of Electronics Industry
Content preview from Java持续交付
120
7
打包应用程序
Maven WAR
插件具有高度的可配置性。它使用嵌入式应用服务器插件
Jetty
http://bit.
ly/2IhEoLa
),可以轻松地包含和排除指定的
Java
类文件(或者其他文件)、创建瘦
WAR
文件(
http://bit.ly/2NGZybQ
),或者快速启动构建的
WAR
文件进行测试(
http://bit.
ly/2NICvgD
)。
避免
JAR
(和
WAR
)地狱
之前我们讨论过,如何使用
mvn dependency:tree
命令来查看项目中的依赖关系。
当我们在构建一个
WAR
文件,并将其部署到
GlassFish
WildFly
等应用程序服务
器的时候,服务器本身可能会将其他
JAR
文件加载到类路径中,从而与构件中所
含的依赖项发生冲突。
在这种情况下,即使应用程序无法启动,你还可以借助一个工具
JHades
http://
jhades.github.io/
),帮助你解决类路径的冲突问题。
在云平台上打包
当我们将
Java
应用程序部署到云平台时,可以先将构件打包在
OS
中,或者打包成
VM
原生构件,因为这样可以指定更细粒度的配置和部署指令,以及加入其他元数据。例
如,通过构建一个
Red Hat RPM Package Manager
文件(
RPM
文件)或者一个
Debian
Software Package
文件(
DEB
文件),你可以指定胖
JAR
在文件系统中的部署位置、创
建一个运行它的用户,以及指定安装配置。这为自动化安装提供了更大的空间,有助于
开发人员和运维人员之间的协作,同时可以收集所需的安装说明和过程信息。 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Python机器学习案例精解

Python机器学习案例精解

Posts & Telecom Press, Yuxi (Hayden) Liu
Java性能优化实践:JVM调优策略、工具与技巧

Java性能优化实践:JVM调优策略、工具与技巧

Benjamin J. Evans, James Gough, Chris Newland
Python和NLTK实现自然语言处理

Python和NLTK实现自然语言处理

Posts & Telecom Press, Nitin Hardeniya
C++语言导学(原书第2版)

C++语言导学(原书第2版)

本贾尼 斯特劳斯特鲁普

Publisher Resources

ISBN: 9787121374425