Maven忽略maven-前端-plugin,没有错误 [英] Maven ignores maven-frontend-plugin, no error

查看:59
本文介绍了Maven忽略maven-前端-plugin,没有错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<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 Build来做同样的事情。

我尝试了不同版本的Front-maven-plugin,但无法运行此插件。还尝试了其他可能的Web解决方案。

我在进行maven构建时没有收到任何有关此插件的错误或信息。

有人能帮我吗?

推荐答案

您的插件位于<pluginManagement>标记内,请尝试删除这些标记。

发件人Maven Documentation

pluginManagement:是一个可以在插件旁边看到的元素。 插件管理以大致相同的方式包含插件元素, 不同的是,不是为这个配置插件信息 特定的项目生成,它用于配置项目生成 都是从这个继承下来的。但是,这仅配置了以下插件 实际上是在plugins元素中引用的,或者 在当前的POM中。孩子们完全有权推翻 插件管理定义。

这意味着我认为您的插件只是被传递给您(不存在的)孩子,而不是实际使用。

这篇关于Maven忽略maven-前端-plugin,没有错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆