在我的pom.xml中,这是我的前端maven-plugin配置的外观。 我的package.json和gulpfiles位于项目根目录中。Maven在目标目录中安装节点模块
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<!-- Use the latest released version: https://repo1.maven.org/maven2/com/github/eirslett/frontend-maven-plugin/ -->
<version>1.6</version>
<executions>
<execution>
<!-- optional: you don't really need execution ids, but it looks nice
in your build log. -->
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<!-- optional: default phase is "generate-resources" -->
<phase>generate-resources</phase>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<!-- optional: default phase is "generate-resources" -->
<phase>generate-resources</phase>
<configuration>
<!-- optional: The default argument is actually "install", so unless
you need to run some other npm command, you can remove this whole <configuration>
section. -->
<arguments>install ./target/node_modules</arguments>
</configuration>
</execution>
<execution>
<id>gulp</id>
<goals>
<goal>gulp</goal>
</goals>
<configuration>
<arguments>replace-runner-start</arguments>
</configuration>
</execution>
<execution>
<id>javascript tests</id>
<goals>
<goal>karma</goal>
</goals>
<!-- optional: the default plase is "test". Some developers choose
to run karma in the "integration-test" phase. -->
<phase>test</phase>
<configuration>
<!-- optional: the default is "karma.conf.js" in your working directory -->
<karmaConfPath>src/main/karma_webapp_all_conf.js</karmaConfPath>
</configuration>
</execution>
</executions>
<configuration>
<!-- <workingDirectory>src/main</workingDirectory> -->
<installDirectory>target</installDirectory>
<nodeVersion>v6.11.3</nodeVersion>
</configuration>
</plugin>
当我运行mvn干净安装像这样我得到节点安装在目标中,但无法安装node_modules,因为该文件夹不存在。有没有另一种插件来制作目录并在那里安装node_modules。