jenkins迁移问题&多java管理&插件更新问题

最新jenkins启动问题&多java版本管理

#因为是老版本,启动后插件安装失败,旧的插件暂时没有找到很好的版本适配文档
# 插件地址  https://plugins.jenkins.io/credentials/ 
nohup java -Dhudson.model.DownloadService.noSignatureChecke=true -DJENKINS_HOME=/app/jenkins -jar /app/jenkins/jenkins.war &

官方latest,使用Java 11, Java 17, or Java 21

#最新版本
https://mirrors.jenkins.io/war/2.419/jenkins.war

需要安装多个版本的java

jenkins启动需要11或以上,java编译需要使用8

https://download.oracle.com/otn/java/jdk/8u381-b09/8c876547113c4e4aab3c868e9e0ec572/jre-8u381-linux-x64.tar.gz

https://download.oracle.com/java/17/archive/jdk-17.0.7_linux-x64_bin.tar.gz
[root@vm ~]# tar -xf jdk-17.0.7_linux-x64_bin.tar.gz
[root@vm ~]# tar -xf jre-8u381-linux-x64.tar.gz
[root@vm ~]# mv jdk-17.0.7 /usr/local/jdk17
[root@vm ~]# mv jre1.8.0_381/ /usr/local/jdk8
[root@vm ~]# alternatives --install /usr/bin/java java /usr/local/jdk8 1
[root@vm ~]# alternatives --install /usr/bin/java java /usr/local/jdk17 2
[root@vm ~]# vi /etc/profile
...
export JAVA_HOME=/usr/bin/java
export PATH=${JAVA_HOME}/bin:$PATH
[root@vm ~]# source /etc/profile
[root@vm ~]# alternatives --config java

There are 2 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
   1           /usr/local/jdk8
*+ 2           /usr/local/jdk17

Enter to keep the current selection[+], or type selection number: 1
[root@vm ~]# java -version
java version "1.8.0_381"

[root@vm ~]# alternatives --config java

There are 2 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
 + 1           /usr/local/jdk8
*  2           /usr/local/jdk17

Enter to keep the current selection[+], or type selection number: 2
[root@vm ~]# java -version
java version "17.0.7" 2023-04-18 LTS
Java(TM) SE Runtime Environment (build 17.0.7+8-LTS-224)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.7+8-LTS-224, mixed mode, sharing)

启动报错问题

nohup java -Dhudson.model.DownloadService.noSignatureChecke=true -DJENKINS_HOME=/app/jenkins -jar /app/jenkins/jenkins.war &

安装Jenkins启动出现错误提示 AWT is not properly configured on this server. Perhaps you need to run your container with “-Djava.awt.headless=true”? See also: https://www.jenkins.io/redirect/troubleshooting/java.awt.headless;


[root@vm ~]# yum install fontconfig   #安装了这个包后好了
#安装 node  
[root@vm ~]# wget https://nodejs.org/download/release/v14.17.6/node-v14.17.6-linux-x64.tar.gz
[root@vm ~]# tar xf node-v14.17.6-linux-x64.tar.gz -C /usr/local/
[root@vm ~]# vim /etc/profile
...
export NODE_HOME=/usr/local/node-v14.17.6-linux-x64/
export PATH=$PATH:$NODE_HOME/bin


[root@vm ~]# node -v
14.17.6
[root@vm ~]# npm -v
6.14.15

# 安装指定版本taro
[root@vm ~]# npm install -g @tarojs/[email protected]

# yarn
[root@vm /]# curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | tee /etc/yum.repos.d/yarn.repo

# maven git jdk  
[root@vm ~]# yum -y install yarn-1.17.3-1.noarch
[root@vm /]# yum search maven --showduplicates
#maven  系统设置->全局工具配置->Maven->Maven 安装
[root@vm /]# yum search git --showduplicates
[root@vm ~]# yum search java-1.8.0-openjdk --showduplicates

使用

#构建环境里没有nvm项,
Run the build in an NVM managed environment
#安装插件  nvm-wrapper  版本0.1.7其他功能不能用的,去搜索安装对应的插件

旧的插件暂时没有找到很好的版本适配文档,搞起来太费劲,整体迁移plugin目录吧

你可能感兴趣的:(linux使用,jenkins,java,servlet)