allure-maven icon indicating copy to clipboard operation
allure-maven copied to clipboard

Allure maven plugin does not work on JDK 17

Open fslevoaca-ionos opened this issue 2 years ago • 5 comments

Hi, It seems that Allure Maven plugin does not work on Java 17.

Stacktrace:

[ERROR] Failed to execute goal io.qameta.allure:allure-maven:2.12.0:report (execution) on project cucumber-tests: Execution execution of goal io.qameta.allure:allure-maven:2.12.0:report failed: An API incompatibility was encountered while executing io.qameta.allure:allure-maven:2.12.0:report: java.lang.ExceptionInInitializerError: null
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>io.qameta.allure:allure-maven:2.12.0
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy

[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]

fslevoaca-ionos avatar Feb 10 '23 16:02 fslevoaca-ionos

I've encountered the same problem. Are there any updates?

ekaterinanepliueva avatar Feb 22 '24 13:02 ekaterinanepliueva

I think the problem is here Caused by: java.lang.StringIndexOutOfBoundsException: begin 0, end 3, length 2 at java.lang.String.checkBoundsBeginEnd (String.java:4601) at java.lang.String.substring (String.java:2704) at org.apache.commons.lang.SystemUtils.getJavaVersionAsFloat (SystemUtils.java:1133)

allure-maven dependnecy uses maven-reporting-impl:jar:3.0.0 where commons-lang:commons-lang:jar:2.4 is used instead of commons-lang3. so excluding of commons-lang doesn't help.

I see that version is upgraded in commit but this upgrade isn't included in the last version 2.12.0 https://github.com/allure-framework/allure-maven/pull/276/commits/7e0474eba03243d7d3215584cc96294d473c7e8f

ekaterinanepliueva avatar Feb 23 '24 13:02 ekaterinanepliueva

I've got the same problem. Any solution so far?

jandroalvarez avatar Apr 24 '24 15:04 jandroalvarez

@jandroalvarez I've changed java version from 17 to 17.0.10, because method org.apache.commons.lang.SystemUtils.getJavaVersionAsFloat produces StringIndexOutOfBoundsException, if gets java version not like a float number

ekaterinanepliueva avatar Apr 24 '24 15:04 ekaterinanepliueva

Thank you for the answer @enepliue1 ! AFAIK java.version is a read-only property of the JVM.

How did you set the long version number to run the Maven plugin?

jandroalvarez avatar Apr 25 '24 06:04 jandroalvarez