maven超级pom

一、超级pom简介

在maven的发行版本中都会有一个超级pom,超级pom是所有maven项目的父pom,所有项目都继承这个超级pom,在超级pom中配置有:

  1. maven的构件和插件的中央仓库地址;
  2. 项目构建过程中用到的一些默认目录;
  3. 一个自带的profile;

二、超级pom路径

在maven本地仓库的如下位置:
org\apache\maven\maven-model-builder\3.0.4
打开该路径下的如下jar包:
maven-model-builder-3.0.4-sources.jar
在该jar包的如下路径下:
org\apache\maven\model\
可以找到超级pom:
pom-4.0.0.xml

三、超级pom内容





<project> 
  <modelVersion>4.0.0modelVersion>  
  <repositories> 
    <repository> 
      <id>centralid>  
      <name>Central Repositoryname>  
      <url>http://repo.maven.apache.org/maven2url>  
      <layout>defaultlayout>  
      <snapshots> 
        <enabled>falseenabled> 
      snapshots> 
    repository> 
  repositories>  
  <pluginRepositories> 
    <pluginRepository> 
      <id>centralid>  
      <name>Central Repositoryname>  
      <url>http://repo.maven.apache.org/maven2url>  
      <layout>defaultlayout>  
      <snapshots> 
        <enabled>falseenabled> 
      snapshots>  
      <releases> 
        <updatePolicy>neverupdatePolicy> 
      releases> 
    pluginRepository> 
  pluginRepositories>  
  <build> 
    <directory>${project.basedir}/targetdirectory>  
    <outputDirectory>${project.build.directory}/classesoutputDirectory>  
    <finalName>${project.artifactId}-${project.version}finalName>  
    <testOutputDirectory>${project.build.directory}/test-classestestOutputDirectory>  
    <sourceDirectory>${project.basedir}/src/main/javasourceDirectory>  
    <scriptSourceDirectory>src/main/scriptsscriptSourceDirectory>  
    <testSourceDirectory>${project.basedir}/src/test/javatestSourceDirectory>  
    <resources> 
      <resource> 
        <directory>${project.basedir}/src/main/resourcesdirectory> 
      resource> 
    resources>  
    <testResources> 
      <testResource> 
        <directory>${project.basedir}/src/test/resourcesdirectory> 
      testResource> 
    testResources>  
    <pluginManagement> 
        
        
      <plugins> 
        <plugin> 
          <artifactId>maven-antrun-pluginartifactId>  
          <version>1.3version> 
        plugin>  
        <plugin> 
          <artifactId>maven-assembly-pluginartifactId>  
          <version>2.2-beta-5version> 
        plugin>  
        <plugin> 
          <artifactId>maven-dependency-pluginartifactId>  
          <version>2.1version> 
        plugin>  
        <plugin> 
          <artifactId>maven-release-pluginartifactId>  
          <version>2.0version> 
        plugin> 
      plugins> 
    pluginManagement> 
  build>  
  <reporting> 
    <outputDirectory>${project.build.directory}/siteoutputDirectory> 
  reporting>  
  <profiles> 
      
    <profile> 
      <id>release-profileid>  
      <activation> 
        <property> 
          <name>performReleasename>  
          <value>truevalue> 
        property> 
      activation>  
      <build> 
        <plugins> 
          <plugin> 
            <inherited>trueinherited>  
            <artifactId>maven-source-pluginartifactId>  
            <executions> 
              <execution> 
                <id>attach-sourcesid>  
                <goals> 
                  <goal>jargoal> 
                goals> 
              execution> 
            executions> 
          plugin>  
          <plugin> 
            <inherited>trueinherited>  
            <artifactId>maven-javadoc-pluginartifactId>  
            <executions> 
              <execution> 
                <id>attach-javadocsid>  
                <goals> 
                  <goal>jargoal> 
                goals> 
              execution> 
            executions> 
          plugin>  
          <plugin> 
            <inherited>trueinherited>  
            <artifactId>maven-deploy-pluginartifactId>  
            <configuration> 
              <updateReleaseInfo>trueupdateReleaseInfo> 
            configuration> 
          plugin> 
        plugins> 
      build> 
    profile> 
  profiles> 
project>

你可能感兴趣的:(Maven,maven)