[GitHub] [maven-surefire] slawekjaranowski commented on a change in pull request #422: [SUREFIRE-1975] JDK18 - The Security Manager is deprecated and will be removed in a future release

2022-01-01 Thread GitBox


slawekjaranowski commented on a change in pull request #422:
URL: https://github.com/apache/maven-surefire/pull/422#discussion_r777124681



##
File path: .github/workflows/maven-verify.yml
##
@@ -15,19 +15,49 @@
 # specific language governing permissions and limitations
 # under the License.
 
-name: Verify
+name: GitHub CI
 
 on:
   push:
 branches-ignore:
   - dependabot/**
   pull_request:
 
+
 jobs:
   build:
-name: Verify
-uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v1
-with:
-  ff-goal: 'install'
-  verify-goal: 'install -P run-its'
-  verify-fail-fast: false
+
+strategy:
+  matrix:
+os: [ubuntu-latest, windows-latest, macOS-latest]
+java: [8, 11, 17]
+jdk: [temurin]
+  fail-fast: false
+
+runs-on: ${{ matrix.os }}
+timeout-minutes: 120
+
+steps:
+  - name: Checkout
+uses: actions/checkout@v1
+
+  - name: Set up JDK ${{ matrix.java }}
+uses: actions/setup-java@v2.4.0
+with:
+  distribution: ${{ matrix.jdk }}
+  java-version: ${{ matrix.java }}
+  cache: 'maven'
+
+  - name: Build with Maven
+run: mvn clean install -e -B -V -nsu --no-transfer-progress -P run-its 
-Dfailsafe-integration-test-port=8083
+
+  - name: Upload artifact surefire-its
+uses: actions/upload-artifact@v2-preview
+if: failure()
+with:
+  name: ${{ matrix.os }}-surefire-its
+  path: |
+surefire-its/target/*/log.txt
+surefire-its/target/**/surefire-reports/*
+surefire-its/target/**/failsafe-reports/*
+!surefire-its/target/failsafe-reports

Review comment:
   by the way attached artifacts has size > 1GB ...




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [maven-surefire] slawekjaranowski commented on a change in pull request #422: [SUREFIRE-1975] JDK18 - The Security Manager is deprecated and will be removed in a future release

2022-01-01 Thread GitBox


slawekjaranowski commented on a change in pull request #422:
URL: https://github.com/apache/maven-surefire/pull/422#discussion_r777124494



##
File path: .github/workflows/maven-verify.yml
##
@@ -15,19 +15,49 @@
 # specific language governing permissions and limitations
 # under the License.
 
-name: Verify
+name: GitHub CI
 
 on:
   push:
 branches-ignore:
   - dependabot/**
   pull_request:
 
+
 jobs:
   build:
-name: Verify
-uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v1
-with:
-  ff-goal: 'install'
-  verify-goal: 'install -P run-its'
-  verify-fail-fast: false
+
+strategy:
+  matrix:
+os: [ubuntu-latest, windows-latest, macOS-latest]
+java: [8, 11, 17]
+jdk: [temurin]
+  fail-fast: false
+
+runs-on: ${{ matrix.os }}
+timeout-minutes: 120
+
+steps:
+  - name: Checkout
+uses: actions/checkout@v1
+
+  - name: Set up JDK ${{ matrix.java }}
+uses: actions/setup-java@v2.4.0
+with:
+  distribution: ${{ matrix.jdk }}
+  java-version: ${{ matrix.java }}
+  cache: 'maven'
+
+  - name: Build with Maven
+run: mvn clean install -e -B -V -nsu --no-transfer-progress -P run-its 
-Dfailsafe-integration-test-port=8083
+
+  - name: Upload artifact surefire-its
+uses: actions/upload-artifact@v2-preview
+if: failure()
+with:
+  name: ${{ matrix.os }}-surefire-its
+  path: |
+surefire-its/target/*/log.txt
+surefire-its/target/**/surefire-reports/*
+surefire-its/target/**/failsafe-reports/*
+!surefire-its/target/failsafe-reports

Review comment:
   That is because we have two events:
   - push to branches
   - pull_request 
   
   I try to discover how prevent it




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [maven-surefire] slawekjaranowski commented on a change in pull request #422: [SUREFIRE-1975] JDK18 - The Security Manager is deprecated and will be removed in a future release

2022-01-01 Thread GitBox


slawekjaranowski commented on a change in pull request #422:
URL: https://github.com/apache/maven-surefire/pull/422#discussion_r777115790



##
File path: .github/workflows/maven-verify.yml
##
@@ -15,19 +15,49 @@
 # specific language governing permissions and limitations
 # under the License.
 
-name: Verify
+name: GitHub CI
 
 on:
   push:
 branches-ignore:
   - dependabot/**
   pull_request:
 
+
 jobs:
   build:
-name: Verify
-uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v1
-with:
-  ff-goal: 'install'
-  verify-goal: 'install -P run-its'
-  verify-fail-fast: false
+
+strategy:
+  matrix:
+os: [ubuntu-latest, windows-latest, macOS-latest]
+java: [8, 11, 17]
+jdk: [temurin]
+  fail-fast: false
+
+runs-on: ${{ matrix.os }}
+timeout-minutes: 120
+
+steps:
+  - name: Checkout
+uses: actions/checkout@v1
+
+  - name: Set up JDK ${{ matrix.java }}
+uses: actions/setup-java@v2.4.0
+with:
+  distribution: ${{ matrix.jdk }}
+  java-version: ${{ matrix.java }}
+  cache: 'maven'
+
+  - name: Build with Maven
+run: mvn clean install -e -B -V -nsu --no-transfer-progress -P run-its 
-Dfailsafe-integration-test-port=8083
+
+  - name: Upload artifact surefire-its
+uses: actions/upload-artifact@v2-preview
+if: failure()
+with:
+  name: ${{ matrix.os }}-surefire-its
+  path: |
+surefire-its/target/*/log.txt
+surefire-its/target/**/surefire-reports/*
+surefire-its/target/**/failsafe-reports/*
+!surefire-its/target/failsafe-reports

Review comment:
   Don't do it in this way
   it is step backward




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [maven-surefire] slawekjaranowski commented on a change in pull request #422: [SUREFIRE-1975] JDK18 - The Security Manager is deprecated and will be removed in a future release

2022-01-01 Thread GitBox


slawekjaranowski commented on a change in pull request #422:
URL: https://github.com/apache/maven-surefire/pull/422#discussion_r777115536



##
File path: .github/workflows/maven-verify.yml
##
@@ -25,9 +25,29 @@ on:
 
 jobs:
   build:
-name: Verify
-uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v1
-with:
-  ff-goal: 'install'
-  verify-goal: 'install -P run-its'
-  verify-fail-fast: false
+strategy:
+  matrix:
+os: [ubuntu-latest, windows-latest, macOS-latest]
+java: [8, 11, 17]
+jdk: [temurin, zulu]
+  fail-fast: false
+
+runs-on: ${{ matrix.os }}
+timeout-minutes: 120
+steps:
+- name: Verify
+  uses: 
apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v1

Review comment:
   We can extend  this workflow with artifacts upload support




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [maven-surefire] slawekjaranowski commented on a change in pull request #422: [SUREFIRE-1975] JDK18 - The Security Manager is deprecated and will be removed in a future release

2022-01-01 Thread GitBox


slawekjaranowski commented on a change in pull request #422:
URL: https://github.com/apache/maven-surefire/pull/422#discussion_r777115453



##
File path: .github/workflows/maven-verify.yml
##
@@ -25,9 +25,29 @@ on:
 
 jobs:
   build:
-name: Verify
-uses: apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v1
-with:
-  ff-goal: 'install'
-  verify-goal: 'install -P run-its'
-  verify-fail-fast: false
+strategy:
+  matrix:
+os: [ubuntu-latest, windows-latest, macOS-latest]
+java: [8, 11, 17]
+jdk: [temurin, zulu]
+  fail-fast: false
+
+runs-on: ${{ matrix.os }}
+timeout-minutes: 120
+steps:
+- name: Verify
+  uses: 
apache/maven-gh-actions-shared/.github/workflows/maven-verify.yml@v1

Review comment:
   it is shared workflow ... can not be uses as step




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [maven-surefire] slawekjaranowski commented on a change in pull request #422: [SUREFIRE-1975] JDK18 - The Security Manager is deprecated and will be removed in a future release

2022-01-01 Thread GitBox


slawekjaranowski commented on a change in pull request #422:
URL: https://github.com/apache/maven-surefire/pull/422#discussion_r777113282



##
File path: 
surefire-api/src/main/java/org/apache/maven/surefire/api/util/internal/ObjectUtils.java
##
@@ -44,4 +46,11 @@ private ObjectUtils()
 {
 return ManagementFactory.getRuntimeMXBean().getSystemProperties();
 }
+
+public static boolean isSecurityManagerSupported()
+{
+ClassLoader classLoader = ObjectUtils.class.getClassLoader();
+Class smClass = tryLoadClass( classLoader, 
"java.lang.SecurityManager" );
+return smClass != null && !smClass.isAnnotationPresent( 
Deprecated.class );
+}

Review comment:
   what about Java Version from commons lang3 is is accessible by 
`org.apache.maven.surefire.shared.lang3.JavaVersion`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org




[GitHub] [maven-surefire] slawekjaranowski commented on a change in pull request #422: [SUREFIRE-1975] JDK18 - The Security Manager is deprecated and will be removed in a future release

2022-01-01 Thread GitBox


slawekjaranowski commented on a change in pull request #422:
URL: https://github.com/apache/maven-surefire/pull/422#discussion_r777108931



##
File path: 
surefire-providers/surefire-junit3/src/test/java/org/apache/maven/surefire/junit/JUnitTestSetTest.java
##
@@ -22,15 +22,19 @@
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
+import org.apache.maven.surefire.api.testset.TestSetFailedException;
 import org.apache.maven.surefire.common.junit3.JUnit3Reflector;
 import org.apache.maven.surefire.api.report.ReportEntry;
 import org.apache.maven.surefire.api.report.RunListener;
 import org.apache.maven.surefire.api.report.RunMode;
 import org.apache.maven.surefire.api.report.TestSetReportEntry;
+import org.apache.maven.surefire.shared.lang3.JavaVersion;

Review comment:
   In test classes we can use direct comons - not shaded

##
File path: 
surefire-providers/surefire-junit3/src/test/java/org/apache/maven/surefire/junit/JUnitTestSetTest.java
##
@@ -54,6 +58,32 @@ public void testExecuteSuiteClass()
   succeededTests.get( 0 ).getName() );
 }
 
+public void testSystemManager()
+{
+float javaVersion = Float.parseFloat( 
JavaVersion.JAVA_RECENT.toString() );
+boolean isDeprecated = javaVersion >= 17;
+try
+{
+JUnit3Provider.setSystemManager( "java.lang.SecurityManager" );
+
+if ( isDeprecated )
+{
+fail();
+}
+
+Object sm = invokeGetter( System.class, null, "getSecurityManager" 
);

Review comment:
   System.getSecurityManager() is public ... why  by reflections 

##
File path: 
surefire-api/src/main/java/org/apache/maven/surefire/api/util/internal/ObjectUtils.java
##
@@ -44,4 +46,11 @@ private ObjectUtils()
 {
 return ManagementFactory.getRuntimeMXBean().getSystemProperties();
 }
+
+public static boolean isSecurityManagerSupported()
+{
+ClassLoader classLoader = ObjectUtils.class.getClassLoader();
+Class smClass = tryLoadClass( classLoader, 
"java.lang.SecurityManager" );
+return smClass != null && !smClass.isAnnotationPresent( 
Deprecated.class );
+}

Review comment:
   Is checking java version >= 17 not enough?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org