MAVEN专题

一、maven中的依赖

1.除了坐标元素外,还有以下元素

type: 类型jar war

scope: 依赖范围    compile编译、测试、运行(默认)  test(测试)   provided(编译、测试)  runtime(测试、运行)system  import

optional:依赖是否可选 true 依赖此项目的项目不会依赖声明为true的项目

exclutions:排除依赖

 

2.依赖原则

最短路径和第一声明优先

 

3.排除依赖<exclutions>

    <exclution>

        <groupId>...

        <artifactId>...

    </exclution>

</exclutions>

 

4.归类依赖

<properties>

    <xxx.verion></xxx.version>

</properties>

 

5.优化依赖

mvn dependency:list

mvn dependency:tree

mvn dependence:analyze

 

 

二、仓库

1.本地仓库

~/.m2/repository

在settings.xml中重新配置

 

2.中央仓库

3.私服

 

4.配置远程仓库<repostiries>

    <repository>

         <id>

         <name>

         <url>

         <release>true

         <snapshots>false

         <layout>default

 

5.认证

<servers>

    <server>

        <id>

        <username>

        <password>

 

6.部署至远程仓库

<distributionManagement>

    <repository>

        <id>

        <name>

        <url>

    <snapshotRepository>

         <id>

        <name>

        <url>

 

三、聚合和继承

1.聚合

<package>pom</package>

<modules>

    <module></module>

</modules>

2.继承

可继承的pom

groupId  version  decription  organization  inceptionYear  url  developers  distributionManagement  issueManagement  ciManagement  scm  properties  dependencies dependencyManagement  repositories

build  reporting

3.裁剪反应堆

mvn clean install -pl | -am | -amd | -rf

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值