maven---超級(jí)pom

<?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上的版本
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末滞欠,一起剝皮案震驚了整個(gè)濱河市古胆,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌筛璧,老刑警劉巖逸绎,帶你破解...
    沈念sama閱讀 211,042評(píng)論 6 490
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異夭谤,居然都是意外死亡棺牧,警方通過(guò)查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 89,996評(píng)論 2 384
  • 文/潘曉璐 我一進(jìn)店門(mén)朗儒,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)颊乘,“玉大人参淹,你說(shuō)我怎么就攤上這事》η模” “怎么了浙值?”我有些...
    開(kāi)封第一講書(shū)人閱讀 156,674評(píng)論 0 345
  • 文/不壞的土叔 我叫張陵,是天一觀的道長(zhǎng)檩小。 經(jīng)常有香客問(wèn)我开呐,道長(zhǎng),這世上最難降的妖魔是什么规求? 我笑而不...
    開(kāi)封第一講書(shū)人閱讀 56,340評(píng)論 1 283
  • 正文 為了忘掉前任筐付,我火速辦了婚禮,結(jié)果婚禮上阻肿,老公的妹妹穿的比我還像新娘瓦戚。我一直安慰自己,他們只是感情好丛塌,可當(dāng)我...
    茶點(diǎn)故事閱讀 65,404評(píng)論 5 384
  • 文/花漫 我一把揭開(kāi)白布较解。 她就那樣靜靜地躺著,像睡著了一般赴邻。 火紅的嫁衣襯著肌膚如雪哨坪。 梳的紋絲不亂的頭發(fā)上,一...
    開(kāi)封第一講書(shū)人閱讀 49,749評(píng)論 1 289
  • 那天乍楚,我揣著相機(jī)與錄音,去河邊找鬼届慈。 笑死徒溪,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的金顿。 我是一名探鬼主播臊泌,決...
    沈念sama閱讀 38,902評(píng)論 3 405
  • 文/蒼蘭香墨 我猛地睜開(kāi)眼,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼揍拆!你這毒婦竟也來(lái)了渠概?” 一聲冷哼從身側(cè)響起,我...
    開(kāi)封第一講書(shū)人閱讀 37,662評(píng)論 0 266
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤嫂拴,失蹤者是張志新(化名)和其女友劉穎播揪,沒(méi)想到半個(gè)月后,有當(dāng)?shù)厝嗽跇?shù)林里發(fā)現(xiàn)了一具尸體筒狠,經(jīng)...
    沈念sama閱讀 44,110評(píng)論 1 303
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡猪狈,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 36,451評(píng)論 2 325
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了辩恼。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片雇庙。...
    茶點(diǎn)故事閱讀 38,577評(píng)論 1 340
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡谓形,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出疆前,到底是詐尸還是另有隱情寒跳,我是刑警寧澤,帶...
    沈念sama閱讀 34,258評(píng)論 4 328
  • 正文 年R本政府宣布竹椒,位于F島的核電站童太,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏碾牌。R本人自食惡果不足惜康愤,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 39,848評(píng)論 3 312
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望舶吗。 院中可真熱鬧征冷,春花似錦、人聲如沸誓琼。這莊子的主人今日做“春日...
    開(kāi)封第一講書(shū)人閱讀 30,726評(píng)論 0 21
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)腹侣。三九已至叔收,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間傲隶,已是汗流浹背饺律。 一陣腳步聲響...
    開(kāi)封第一講書(shū)人閱讀 31,952評(píng)論 1 264
  • 我被黑心中介騙來(lái)泰國(guó)打工, 沒(méi)想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留跺株,地道東北人复濒。 一個(gè)月前我還...
    沈念sama閱讀 46,271評(píng)論 2 360
  • 正文 我出身青樓,卻偏偏與公主長(zhǎng)得像乒省,于是被迫代替她去往敵國(guó)和親巧颈。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 43,452評(píng)論 2 348

推薦閱讀更多精彩內(nèi)容

  • |-1-更新內(nèi)容[6.從倉(cāng)庫(kù)解析依賴(lài)的機(jī)制(重要)] 1Maven倉(cāng)庫(kù)作用 倉(cāng)庫(kù)用來(lái)存儲(chǔ)所有項(xiàng)目使用到構(gòu)件袖扛,在ma...
    zlcook閱讀 6,032評(píng)論 0 25
  • Spring Cloud為開(kāi)發(fā)人員提供了快速構(gòu)建分布式系統(tǒng)中一些常見(jiàn)模式的工具(例如配置管理砸泛,服務(wù)發(fā)現(xiàn),斷路器蛆封,智...
    卡卡羅2017閱讀 134,628評(píng)論 18 139
  • 首先私服是一種衍生出來(lái)的特殊的Maven遠(yuǎn)程倉(cāng)庫(kù)唇礁,構(gòu)建私服的好處請(qǐng)看3.5私服 可以幫助大家建立私服的倉(cāng)庫(kù)管理軟件...
    zlcook閱讀 10,535評(píng)論 0 32
  • Spring Boot 參考指南 介紹 轉(zhuǎn)載自:https://www.gitbook.com/book/qbgb...
    毛宇鵬閱讀 46,773評(píng)論 6 342
  • 所有項(xiàng)目的構(gòu)建都是有生命周期的,這個(gè)生命周期包括:項(xiàng)目清理娶吞、初始化垒迂、編譯、測(cè)試妒蛇、打包机断、集成測(cè)試楷拳、驗(yàn)證、部署吏奸、站點(diǎn)生...
    zlcook閱讀 2,761評(píng)論 0 21