[英]Deploy a Maven project with a generated webapp folder to Apache Tomcat
I am trying to build/deploy/run this maven/apache tomcat project LODE . 我正在尝试构建/部署/运行这个maven / apache tomcat项目LODE 。
It's quite the first time I see this style of java web applications. 这是我第一次看到这种风格的Java Web应用程序。 I Followed the instructions provided on the website of this project.
我按照本项目网站上提供的说明进行操作。 Started with maven clean install .
开始使用maven clean install 。 Then an src folder was generated with a java folder (containing java classes) and a webapp folder (containing web resources) See the photo.
然后生成一个src文件夹,其中包含一个java文件夹(包含java类)和一个webapp文件夹(包含Web资源)。请参阅照片。
I am used to having a structure where a WebContent folder is there and a WAR file can generated. 我习惯于拥有一个WebContent文件夹所在的结构,并且可以生成WAR文件。
How to deploy this project into apache tomcat and get it to run? 如何将这个项目部署到apache tomcat并让它运行?
Here is what I tried: 这是我尝试过的:
LODE's README clearly says how to lunch the application. LODE的README清楚地说明了如何在应用程序中共进午餐。 Well you don't see a war thus can't deploy on tomcat server.
好吧,你没有看到战争,因此无法在tomcat服务器上部署。
I found two ways to make it work: 我发现了两种方法可以使它工作:
mvn clean jetty:run
from the terminal. mvn clean jetty:run
从终端mvn clean jetty:run
。 This will just work fine (runs on the jetty server). 这将正常工作(在jetty服务器上运行)。
For tomcat server, add <packaging>war</packaging>
in the pom.xml to generate the war. 对于tomcat服务器,在pom.xml中添加
<packaging>war</packaging>
以生成war。 Then either rename the generated war manually (for example, LODE-1.3-SNAPSHOT.war to lode.war) or use maven plugins to generate the war name. 然后手动重命名生成的war(例如,LODE-1.3-SNAPSHOT.war为lode.war)或使用maven插件生成war名称。 Now deploy this war to your tomcat server as usual.
现在像往常一样将此战争部署到您的tomcat服务器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.