Home maven技巧
Post
Cancel

maven技巧

展示一些maven的使用技巧

依赖相关

展示项目所有依赖

mvn help:effective-pom -Dverbose

该命令会将项目的所有依赖pom文件整合成一个,并且使用了-Dverbose参数,会将每个dependency或者dependencyManagement的原引用给打印出来。

举个栗子

1
2
3
4
5
6
7
8
9
# property
<rsocket.version>1.1.1</rsocket.version>  <!-- org.springframework.boot:spring-boot-dependencies:2.5.4, line 185 -->

# dependency
<dependency>
    <groupId>io.grpc</groupId>  <!-- com.example:bailing-test:0.0.1-SNAPSHOT, line 23 -->
    <artifactId>grpc-netty-shaded</artifactId>  <!-- com.example:bailing-test:0.0.1-SNAPSHOT, line 24 -->
    <version>1.31.1</version>  <!-- com.example:bailing-test:0.0.1-SNAPSHOT, line 25 -->
</dependency>

参数相关

指定settings

mvn -s settings.xml

mvnd

使用mvnd代替mvnmvnd会在后台启动maven的daemon服务,省去了每次启动mvn服务的时间;多线程流水线编译,提高编译速度。

This post is licensed under CC BY 4.0 by the author.

PT plugin plus chrome安装

qnap备忘录