1. 打开Maven Projects窗口
依次点击 View -> Tool Windows -> Maven Projects:
在Lifecycle -> package上右键,点击Run Maven Build
Build Success
后在target文件夹下会生成一个jar包,将之上传至服务器即可部署。
注:
如果在Run Maven Build阶段出现Build Failure,往往是由于ClassNotFoundException: javax.xml.bind.JAXBException
引起,可以在pom.xml中添加如下依赖解决:
<!-- Java 6 = JAX-B Version 2.0 --> <!-- Java 7 = JAX-B Version 2.2.3 --> <!-- Java 8 = JAX-B Version 2.2.8 --> <dependencies> <dependency> <groupId>javax.xml.bind</groupId> <artifactId>jaxb-api</artifactId> <version>2.3.0</version> </dependency> <dependency> <groupId>com.sun.xml.bind</groupId> <artifactId>jaxb-impl</artifactId> <version>2.3.0</version> </dependency> <dependency> <groupId>com.sun.xml.bind</groupId> <artifactId>jaxb-core</artifactId> <version>2.3.0</version> </dependency> <dependency> <groupId>javax.activation</groupId> <artifactId>activation</artifactId> <version>1.1.1</version> </dependency> </dependencies>
如有谬误或不完善之处,恳请斧正。