Maven ignores maven-frontend-plugin, no error(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,没有错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Maven忽略maven-前端-plugin,没有错误
 
				
         
 
            
        基础教程推荐
- 验证是否调用了所有 getter 方法 2022-01-01
- 大摇大摆的枚举 2022-01-01
- 如何在 Spring @Value 注解中正确指定默认值? 2022-01-01
- 如何在 JFrame 中覆盖 windowsClosing 事件 2022-01-01
- 多个组件的复杂布局 2022-01-01
- Java Swing计时器未清除 2022-01-01
- 不推荐使用 Api 注释的描述 2022-01-01
- 从 python 访问 JVM 2022-01-01
- 在 Java 中创建日期的正确方法是什么? 2022-01-01
- Java 实例变量在两个语句中声明和初始化 2022-01-01
 
    	 
    	 
    	 
    	 
    	 
    	 
    	 
    	 
						 
						 
						 
						 
						 
				 
				 
				 
				