hello-friend 2017-08-15 09:11 采纳率: 100%
浏览 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 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程
  • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
  • ¥15 关于smbclient 库的使用