maven命令使用,需要配合环境变量+maven包使用
讲在前面:
Windows系统默认的地址:C:\Users\当前用户\.m2
注意:此地址内的配置优先级最高,即使配置了环境变量,也依然优先从此处获取,私服使用需谨慎
jar包存储路径:
<!-- 拉取jar本地存储路径 -->
<localRepository>D:/A_eclipse_work/maven/repository1001</localRepository>
配置私服账号:
<!-- 配置节点账号,传jar至私服 -->
<servers>
<server>
<id>xxxGroup</id>
<username>用户名</username>
<password>密码</password>
</server>
</servers>
配置多仓库节点
<!-- 配置仓库地址 -->
<mirrors>
<!-- 配置私服地址 -->
<mirror>
<id>xxxGroup</id>
<mirrorOf>maven-public</mirrorOf>
<url>http://ip:端口/repository/xxxGroup/</url>
</mirror>
<!-- 阿里云 -->
<mirror>
<id>nexus-aliyun</id>
<mirrorOf>central</mirrorOf>
<name>Nexus aliyun</name>
<url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>
</mirrors>
设置mvn命令打包编译使用jdk版本
<activeProfiles>
<activeProfile>xxxprofile</activeProfile>
</activeProfiles>
<profiles>
<profile>
<id>xxxprofile</id>
<repositories>
</repositories>
<activation>
<activeByDefault>true</activeByDefault>
<jdk>1.8</jdk>
</activation>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
</properties>
</profile>
</profiles>