szpak / gradle-pitest-plugin

Gradle plugin for PIT Mutation Testing
http://gradle-pitest-plugin.solidsoft.info/
212 stars 57 forks source link

Java 16 support #291

Closed iliuta closed 2 years ago

iliuta commented 2 years ago

Hi,

Is Java 16 supported yet?

I'm trying to launch pitest 1.6.0 from gradle with Java 16 from Adoptopenjdk and it doesn't seem to like much.

./gradlew pitest
plugins {
id 'info.solidsoft.pitest' version "1.6.0"
}
pitest {
    testSourceSets = [sourceSets.test]
    targetClasses = ['com.myapp.service.*']
    targetTests = "com.myapp.*"
    junit5PluginVersion = "0.14"
    pitestVersion = "1.6.0"
    testPlugin = "junit5"
    threads = 1
    outputFormats = ['XML', 'HTML']
    timestampedReports = false
}

I'm getting the following error:

> Task :pitest
14:05:29 PIT >> INFO : Verbose logging is disabled. If you encounter a problem, please enable it before reporting an issue.
Exception in thread "main" java.lang.IllegalArgumentException: Unsupported class file major version 60
        at org.pitest.reloc.asm.ClassReader.<init>(ClassReader.java:196)
        at org.pitest.reloc.asm.ClassReader.<init>(ClassReader.java:177)
        at org.pitest.reloc.asm.ClassReader.<init>(ClassReader.java:163)
        at org.pitest.classinfo.ClassInfoVisitor.getClassInfo(ClassInfoVisitor.java:41)

Thanks!

hcoles commented 2 years ago

Java 16 support was added in pitest 1.6.4. The latest version is 1.7.0.

iliuta commented 2 years ago

Thanks for the quick answer.

It's strange, if I look here https://github.com/szpak/gradle-pitest-plugin/releases but also here https://github.com/szpak/gradle-pitest-plugin/tags the last release seem to be 1.6.0.

Also on Maven Central

https://search.maven.org/artifact/info.solidsoft.gradle.pitest/gradle-pitest-plugin

I can't find 1.7.0.

Am I missing something?

hcoles commented 2 years ago

Those are the releases of the gradle plugin.

The actual pitest tool that the plugin calls lives here -> https://github.com/hcoles/pitest and releases seperately.

iliuta commented 2 years ago

Ok, I got it.

If I add pitestVersion = "1.7.0" in the plugin's configuration it seem to work.

Thanks. Great help!

szpak commented 2 years ago

@iliuta Exactly. The plugin is designed the way you can always choose any (compatible) PIT version for your analysis. Closing.

Of course GPP 1.7.0 providing PIT 1.7.x by default will be released one day.

Thanks @hcoles for you assistance.