mvn使用
程序员文章站
2022-06-17 18:22:23
...
mvn 使用(clean,package,install)
最近在看netty的源码,用maven构建,出现了各种问题,记录下使用到的mvn的命令和一些基本使用。
- mvn修改默认java版本:
${MAVEN_HOME}\conf\settings.xml
<profile>
<id>jdk18</id>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.8</jdk>
</activation>
<properties>
<maven.compile.source>1.8</maven.compile.source>
<maven.compile.target>1.8</maven.compile.target>
<maven.compile.complieVersion>1.8</maven.compile.complieVersion>
</properties>
</profile>
- 修改局部配置
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
- maven 生命周期 && 插件
name | process | plugin |
---|---|---|
clean | pre-clean -> clean -> post-clean | maven-clean-plugin |
default | …-> compile ->…test-compile -> test -> … -> package ->… install -> deploy | maven-resource-plugin,maven-compiler-plugin,maven-surefire-plugin,maven-jar-plugin,maven-install-plugin,maven-deploy-plugin |
site | pre-site -> site -> post-site -> site-deploy | maven-site-plugin |
get the plugin from: http://maven.apache.org/plugins/index.html
http://repository.codehaus.org/org/codehaus/mojo/
use the : mvn help: describe -Dplugin = org.apache.,maven.plugins: maven-complier-plugin:2.1
4.
以后用到了还会再加