|
@@ -65,7 +65,25 @@
|
|
<artifactId>spring-boot-starter-thymeleaf</artifactId>
|
|
<artifactId>spring-boot-starter-thymeleaf</artifactId>
|
|
</dependency>
|
|
</dependency>
|
|
</dependencies>
|
|
</dependencies>
|
|
|
|
+ <profiles> <!--考虑到window 和linux环境 npm命令格式的问题,使用maven的profile实现动态指定命令-->
|
|
|
|
+ <profile>
|
|
|
|
+ <id>window</id>
|
|
|
|
+ <properties>
|
|
|
|
+ <npm>npm.cmd</npm>
|
|
|
|
+ </properties>
|
|
|
|
|
|
|
|
+ <activation>
|
|
|
|
+ <activeByDefault>true</activeByDefault>
|
|
|
|
+ </activation>
|
|
|
|
+
|
|
|
|
+ </profile>
|
|
|
|
+ <profile>
|
|
|
|
+ <id>linux</id>
|
|
|
|
+ <properties>
|
|
|
|
+ <npm>npm</npm>
|
|
|
|
+ </properties>
|
|
|
|
+ </profile>
|
|
|
|
+ </profiles>
|
|
|
|
|
|
<build>
|
|
<build>
|
|
<finalName>cpp</finalName>
|
|
<finalName>cpp</finalName>
|
|
@@ -79,7 +97,28 @@
|
|
<skipTests>true</skipTests>
|
|
<skipTests>true</skipTests>
|
|
</configuration>
|
|
</configuration>
|
|
</plugin>
|
|
</plugin>
|
|
-
|
|
|
|
|
|
+ <plugin>
|
|
|
|
+ <groupId>org.codehaus.mojo</groupId>
|
|
|
|
+ <artifactId>exec-maven-plugin</artifactId>
|
|
|
|
+ <version>1.6.0</version>
|
|
|
|
+ <executions>
|
|
|
|
+ <execution>
|
|
|
|
+ <id>exec-npm-run-build</id>
|
|
|
|
+ <phase>generate-resources</phase>
|
|
|
|
+ <goals>
|
|
|
|
+ <goal>exec</goal>
|
|
|
|
+ </goals>
|
|
|
|
+ <configuration>
|
|
|
|
+ <executable>${npm}</executable>
|
|
|
|
+ <arguments>
|
|
|
|
+ <argument>run</argument>
|
|
|
|
+ <argument>build:prod</argument>
|
|
|
|
+ </arguments>
|
|
|
|
+ <workingDirectory>${project.parent.basedir}/cpp-ui</workingDirectory>
|
|
|
|
+ </configuration>
|
|
|
|
+ </execution>
|
|
|
|
+ </executions>
|
|
|
|
+ </plugin>
|
|
<!--资源插件,主要为了从前端项目里复制打包好的文件到springboot项目-->
|
|
<!--资源插件,主要为了从前端项目里复制打包好的文件到springboot项目-->
|
|
<plugin>
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<groupId>org.apache.maven.plugins</groupId>
|