Maven 超级POM

来源:互联网 发布:java后端开发技术 编辑:程序博客网 时间:2024/06/04 20:51

对Maven3来说,该文件的位置在Maven安装目录下lib/maven-model-builder-x.x.x.jar中的org/apache/maven/model/pom-4.0.0.xml
(注:这也解释了为什么在项目的POM中如此设置<modelVersion>4.0.0</modelVersion>

<?xml version="1.0" encoding="UTF-8"?><!--Licensed to the Apache Software Foundation (ASF) under oneor more contributor license agreements.  See the NOTICE filedistributed with this work for additional informationregarding copyright ownership.  The ASF licenses this fileto you under the Apache License, Version 2.0 (the"License"); you may not use this file except in compliancewith the License.  You may obtain a copy of the License at    http://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing,software distributed under the License is distributed on an"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANYKIND, either express or implied.  See the License for thespecific language governing permissions and limitationsunder the License.--><!-- START SNIPPET: superpom --><project>  <modelVersion>4.0.0</modelVersion>  <repositories>    <repository><!--依赖中央仓库-->      <id>central</id>      <name>Central Repository</name>      <url>https://repo.maven.apache.org/maven2</url>      <layout>default</layout><!--仓库布局:默认-->      <snapshots>        <enabled>false</enabled><!--下载快照版本:关闭-->      </snapshots>    </repository>  </repositories>  <pluginRepositories><!--插件的中央仓库-->    <pluginRepository>      <id>central</id>      <name>Central Repository</name>      <url>https://repo.maven.apache.org/maven2</url>      <layout>default</layout>      <snapshots>        <enabled>false</enabled>      </snapshots>      <releases>        <updatePolicy>never</updatePolicy>      </releases>    </pluginRepository>  </pluginRepositories>  <build>      <!--项目的主输出目录-->    <directory>${project.basedir}/target</directory>     <!--主代码输出目录--><outputDirectory>${project.build.directory}/classes</outputDirectory>      <!--最终构件的名称的格式-->    <finalName>${project.artifactId}-${project.version}</finalName>     <!--测试代码输出目录-->    <testOutputDirectory>${project.build.directory}/test-classes</testOutputDirectory>     <!--项目的主源码目录--><sourceDirectory>${project.basedir}/src/main/java</sourceDirectory>     <!--脚本源码目录--><scriptSourceDirectory>${project.basedir}/src/main/scripts</scriptSourceDirectory>     <!--测试源码目录--><testSourceDirectory>${project.basedir}/src/test/java</testSourceDirectory>      <!--主资源目录和测试资源目录-->    <resources>      <resource>        <directory>${project.basedir}/src/main/resources</directory>      </resource>    </resources>    <testResources>      <testResource>        <directory>${project.basedir}/src/test/resources</directory>      </testResource>    </testResources>    <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>  </build>  <reporting>    <outputDirectory>${project.build.directory}/site</outputDirectory>  </reporting>  <profiles>    <!-- NOTE: The release profile will be removed from future versions of the super POM -->    <profile>      <id>release-profile</id>      <activation>        <property>          <name>performRelease</name>          <value>true</value>        </property>      </activation>      <build>        <plugins>          <plugin>            <inherited>true</inherited>            <artifactId>maven-source-plugin</artifactId>            <executions>              <execution>                <id>attach-sources</id>                <goals>                  <goal>jar</goal>                </goals>              </execution>            </executions>          </plugin>          <plugin>            <inherited>true</inherited>            <artifactId>maven-javadoc-plugin</artifactId>            <executions>              <execution>                <id>attach-javadocs</id>                <goals>                  <goal>jar</goal>                </goals>              </execution>            </executions>          </plugin>          <plugin>            <inherited>true</inherited>            <artifactId>maven-deploy-plugin</artifactId>            <configuration>              <updateReleaseInfo>true</updateReleaseInfo>            </configuration>          </plugin>        </plugins>      </build>    </profile>  </profiles></project><!-- END SNIPPET: superpom -->

摘自《Maven实战》

0 0
原创粉丝点击