maven一些命令
作者:互联网
1. 查看依赖包树
mvn dependency:tree -Dverbose
2. maven通过命令修改版本号
mvn versions:set -DnewVersion=1.0.1.0.0-SNAPSHOT
mvn versions:commit
或者
mvn versions:set -DnewVersion=1.0.1.0.0-SNAPSHOT -DgenerateBackupPoms=false
编译: mvn compile
打包: mvn package
清除缓存文件: mvn clean
安装到本地仓库: mvn install
3 跳过测试模块
-Dmaven.test.skip=true
4 添加打包插件, 并指定主方法启动类
<build>
<sourceDirectory>src/main/java</sourceDirectory>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>2.2.8.RELEASE</version>
<configuration>
<mainClass>com.example.TestSftp</mainClass>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
5 指定字符编码和jdk版本
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.encoding>UTF-8</maven.compiler.encoding>
<java.version>11</java.version>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
6 maven跳过证书下载包 mvn clean install -Dmaven.test.skip=true -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true -U
标签:1.0,http,maven,命令,Dmaven,一些,true,mvn 来源: https://www.cnblogs.com/ladeng19/p/16465694.html