From 8834a0f2b2ab1fbf5cd697bfcda124fb977a4499 Mon Sep 17 00:00:00 2001 From: hengyunabc Date: Sun, 23 Apr 2023 16:21:22 +0800 Subject: [PATCH] change target to jdk8. #2146 --- .github/workflows/test.yaml | 34 ++----------------- agent/pom.xml | 10 ------ arthas-agent-attach/pom.xml | 15 -------- boot/pom.xml | 10 ------ client/pom.xml | 10 ------ common/pom.xml | 12 ------- core/pom.xml | 11 ------ .../core/server/ArthasBootstrapTest.java | 13 ++++--- math-game/pom.xml | 10 ------ memorycompiler/pom.xml | 16 --------- pom.xml | 10 +++--- spy/pom.xml | 12 ------- testcase/pom.xml | 14 -------- tunnel-client/pom.xml | 16 --------- tunnel-common/pom.xml | 16 --------- 15 files changed, 16 insertions(+), 193 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 9825ca7ab..8bff96d1e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -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 @@ -49,34 +49,4 @@ jobs: distribution: 'zulu' 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 \ No newline at end of file + run: mvn clean package -P full \ No newline at end of file diff --git a/agent/pom.xml b/agent/pom.xml index eaa2d5e64..5752d7bae 100644 --- a/agent/pom.xml +++ b/agent/pom.xml @@ -28,16 +28,6 @@ arthas-agent - - org.apache.maven.plugins - maven-compiler-plugin - - 1.6 - 1.6 - UTF-8 - true - - org.apache.maven.plugins maven-assembly-plugin diff --git a/arthas-agent-attach/pom.xml b/arthas-agent-attach/pom.xml index ba7387b41..8c1464bc5 100644 --- a/arthas-agent-attach/pom.xml +++ b/arthas-agent-attach/pom.xml @@ -34,19 +34,4 @@ - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.6 - 1.6 - UTF-8 - true - - - - - diff --git a/boot/pom.xml b/boot/pom.xml index 9235f89d2..56c9a559a 100644 --- a/boot/pom.xml +++ b/boot/pom.xml @@ -31,16 +31,6 @@ arthas-boot - - org.apache.maven.plugins - maven-compiler-plugin - - 1.6 - 1.6 - UTF-8 - true - - org.apache.maven.plugins maven-assembly-plugin diff --git a/client/pom.xml b/client/pom.xml index 88b6b67fb..77fb6b703 100644 --- a/client/pom.xml +++ b/client/pom.xml @@ -15,16 +15,6 @@ arthas-client - - org.apache.maven.plugins - maven-compiler-plugin - - 1.6 - 1.6 - UTF-8 - true - - org.apache.maven.plugins maven-assembly-plugin diff --git a/common/pom.xml b/common/pom.xml index cf2c69677..025c28692 100644 --- a/common/pom.xml +++ b/common/pom.xml @@ -14,18 +14,6 @@ arthas-common - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.6 - 1.6 - UTF-8 - true - - - diff --git a/core/pom.xml b/core/pom.xml index 6899d764c..94491e45a 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -18,17 +18,6 @@ arthas-core - - org.apache.maven.plugins - maven-compiler-plugin - - 1.6 - 1.6 - UTF-8 - true - - - org.apache.maven.plugins maven-shade-plugin diff --git a/core/src/test/java/com/taobao/arthas/core/server/ArthasBootstrapTest.java b/core/src/test/java/com/taobao/arthas/core/server/ArthasBootstrapTest.java index 93ea81f27..b878ac577 100644 --- a/core/src/test/java/com/taobao/arthas/core/server/ArthasBootstrapTest.java +++ b/core/src/test/java/com/taobao/arthas/core/server/ArthasBootstrapTest.java @@ -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); diff --git a/math-game/pom.xml b/math-game/pom.xml index dc91b4b3a..02de79e12 100644 --- a/math-game/pom.xml +++ b/math-game/pom.xml @@ -14,16 +14,6 @@ math-game - - org.apache.maven.plugins - maven-compiler-plugin - - 1.6 - 1.6 - UTF-8 - true - - org.apache.maven.plugins maven-jar-plugin diff --git a/memorycompiler/pom.xml b/memorycompiler/pom.xml index 5af5df2db..d20283e04 100644 --- a/memorycompiler/pom.xml +++ b/memorycompiler/pom.xml @@ -36,20 +36,4 @@ - - arthas-agent - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.6 - 1.6 - UTF-8 - true - - - - - diff --git a/pom.xml b/pom.xml index 795ba0765..0347b4590 100644 --- a/pom.xml +++ b/pom.xml @@ -79,8 +79,8 @@ 3.6.8 UTF-8 - 1.6 - 1.6 + 1.8 + 1.8 2.7.0 3.0.0 2020-09-27T15:10:43Z @@ -170,7 +170,7 @@ org.mockito mockito-core - 2.28.2 + 4.11.0 test @@ -209,13 +209,13 @@ net.bytebuddy byte-buddy - 1.11.6 + 1.14.4 net.bytebuddy byte-buddy-agent - 1.11.6 + 1.14.4 diff --git a/spy/pom.xml b/spy/pom.xml index 118e1b227..05c42c5fe 100644 --- a/spy/pom.xml +++ b/spy/pom.xml @@ -23,18 +23,6 @@ arthas-spy - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.6 - 1.6 - UTF-8 - true - - - diff --git a/testcase/pom.xml b/testcase/pom.xml index d0007fceb..73b635d40 100644 --- a/testcase/pom.xml +++ b/testcase/pom.xml @@ -17,18 +17,4 @@ junit - - - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.6 - 1.6 - UTF-8 - - - - diff --git a/tunnel-client/pom.xml b/tunnel-client/pom.xml index 2334eaae7..968eeb74b 100644 --- a/tunnel-client/pom.xml +++ b/tunnel-client/pom.xml @@ -59,20 +59,4 @@ - - arthas-tunnel-client - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.6 - 1.6 - UTF-8 - true - - - - - diff --git a/tunnel-common/pom.xml b/tunnel-common/pom.xml index c5a9a2204..8a80f0270 100644 --- a/tunnel-common/pom.xml +++ b/tunnel-common/pom.xml @@ -16,20 +16,4 @@ - - arthas-tunnel-common - - - org.apache.maven.plugins - maven-compiler-plugin - - 1.6 - 1.6 - UTF-8 - true - - - - -