[ 
https://issues.apache.org/jira/browse/SUREFIRE-1882?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17272679#comment-17272679
 ] 

Tibor Digana edited comment on SUREFIRE-1882 at 1/27/21, 8:43 AM:
------------------------------------------------------------------

[~kriegaex]
I think we are talking about theory. I also have to continue with the release 
plan, so this is a little issue for me. We have made the workaround with using 
JDK8 only and I am glad that you provided the fix but really there are other 
big changes which have to be made otherwise we would not be able to be flexible 
in the future (XML reports, JSON reports, JUnit5, Cucumber and Dynamic tests, 
...).
[~KroArtem]
Here is the part of the POM, pls have a look. Do we have any problem? I think 
we don't because we use the rule {{enforceBytecodeVersion}}, see this:

{code:xml}
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>3.0.0-M3</version>
        <executions>
          <execution>
            <id>enforce-java</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireJavaVersion>
                  <!-- We use JDK 1.8 to check -Xdoclint:all at compile time 
but with javac -source 1.7 -target 1.7 -->
                  <version>[1.8, )</version>
                </requireJavaVersion>
              </rules>
            </configuration>
          </execution>
          <execution>
            <id>enforce-maven</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>[3.1.0,)</version>
                </requireMavenVersion>
              </rules>
            </configuration>
          </execution>
          <execution>
            <id>enforce-bytecode-version</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <enforceBytecodeVersion>
                  <maxJdkVersion>${maven.compiler.target}</maxJdkVersion>
                  <excludes>
                    <exclude>org.junit.platform:junit-platform-commons</exclude>
                    <exclude>org.assertj:assertj-core</exclude>
                  </excludes>
                </enforceBytecodeVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <fail>true</fail>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>animal-sniffer-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>signature-check</id>
            <goals>
              <goal>check</goal>
            </goals>
            <configuration>
              <signature>
                <groupId>org.codehaus.mojo.signature</groupId>
                <artifactId>java17</artifactId>
                <version>1.0</version>
              </signature>
            </configuration>
          </execution>
        </executions>
      </plugin>
{code}



was (Author: tibor17):
[~kriegaex]
I think we are talking about theory. I also have to continue with the release 
plan, so this is a little issue for me.
[~KroArtem]
Here is the part of the POM, pls have a look. Do we have any problem? I think 
we don't because we use the rule {{enforceBytecodeVersion}}, see this:

{code:xml}
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>3.0.0-M3</version>
        <executions>
          <execution>
            <id>enforce-java</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireJavaVersion>
                  <!-- We use JDK 1.8 to check -Xdoclint:all at compile time 
but with javac -source 1.7 -target 1.7 -->
                  <version>[1.8, )</version>
                </requireJavaVersion>
              </rules>
            </configuration>
          </execution>
          <execution>
            <id>enforce-maven</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>[3.1.0,)</version>
                </requireMavenVersion>
              </rules>
            </configuration>
          </execution>
          <execution>
            <id>enforce-bytecode-version</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <enforceBytecodeVersion>
                  <maxJdkVersion>${maven.compiler.target}</maxJdkVersion>
                  <excludes>
                    <exclude>org.junit.platform:junit-platform-commons</exclude>
                    <exclude>org.assertj:assertj-core</exclude>
                  </excludes>
                </enforceBytecodeVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <fail>true</fail>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>animal-sniffer-maven-plugin</artifactId>
        <executions>
          <execution>
            <id>signature-check</id>
            <goals>
              <goal>check</goal>
            </goals>
            <configuration>
              <signature>
                <groupId>org.codehaus.mojo.signature</groupId>
                <artifactId>java17</artifactId>
                <version>1.0</version>
              </signature>
            </configuration>
          </execution>
        </executions>
      </plugin>
{code}


> 3.0.0-M6-SNAPSHOT no longer working with Java 8
> -----------------------------------------------
>
>                 Key: SUREFIRE-1882
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1882
>             Project: Maven Surefire
>          Issue Type: Bug
>          Components: Maven Failsafe Plugin, Maven Surefire Plugin
>    Affects Versions: 3.0.0-M6
>            Reporter: Alexander Kriegisch
>            Priority: Major
>         Attachments: 2021-01-26T13-22-12_972-jvmRun1.dump
>
>
> When running my build on JDK 8, I see
> {code}
> [INFO] --- maven-surefire-plugin:3.0.0-M6-SNAPSHOT:test (reuse-jvm) @ 
> sarek-mock ---
> [INFO] 
> [INFO] -------------------------------------------------------
> [INFO]  T E S T S
> [INFO] -------------------------------------------------------
> [INFO] 
> [INFO] Results:
> [INFO] 
> [INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
> [INFO] 
> [WARNING] Could not delete temp directory 
> C:\Users\alexa\AppData\Local\Temp\surefire9150168311367699157 because File 
> C:\Users\alexa\AppData\Local\Temp\surefire9150168311367699157\surefirebooter4446112705128419789.jar
>  unable to be deleted.
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Reactor Summary for sarek-parent 1.0-SNAPSHOT:
> [INFO] 
> [INFO] (...)
> [INFO] sarek-mock ......................................... FAILURE [  1.541 
> s]
> [INFO] (...)
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Total time:  15.095 s
> [INFO] Finished at: 2021-01-26T13:22:20+07:00
> [INFO] 
> ------------------------------------------------------------------------
> [ERROR] Failed to execute goal 
> org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M6-SNAPSHOT:test 
> (reuse-jvm) on project sarek-mock: There are test failures.
> [ERROR] 
> [ERROR] Please refer to 
> C:\Users\alexa\Documents\java-src\Sarek\sarek-mock\target\surefire-reports 
> for the individual test results.
> [ERROR] Please refer to dump files (if any exist) [date].dump, 
> [date]-jvmRun[N].dump and [date].dumpstream.
> [ERROR] The forked VM terminated without properly saying goodbye. VM crash or 
> System.exit called?
> [ERROR] Command was cmd.exe /X /C ""C:\Program 
> Files\Java\jdk1.8.0_211\jre\bin\java" -jar 
> C:\Users\alexa\AppData\Local\Temp\surefire9150168311367699157\surefirebooter4446112705128419789.jar
>  C:\Users\alexa\AppData\Local\Temp\surefire9150168311367699157 
> 2021-01-26T13-22-12_972-jvmRun1 surefire4902538894981773413tmp 
> surefire_05054187083706494231tmp"
> [ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: The 
> forked VM terminated without properly saying goodbye. VM crash or System.exit 
> called?
> [ERROR] Command was cmd.exe /X /C ""C:\Program 
> Files\Java\jdk1.8.0_211\jre\bin\java" -jar 
> C:\Users\alexa\AppData\Local\Temp\surefire9150168311367699157\surefirebooter4446112705128419789.jar
>  C:\Users\alexa\AppData\Local\Temp\surefire9150168311367699157 
> 2021-01-26T13-22-12_972-jvmRun1 surefire4902538894981773413tmp 
> surefire_05054187083706494231tmp"
> [ERROR]       at 
> org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:751)
> [ERROR]       at 
> org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:306)
> [ERROR]       at 
> org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:266)
> [ERROR]       at 
> org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1320)
> [ERROR]       (...)
> {code}
> See also the dump file attached to this ticket.
> When running the build e.g. with Java 11 or Java 14, the same error does not 
> occur. I tested with the current master, commit 
> [f14fa54b|https://github.com/apache/maven-surefire/commit/f14fa54b9eba073c8c896a829fac1c2037b34222].
> The root cause seems to be this part of the dump file:
> {code}
> java.lang.NoSuchMethodError: java.nio.ByteBuffer.flip()Ljava/nio/ByteBuffer;
>       at 
> org.apache.maven.surefire.api.util.internal.AbstractNoninterruptibleWritableChannel.write(AbstractNoninterruptibleWritableChannel.java:67)
>       at 
> org.apache.maven.surefire.api.util.internal.AbstractNoninterruptibleWritableChannel.write(AbstractNoninterruptibleWritableChannel.java:44)
>       at 
> org.apache.maven.surefire.api.stream.AbstractStreamEncoder.write(AbstractStreamEncoder.java:77)
>       at 
> org.apache.maven.surefire.booter.spi.EventChannelEncoder.write(EventChannelEncoder.java:333)
>       at 
> org.apache.maven.surefire.booter.spi.EventChannelEncoder.encodeOpcode(EventChannelEncoder.java:324)
>       at 
> org.apache.maven.surefire.booter.spi.EventChannelEncoder.bye(EventChannelEncoder.java:274)
>       at 
> org.apache.maven.surefire.booter.ForkedBooter.acknowledgedExit(ForkedBooter.java:419)
>       at 
> org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:194)
>       at 
> org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:570)
>       at 
> org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:556)
> {code}
> {{ByteBuffer.flip()}} simply does not exist yet in Java 8. The [read-me 
> file|https://github.com/apache/maven-surefire/blob/master/README.md] says:
> ??Build the Surefire project using Maven 3.1.0+ and JDK 1.8+.??
> OTOH, the corresponding [commit 
> 5e3348cd|https://github.com/apache/maven-surefire/commit/5e3348cdf29d1d49ca615a893b9174563f62815c#diff-0dc38587795788db7bf5bc5366d065899b92d6680be60003ecd6af0fad3c8156]
>  by [~tibordigana] is 2 years old already, calling a Java 9+ method 
> {{flip()}}:



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to