zoukankan      html  css  js  c++  java
  • maven的pom.xml文件详细说明

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <!-- 指定了当前pom的版本 -->
        <modelVersion>4.0.0</modelVersion>
    
        <groupId>反写的公司网址+项目名</groupId>
        <artifactId>项目名+模块名</artifactId>
        <!-- 第一个0表示大版本号 
        第二个0表示分支版本号 
        第三个0表示小版本号 0.0.1 
        SNAPSHOT快照 
        alpha内测版本
         bate公测 
            Release稳定 
            GA正式发布 -->
        <version>0.0.1-SNAPSHOT</version>
        <!-- maven项目的打包方式 不指定默认是jar -->
        <packaging>jar</packaging>
    
        <!-- 项目的描述名 -->
        <name>hi</name>
        <!-- 项目的地址 -->
        <url>http://maven.apache.org</url>
        <!-- 项目的描述 -->
        <description></description>
        <!-- 开发人员列表 -->
        <developers></developers>
        <!-- 许可证信息 -->
        <licenses></licenses>
        <!-- 组织信息 -->
        <organization></organization>
    
        <properties>
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        </properties>
        
        <!-- 依赖列表 -->
        <dependencies>
            <dependency>
                <!-- 三大坐标 -->
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.10</version>
                <!-- 依赖范围 -->
                <scope>test</scope>
                <!-- 设置依赖是否可选 
                    默认false 子项目继承
                    若为true 子项目必须显示引用了该依赖
                -->
                <optional></optional>
                <!-- 排除依赖传递列表 -->
                <exclusions>
                    <exclusion></exclusion>
                </exclusions>
            </dependency>
        </dependencies>
        
        <!-- 依赖管理
            并不直接运行引用到实际的依赖中,主要作用定义到父模块中,供子模块继承使用
         -->
        <dependencyManagement>
            <dependencies>
                <dependency></dependency>
            </dependencies>
        </dependencyManagement>
        
        <build>
        <!-- 插件列表 -->
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-source-plugin</artifactId>
                    <version>2.4</version>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>jar-no-fork</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
        
        <!-- 声明继承 -->
        <parent></parent>
        
        <!-- 生命聚合 -->
        <modules>
            <module></module>
        </modules>
    </project>
  • 相关阅读:
    hdu 1199 Color the Ball 离散线段树
    poj 2623 Sequence Median 堆的灵活运用
    hdu 2251 Dungeon Master bfs
    HDU 1166 敌兵布阵 线段树
    UVALive 4426 Blast the Enemy! 计算几何求重心
    UVALive 4425 Another Brick in the Wall 暴力
    UVALive 4423 String LD 暴力
    UVALive 4872 Underground Cables 最小生成树
    UVALive 4870 Roller Coaster 01背包
    UVALive 4869 Profits DP
  • 原文地址:https://www.cnblogs.com/404code/p/10185814.html
Copyright © 2011-2022 走看看