简体   繁体   中英

Serve JHipster & Web App with maven

Hello I use JHipster like an api server and I've 2 folder ( admin & client ) I need to serve these paths and jhipster application same time.

I can build JHipster following command:

mvn -Pdev

Is need to install tomcat server as external or use maven tomcat plugin for this. How can I configure paths for multiple serving with maven ?

Because I must use same port for web app. with jhsiptser app.

Informations:

mvn --version

Apache Maven 3.3.9

Maven home: /usr/share/maven

Java version: 1.8.0_144, vendor: Oracle Corporation

Java home: /usr/lib/jvm/java-8-oracle/jre

Default locale: en_US, platform encoding: UTF-8

OS name: "linux", version: "4.4.0-93-generic", arch: "amd64", family: "unix"

Thanks in advance

My IDE/Editor : VSCode

OS: Ubuntu 16.04

I compiled JHipster project via skipping tests and dev profile My project path is: /home/Projects/new

Use this command in terminal mvn -Pdev package -Dmaven.test.skip=true

In:

$ /home/Projects/new/java$ mvn -Pdev package -Dmaven.test.skip=true

Out:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 56.312 s
[INFO] Finished at: 2017-09-18T12:48:52+03:00
[INFO] Final Memory: 78M/602M
[INFO] ------------------------------------------------------------------------

.WAR files and ROOT folder will be created in java/target/ directory.

java/target/ROOT/
java/target/ROOT.war
java/target/ROOT.war.original

Our spring-boot (jhipster) app is microservice application, only provides API access via GET/POST methods. So I need deploy admin & client webapps same time.

I followed the instructions in DigitalOcean and I installed Tomcat Server to my pc. https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-8-on-ubuntu-16-04

Samething on OrientDB, project is using both orientdb & mariadb databases. https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-orientdb-on-ubuntu-16-04

Now running Apache, Tomcat, OrientDB

在此处输入图片说明

And I've two folders ( client, admin ) as webapp, using Angular JS and access to jhispter(maven) app. I should deploy these same time with tomcat server.

Deploy:

  1. Package the project in VSCode or anywhere ( I wrote the code top of message )

  2. Copy ROOT folder to /opt/tomcat/webapps/

  3. Copy admin and client folder to /opt/tomcat/webapps/

As a result, you'll see :

  • admin/
  • client/
  • ROOT/

Then, restart tomcat server..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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