<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 构建时,我没有收到任何有关此插件的错误或信息。
谁能帮我?
你的插件在里面<pluginManagement>
标签,尝试删除这些标签。
From Maven 文档 https://maven.apache.org/pom.html:
插件管理:是一个与插件一起出现的元素。
插件管理以大致相同的方式包含插件元素,
除了为此配置插件信息之外
特定项目构建,旨在配置项目构建
继承自此。但是,这仅配置以下插件
实际上是在子元素或插件元素中引用的
在当前的 POM 中。孩子们有一切权利推翻
插件管理定义。
所以这意味着我认为你的插件只是被传递给你的(不存在的)孩子,而不是真正被使用。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)