change target to jdk8. #2146

This commit is contained in:
hengyunabc 2023-04-23 16:21:22 +08:00
parent acd9844853
commit 8834a0f2b2
15 changed files with 16 additions and 193 deletions

View File

@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
java: [8, 11] java: [8, 11, 17, 19]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Setup java - name: Setup java
@ -49,34 +49,4 @@ jobs:
distribution: 'zulu' distribution: 'zulu'
cache: 'maven' cache: 'maven'
- name: Build with Maven - name: Build with Maven
run: mvn clean package -P full run: mvn clean package -P full
ubuntu_build_jdk_ge_12:
runs-on: ubuntu-latest
strategy:
matrix:
# https://static.azul.com/zulu/bin/
java: [12, 13, 14 , 17, 18, 19]
steps:
- uses: actions/checkout@v3
- name: Set up JDK 1.8
uses: actions/setup-java@v3
with:
java-version: 8
distribution: 'zulu'
cache: 'maven'
- name: save java8 home
run: |
export JAVA8_HOME=$JAVA_HOME && echo $JAVA8_HOME
echo "export JAVA8_HOME=$JAVA_HOME" > ~/.testenv
- name: Setup java
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'zulu'
cache: 'maven'
- name: Build with Maven
run: |
source ~/.testenv
mvn -Dmaven.compiler.fork=true -Dmaven.compiler.executable=$JAVA8_HOME/bin/javac -DJAVA8_HOME=$JAVA8_HOME clean package -P full

View File

@ -28,16 +28,6 @@
<build> <build>
<finalName>arthas-agent</finalName> <finalName>arthas-agent</finalName>
<plugins> <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId> <artifactId>maven-assembly-plugin</artifactId>

View File

@ -34,19 +34,4 @@
</dependency> </dependency>
</dependencies> </dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
</plugins>
</build>
</project> </project>

View File

@ -31,16 +31,6 @@
<build> <build>
<finalName>arthas-boot</finalName> <finalName>arthas-boot</finalName>
<plugins> <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId> <artifactId>maven-assembly-plugin</artifactId>

View File

@ -15,16 +15,6 @@
<build> <build>
<finalName>arthas-client</finalName> <finalName>arthas-client</finalName>
<plugins> <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId> <artifactId>maven-assembly-plugin</artifactId>

View File

@ -14,18 +14,6 @@
<!-- This module can not add any dependencies --> <!-- This module can not add any dependencies -->
<build> <build>
<finalName>arthas-common</finalName> <finalName>arthas-common</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
</plugins>
</build> </build>
</project> </project>

View File

@ -18,17 +18,6 @@
<build> <build>
<finalName>arthas-core</finalName> <finalName>arthas-core</finalName>
<plugins> <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId> <artifactId>maven-shade-plugin</artifactId>

View File

@ -3,13 +3,14 @@ package com.taobao.arthas.core.server;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import java.lang.instrument.Instrumentation; import java.lang.instrument.Instrumentation;
import java.lang.reflect.Field;
import org.jboss.modules.ModuleClassLoader; import org.jboss.modules.ModuleClassLoader;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.mockito.Mockito; import org.mockito.Mockito;
import org.mockito.internal.util.reflection.FieldSetter;
import com.alibaba.bytekit.utils.ReflectionUtils;
import com.taobao.arthas.common.JavaVersionUtils; import com.taobao.arthas.common.JavaVersionUtils;
import com.taobao.arthas.core.bytecode.TestHelper; import com.taobao.arthas.core.bytecode.TestHelper;
import com.taobao.arthas.core.config.Configure; import com.taobao.arthas.core.config.Configure;
@ -40,9 +41,13 @@ public class ArthasBootstrapTest {
Configure configure = Mockito.mock(Configure.class); Configure configure = Mockito.mock(Configure.class);
Mockito.when(configure.getEnhanceLoaders()) Mockito.when(configure.getEnhanceLoaders())
.thenReturn("java.lang.ClassLoader,org.jboss.modules.ConcurrentClassLoader"); .thenReturn("java.lang.ClassLoader,org.jboss.modules.ConcurrentClassLoader");
FieldSetter.setField(arthasBootstrap, ArthasBootstrap.class.getDeclaredField("configure"), configure); Field configureField = ArthasBootstrap.class.getDeclaredField("configure");
FieldSetter.setField(arthasBootstrap, ArthasBootstrap.class.getDeclaredField("instrumentation"), configureField.setAccessible(true);
instrumentation); ReflectionUtils.setField(configureField, arthasBootstrap, configure);
Field instrumentationField = ArthasBootstrap.class.getDeclaredField("instrumentation");
instrumentationField.setAccessible(true);
ReflectionUtils.setField(instrumentationField, arthasBootstrap, instrumentation);
org.jboss.modules.ModuleClassLoader moduleClassLoader = Mockito.mock(ModuleClassLoader.class); org.jboss.modules.ModuleClassLoader moduleClassLoader = Mockito.mock(ModuleClassLoader.class);

View File

@ -14,16 +14,6 @@
<build> <build>
<finalName>math-game</finalName> <finalName>math-game</finalName>
<plugins> <plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId> <artifactId>maven-jar-plugin</artifactId>

View File

@ -36,20 +36,4 @@
</dependency> </dependency>
</dependencies> </dependencies>
<build>
<finalName>arthas-agent</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
</plugins>
</build>
</project> </project>

10
pom.xml
View File

@ -79,8 +79,8 @@
<properties> <properties>
<revision>3.6.8</revision> <revision>3.6.8</revision>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.target>1.6</maven.compiler.target> <maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>1.6</maven.compiler.source> <maven.compiler.source>1.8</maven.compiler.source>
<spring-boot.version>2.7.0</spring-boot.version> <spring-boot.version>2.7.0</spring-boot.version>
<maven-invoker-plugin.version>3.0.0</maven-invoker-plugin.version> <maven-invoker-plugin.version>3.0.0</maven-invoker-plugin.version>
<project.build.outputTimestamp>2020-09-27T15:10:43Z</project.build.outputTimestamp> <project.build.outputTimestamp>2020-09-27T15:10:43Z</project.build.outputTimestamp>
@ -170,7 +170,7 @@
<dependency> <dependency>
<groupId>org.mockito</groupId> <groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId> <artifactId>mockito-core</artifactId>
<version>2.28.2</version> <version>4.11.0</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
@ -209,13 +209,13 @@
<dependency> <dependency>
<groupId>net.bytebuddy</groupId> <groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId> <artifactId>byte-buddy</artifactId>
<version>1.11.6</version> <version>1.14.4</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.bytebuddy</groupId> <groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy-agent</artifactId> <artifactId>byte-buddy-agent</artifactId>
<version>1.11.6</version> <version>1.14.4</version>
</dependency> </dependency>
<dependency> <dependency>

View File

@ -23,18 +23,6 @@
<build> <build>
<finalName>arthas-spy</finalName> <finalName>arthas-spy</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
</plugins>
</build> </build>
</project> </project>

View File

@ -17,18 +17,4 @@
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
</dependency> </dependency>
</dependencies> </dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
</project> </project>

View File

@ -59,20 +59,4 @@
</dependencies> </dependencies>
<build>
<finalName>arthas-tunnel-client</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
</plugins>
</build>
</project> </project>

View File

@ -16,20 +16,4 @@
</dependencies> </dependencies>
<build>
<finalName>arthas-tunnel-common</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>
</plugins>
</build>
</project> </project>