Java Archive | Oracle 中国https://www.oracle.com/cn/java/technologies/downloads/archive/
Maven – Download Apache Mavenhttps://maven.apache.org/download.cgi
#这里我们需要先下载jdk和maven,jdk的下载正常来说是需要注册登录下载的。
#这里我下载的是jdk-22的版本,maven是3.9.6的版本
#进行解压,安装,以及配置
tar -xvf jdk-22_linux-x64_bin.tar.gz -C /usr/local/
tar -xvf apache-maven-3.9.6-bin.tar.gz -C /usr/local/
cd /usr/local/
mv jdk-22/ jdk
mv apache-maven-3.9.6/ maven
cd maven/conf/
vim settings.xml
#配置maven私服地址
<mirror>
<id>AliRepo-aliyun</id>
<mirrorOf>*</mirrorOf>
<name>Mirror Name for the Alirepo.</name>
<url>https://maven.aliyun.com/repository/public</url>
</mirror>
#Maven配置settings.xml指定默认java8版本
<profile>
<id>jdk8</id>
<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>
#为了继承目的,并且要通过`<activatedProfiles/>`或命令行激活概要文件,概要文件必须有一个唯一的ID。
<activeProfiles>
<activeProfile>jdk8</activeProfile>
</activeProfiles>
#到这里就准备好JDK和Maven了,后期直接放到数据卷当中映射给Jenkins使用就OK。