我正在从事多 Maven 项目,该项目分为以下模块:
- 休息层
- 服务层
- 存储层
我想添加另一个名为视图层的模块,即应用程序的 ui。唯一的问题是 ui 是有角度的,我需要以某种方式将 angular 应用程序集成到这个项目的 maven 模块中。
我创建了一个名为 view layer 的新 maven 模块。在视图层的 maven 模块 pom 中添加了以下插件,如下所示:
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.3</version>
<configuration>
<nodeVersion>v8.11.3</nodeVersion>
<npmVersion>6.3.0</npmVersion>
<workingDirectory>src/main/web/</workingDirectory>
</configuration>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
</execution>
<execution>
<id>npm run build</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run build</arguments>
</configuration>
</execution>
<execution>
<id>prod</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run-script build</arguments>
</configuration>
<phase>generate-resources</phase>
</execution>
</executions>
</plugin>
并在视图模块的 src/main/web 目录中生成了一个带有角度 cli 的角度应用程序。不幸的是,构建失败了,它没有找到 package.json。
我将不胜感激。
问候,达斯·巴托。