hello-friend 2017-08-15 09:11 采纳率: 40%
浏览 792
已结题

maven3 2个问题求解答 网上搜不到

  1. maven的内置插件是在哪里定义的 有哪些内置插件 看了源码里的主pom,只有以下插件
 - <pluginManagement>
- <!--  NOTE: These plugins will be removed from future versions of the super POM 
  --> 
- <!--  They are kept for the moment as they are very unlikely to conflict with lifecycle mappings (MNG-4453) 
  --> 
- <plugins>
- <plugin>
  <artifactId>maven-antrun-plugin</artifactId> 
  <version>1.3</version> 
  </plugin>
- <plugin>
  <artifactId>maven-assembly-plugin</artifactId> 
  <version>2.2-beta-5</version> 
  </plugin>
- <plugin>
  <artifactId>maven-dependency-plugin</artifactId> 
  <version>2.8</version> 
  </plugin>
- <plugin>
  <artifactId>maven-release-plugin</artifactId> 
  <version>2.3.2</version> 
  </plugin>
  </plugins>
  </pluginManagement>

2、我在我自己的父pom里声明了插件

 <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>2.3.2</version>
                    <configuration>
                        <source>1.6</source>
                        <target>1.6</target>
                        <encoding>UTF-8</encoding>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>2.5</version>
                    <configuration>
                        <useDefaultDelimiters>false</useDefaultDelimiters>
                        <delimiters>
                            <delimiter>$[*]</delimiter>
                        </delimiters>
                        <encoding>UTF-8</encoding>
                    </configuration>
                </plugin>
                <plugin>
                    <groupId>org.owasp</groupId>
                    <artifactId>dependency-check-maven</artifactId>
                    <executions>
                        <execution>
                            <goals>
                                <goal>check</goal>
                            </goals>
                        </execution>
                    </executions>
                    <configuration>
                        <format>xml</format>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement> 

但我在其他子模块中并没有用这些插件,但是这些插件还是起作用了,为什么?

  • 写回答

1条回答 默认 最新

  • JPF1024 2017-08-15 15:59
    关注

    1.
    里面有super pom,参考:

    http://maven.apache.org/guides/introduction/introduction-to-the-pom.html

    2.

    http://maven.apache.org/plugins/index.html
    大意是:在build标签里面的都会运行.

     Build plugins will be executed during the build and they should be configured in the <build/> element from the POM.
    
    评论

报告相同问题?

悬赏问题

  • ¥15 用visual studi code完成html页面
  • ¥15 聚类分析或者python进行数据分析
  • ¥15 逻辑谓词和消解原理的运用
  • ¥15 三菱伺服电机按启动按钮有使能但不动作
  • ¥15 js,页面2返回页面1时定位进入的设备
  • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
  • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?