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
strategy:
matrix:
java: [8, 11]
java: [8, 11, 17, 19]
steps:
- uses: actions/checkout@v3
- name: Setup java
@ -50,33 +50,3 @@ jobs:
cache: 'maven'
- name: Build with Maven
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>
<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>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>

View File

@ -34,19 +34,4 @@
</dependency>
</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>

View File

@ -31,16 +31,6 @@
<build>
<finalName>arthas-boot</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>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>

View File

@ -15,16 +15,6 @@
<build>
<finalName>arthas-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>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>

View File

@ -14,18 +14,6 @@
<!-- This module can not add any dependencies -->
<build>
<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>
</project>

View File

@ -18,17 +18,6 @@
<build>
<finalName>arthas-core</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>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<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 java.lang.instrument.Instrumentation;
import java.lang.reflect.Field;
import org.jboss.modules.ModuleClassLoader;
import org.junit.Before;
import org.junit.Test;
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.core.bytecode.TestHelper;
import com.taobao.arthas.core.config.Configure;
@ -40,9 +41,13 @@ public class ArthasBootstrapTest {
Configure configure = Mockito.mock(Configure.class);
Mockito.when(configure.getEnhanceLoaders())
.thenReturn("java.lang.ClassLoader,org.jboss.modules.ConcurrentClassLoader");
FieldSetter.setField(arthasBootstrap, ArthasBootstrap.class.getDeclaredField("configure"), configure);
FieldSetter.setField(arthasBootstrap, ArthasBootstrap.class.getDeclaredField("instrumentation"),
instrumentation);
Field configureField = ArthasBootstrap.class.getDeclaredField("configure");
configureField.setAccessible(true);
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);

View File

@ -14,16 +14,6 @@
<build>
<finalName>math-game</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>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>

View File

@ -36,20 +36,4 @@
</dependency>
</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>

10
pom.xml
View File

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

View File

@ -23,18 +23,6 @@
<build>
<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>
</project>

View File

@ -17,18 +17,4 @@
<artifactId>junit</artifactId>
</dependency>
</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>

View File

@ -59,20 +59,4 @@
</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>

View File

@ -16,20 +16,4 @@
</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>