简体   繁体   English

使用Maven服务JHipster和Web App

[英]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. 您好,我像api服务器一样使用JHipster,我有2个文件夹(admin和client),我需要同时提供这些路径和jhipster应用程序。

I can build JHipster following command: 我可以按照以下命令构建JHipster:

mvn -Pdev

Is need to install tomcat server as external or use maven tomcat plugin for this. 需要将tomcat服务器安装为外部服务器或为此使用maven tomcat插件。 How can I configure paths for multiple serving with maven ? 如何使用Maven配置多个服务的路径?

Because I must use same port for web app. 因为我必须为Web应用程序使用相同的端口。 with jhsiptser app. 与jhsiptser应用。

Informations: 资讯:

mvn --version mvn --version

Apache Maven 3.3.9 Apache Maven 3.3.9

Maven home: /usr/share/maven Maven主页:/ usr / share / maven

Java version: 1.8.0_144, vendor: Oracle Corporation Java版本:1.8.0_144,供应商:Oracle Corporation

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

Default locale: en_US, platform encoding: UTF-8 默认语言环境:en_US,平台编码:UTF-8

OS name: "linux", version: "4.4.0-93-generic", arch: "amd64", family: "unix" 操作系统名称:“ linux”,版本:“ 4.4.0-93-generic”,拱门:“ amd64”,家族:“ unix”

Thanks in advance 提前致谢

My IDE/Editor : VSCode 我的IDE /编辑器: VSCode

OS: Ubuntu 16.04 操作系统: Ubuntu 16.04

I compiled JHipster project via skipping tests and dev profile My project path is: /home/Projects/new 我通过跳过测试和开发人员资料来编译JHipster项目。我的项目路径是: /home/Projects/new

Use this command in terminal mvn -Pdev package -Dmaven.test.skip=true 在终端mvn -Pdev package -Dmaven.test.skip=true使用此命令

In: 在:

$ /home/Projects/new/java$ mvn -Pdev package -Dmaven.test.skip=true $ / home / Projects / new / java $ mvn -Pdev软件包-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. .WAR文件和ROOT文件夹将在java/target/目录中创建。

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. 我们的spring-boot(jhipster)应用程序是微服务应用程序,仅通过GET / POST方法提供API访问。 So I need deploy admin & client webapps same time. 因此,我需要同时部署admin和客户端webapp。

I followed the instructions in DigitalOcean and I installed Tomcat Server to my pc. 我按照DigitalOcean中的说明进行操作,并将Tomcat Server安装到我的电脑上。 https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-8-on-ubuntu-16-04 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. 在OrientDB上也是如此,项目同时使用了Orientdb和mariadb数据库。 https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-orientdb-on-ubuntu-16-04 https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-orientdb-on-ubuntu-16-04

Now running Apache, Tomcat, OrientDB 现在运行Apache,Tomcat,OrientDB

在此处输入图片说明

And I've two folders ( client, admin ) as webapp, using Angular JS and access to jhispter(maven) app. 我有两个文件夹(client,admin)作为webapp,使用Angular JS并可以访问jhispter(maven)应用程序。 I should deploy these same time with tomcat server. 我应该同时使用tomcat服务器部署这些。

Deploy: 部署:

  1. Package the project in VSCode or anywhere ( I wrote the code top of message ) 将项目打包到VSCode或任何地方(我在message的代码顶部写下了代码)

  2. Copy ROOT folder to /opt/tomcat/webapps/ 将ROOT文件夹复制到/ opt / tomcat / webapps /

  3. Copy admin and client folder to /opt/tomcat/webapps/ 将管理员和客户端文件夹复制到/ opt / tomcat / webapps /

As a result, you'll see : 结果,您将看到:

  • admin/ 管理员/
  • client/ 客户/
  • ROOT/ 根/

Then, restart tomcat server.. 然后,重新启动tomcat服务器。

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

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