![](/img/trans.png)
[英]How do I properly launch my introductory web application using maven's tomcat plugin?
[英]How can I launch my Angular 5 web application with maven?
1.)我从一个spring boot / maven项目开始。
2.)我在项目中添加了Angular 5文件。
3.)我测试了可以使用node,bower和gulp通过命令行来构建项目。
当前,在我的pom.xml中,我正在导入以下内容:
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>install-node-and-npm</id>
<phase>generate-resources</phase>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v8.9.1</nodeVersion>
<npmVersion>5.5.1</npmVersion>
</configuration>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<!-- Optional configuration which provides for running any npm command -->
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
<execution>
<id>npm run build</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run build</arguments>
</configuration>
</execution>
<execution>
<id>bower install</id>
<goals>
<goal>bower</goal>
</goals>
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
<execution>
<id>gulp build</id>
<phase>generate-resources</phase>
<goals>
<goal>gulp</goal>
</goals>
<configuration>
<environmentVariables>
<NODE_ENV>prod</NODE_ENV>
</environmentVariables>
</configuration>
</execution>
</executions>
</plugin>
-使用“ mvn package install”构建应用程序后,构建成功。 但是我的应用程序没有运行。
问题:如何查看我的申请? 我是否需要配置其他内容或向pom.xml添加其他内容?
在此视频中,我演示了如何在Spring Boot服务器下部署Angular应用程序: https : //youtu.be/k8r76d8QzXs?t=2237 。
每次Angular应用程序更改时,只需重新运行npm run build命令即可在Spring Server下部署新版本的Angular捆绑软件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.