pom.xml結構說明

什么是POM
項目對象模型或POM是Maven中的基本工作單元箫津。這是一個XML文件婿崭,其中包含有關項目的信息以及Maven用于構建項目的配置詳細信息。它包含大多數(shù)項目的默認值躺枕。比如構建目錄服猪,即target;?源目錄,即src/main/java拐云;測試源目錄罢猪,即src/test/java;等等叉瘩。當執(zhí)行任務或目標時膳帕,Maven在當前目錄中查找POM。它讀取POM薇缅,獲取所需的配置信息危彩,然后執(zhí)行目標。
可以在POM中指定的一些配置是項目依賴項捅暴,可以執(zhí)行的插件或目標恬砂,構建配置文件等等。也可以指定其他信息蓬痒,例如項目版本泻骤,描述,開發(fā)人員梧奢,郵件列表等狱掂。
Super POM
Super POM是Maven的默認POM。除非明確設置亲轨,否則所有POM都會擴展Super POM趋惨,這意味著Super POM中指定的配置將由您為項目創(chuàng)建的POM繼承。您可以在Maven Core參考文檔中看到適用于Maven 3.6.3Super POM惦蚊。

sdfsd<br>fsdfsdfsdfsdfsdfssfsdfsdfsd

<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.5.3</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-no-fork</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>

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
  • 序言:七十年代末器虾,一起剝皮案震驚了整個濱河市讯嫂,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌兆沙,老刑警劉巖欧芽,帶你破解...
    沈念sama閱讀 219,110評論 6 508
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場離奇詭異葛圃,居然都是意外死亡千扔,警方通過查閱死者的電腦和手機,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,443評論 3 395
  • 文/潘曉璐 我一進店門库正,熙熙樓的掌柜王于貴愁眉苦臉地迎上來曲楚,“玉大人,你說我怎么就攤上這事褥符×埽” “怎么了?”我有些...
    開封第一講書人閱讀 165,474評論 0 356
  • 文/不壞的土叔 我叫張陵属瓣,是天一觀的道長载迄。 經常有香客問我,道長抡蛙,這世上最難降的妖魔是什么护昧? 我笑而不...
    開封第一講書人閱讀 58,881評論 1 295
  • 正文 為了忘掉前任,我火速辦了婚禮粗截,結果婚禮上惋耙,老公的妹妹穿的比我還像新娘。我一直安慰自己熊昌,他們只是感情好绽榛,可當我...
    茶點故事閱讀 67,902評論 6 392
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著婿屹,像睡著了一般灭美。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上昂利,一...
    開封第一講書人閱讀 51,698評論 1 305
  • 那天森缠,我揣著相機與錄音培他,去河邊找鬼晾腔。 笑死嚷节,一個胖子當著我的面吹牛,可吹牛的內容都是我干的扩所。 我是一名探鬼主播围详,決...
    沈念sama閱讀 40,418評論 3 419
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼祖屏!你這毒婦竟也來了助赞?” 一聲冷哼從身側響起买羞,我...
    開封第一講書人閱讀 39,332評論 0 276
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎嫉拐,沒想到半個月后哩都,有當?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體,經...
    沈念sama閱讀 45,796評論 1 316
  • 正文 獨居荒郊野嶺守林人離奇死亡婉徘,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內容為張勛視角 年9月15日...
    茶點故事閱讀 37,968評論 3 337
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發(fā)現(xiàn)自己被綠了咐汞。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片盖呼。...
    茶點故事閱讀 40,110評論 1 351
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖化撕,靈堂內的尸體忽然破棺而出几晤,到底是詐尸還是另有隱情,我是刑警寧澤植阴,帶...
    沈念sama閱讀 35,792評論 5 346
  • 正文 年R本政府宣布蟹瘾,位于F島的核電站,受9級特大地震影響掠手,放射性物質發(fā)生泄漏憾朴。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點故事閱讀 41,455評論 3 331
  • 文/蒙蒙 一喷鸽、第九天 我趴在偏房一處隱蔽的房頂上張望众雷。 院中可真熱鬧,春花似錦做祝、人聲如沸砾省。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,003評論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽编兄。三九已至,卻和暖如春声登,著一層夾襖步出監(jiān)牢的瞬間狠鸳,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 33,130評論 1 272
  • 我被黑心中介騙來泰國打工捌刮, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留碰煌,地道東北人。 一個月前我還...
    沈念sama閱讀 48,348評論 3 373
  • 正文 我出身青樓绅作,卻偏偏與公主長得像芦圾,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子俄认,可洞房花燭夜當晚...
    茶點故事閱讀 45,047評論 2 355