【发布时间】:2017-03-14 19:46:45
【问题描述】:
<build>
<pluginManagement>
<plugins>
<!-- Plugin to execute command "npm install" and "npm run build" inside /angular directory -->
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>0.0.22</version>
<configuration>
<skip>false</skip>
<workingDirectory>${basedir}</workingDirectory>
<installDirectory>${basedir}/temp</installDirectory>
</configuration>
<executions>
<!-- It will install nodejs and npm -->
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<configuration>
<nodeVersion>v6.3.1</nodeVersion>
<npmVersion>3.9.5</npmVersion>
</configuration>
</execution>
<!-- It will execute command "npm install" inside "/angular" directory -->
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<arguments>install</arguments>
</configuration>
</execution>
<execution>
<id>bower install</id>
<goals>
<goal>bower</goal>
</goals>
<phase>generate-sources</phase>
<configuration>
<arguments>
<argument>install</argument>
</arguments>
<workingDirectory>${basedir}</workingDirectory>
</configuration>
</execution>
</executions>
</plugin>
<!-- Plugin to copy the content of /angular/dist/ directory to output directory (ie/ /target/transactionManager-1.0/) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>2.4.2</version>
<executions>
<execution>
<id>default-copy-resources</id>
<phase>process-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<overwrite>true</overwrite>
<outputDirectory>${basedir}/target/classes/static/app/bower_components</outputDirectory>
<resources>
<resource>
<directory>${basedir}/src/main/resources/static/app/bower_components</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</pluginManagement>
</build>
有了这个构建配置,我不知道为什么 maven 看起来完全忽略执行frontend-maven-plugin。
我可以通过命令提示符成功运行bower install,它会下载依赖项。
但我无法使用 Maven 构建来做同样的事情。
我尝试了不同版本的 front-maven-plugin,但无法运行此插件。并且还尝试了其他可能的网络解决方案。
当我进行 maven 构建时,我没有收到有关此插件的任何错误或信息。
谁能帮帮我?
【问题讨论】:
标签: java maven spring-boot npm bower