简体   繁体   English

部署Java Maven应用程序

[英]Deploy Java Maven application

I'm doing the deploy to a local tomcat server from a spring boot rest project using maven with sub modules. 我正在使用带有子模块的Maven从Spring Boot Rest项目部署到本地tomcat服务器。 Using the command mvn tomcat7: deploy , deploy occurred successfully, however when accessing the local server and trying to access the project I get a 404 error code. 使用命令mvn tomcat7:deploy ,部署成功完成,但是在访问本地服务器并尝试访问项目时,出现404错误代码。

My Architecture is: 我的架构是:

/ radarveicular-application /雷达应用

/ service <- packaging war /服务<-包装大战

/ api <- packaging war / api <-包装大战

/ dao <- packaging war / dao <-包装大战

pom.xml <- packaging pom in the parent pom.xml <-在父级中包装pom

And the result of deploy was: 部署的结果是: 在此处输入图片说明

In the libs folder are all submodules compressed in .jar file, as well as the dependencies of the project 在libs文件夹中,所有子模块都压缩为.jar文件,以及项目的依赖项

I've written code in java for years, but I've never done any deploy before... Is it missing setting up something for the project to work? 我已经用Java编写了多年代码,但之前从未进行过任何部署...是否缺少为项目工作设置某些东西? or was the deploy done wrong? 还是部署做错了?

How about just running it as it already has a built-in webserver. 如何运行它,因为它已经具有内置的Web服务器。

Run the following from your project root: mvn spring-boot:run 从项目根目录运行以下命令: mvn spring-boot:run

Source: https://docs.spring.io/spring-boot/docs/current/reference/html/using-boot-running-your-application.html 来源: https : //docs.spring.io/spring-boot/docs/current/reference/html/using-boot-running-your-application.html


You can also deploy as a war if you like: https://www.mkyong.com/spring-boot/spring-boot-deploy-war-file-to-tomcat/ 如果您愿意,也可以部署为战争: https : //www.mkyong.com/spring-boot/spring-boot-deploy-war-file-to-tomcat/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM