我的春天启动的项目结构如下 -Project - src - main - java - resources - webapp - test - frontend - src - static - config - package.json - (after "npm install") node_modules - (after "npm run build") dist
要运行的exec-Maven的插件,当春天开机运行
我想要做的就是
安装项目时,运行“故宫安装”
当“春天启动:运行”运行,运行“故宫运行编译”,并在前面移动内容/ DIST到/主/ web应用
,这里是我的pom.xml
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>exec-npm-install</id>
<phase>generate-sources</phase>
<configuration>
<executable>npm</executable>
<workingDirectory>./frontend</workingDirectory>
<arguments>
<argument>install</argument>
</arguments>
</configuration>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
我不知道我是如何引发的exec-NPM-安装exection 与Eclipse Maven构建,我试图生成来源,弹簧启动:运行,安装并编译,但它没有运行。
,我想知道我应该把什么命令,移动DIST当“春天启动:运行”
您需要将其移出pluginManagement区域。在pluginManagement中,你可以定义版本和参数,但是你需要把它放在pluginManagement之外。 – khmarbaise
谢谢。在Eclipse中,如果没有插件管理,执行会发生错误信息,所以我把它们放在里面。现在,作为您的评论,我删除了pluginManagement并忽略了执行错误。有用! –
你会得到什么样的执行错误? – khmarbaise