<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless 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 ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under 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 -->
2.解讀
- 倉(cāng)庫(kù)配置
<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>
表明:依賴(lài)倉(cāng)庫(kù)支持發(fā)布版本依賴(lài)下載,更新策略默認(rèn)為每天檢查一次墙基,不支持快版下載耕魄。
插件倉(cāng)庫(kù)發(fā)布版本依賴(lài)下載,更新策略為從不更新(意味著所有插件都要指定版本號(hào)策肝,并且不會(huì)更新),不支持快照版本下載隐绵。疑問(wèn)之众?
超級(jí)POM中為什么沒(méi)有指定default周期中默認(rèn)插件的版本信息?還是我沒(méi)找到依许?因?yàn)槿绻麤](méi)指定會(huì)正常根據(jù)更新策略解析發(fā)布版本構(gòu)件棺禾,而由上面可知,發(fā)布版本的更新策略為“從不更新”峭跳。
看其中一段,聲明了對(duì)插件maven-antrun-plugin的依賴(lài)
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.3</version>
</plugin>
進(jìn)入本地倉(cāng)庫(kù)查看發(fā)現(xiàn)有兩個(gè)版本1.3和1.8
Paste_Image.png
1.3版本內(nèi)容如下:說(shuō)明處于更新?tīng)顟B(tài)膘婶,還沒(méi)從遠(yuǎn)程倉(cāng)庫(kù)下載到。
maven-antrun-plugin-1.3構(gòu)件處于更新?tīng)顟B(tài)
1.8版本內(nèi)容如下:完整的插件
maven-antrun-plugin-1.8
maven-antrun-plugin-1.3.jar.lastUpdated中內(nèi)容:
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
#Sun Dec 11 16:28:41 CST 2016
http\://172.19.201.155\:8081/repository/maven-public/.lastUpdated=1481444921950
http\://172.19.201.155\:8081/repository/maven-public/.error=
說(shuō)明下載1.3版本失敗蛀醉。通過(guò)地址訪問(wèn)私服也沒(méi)有查看到相應(yīng)構(gòu)件悬襟。
更新構(gòu)件失敗,因?yàn)樵趎exus上沒(méi)找到該構(gòu)件
在nexus私服中搜索也只發(fā)現(xiàn)有1.8版本的插件
maven-antrun-plugin在遠(yuǎn)程倉(cāng)庫(kù)Nexus上的版本