Gradle Plugin using deprecated JavaExec.main

Skip to first unread message

Mike Duigou

Aug 18, 2021, 6:28:35 PM8/18/21
to PIT Users

With the recent Gradle 7.1.1 update it began issuing a warning about use of a deprecated feature that will be removed in Gradle 8.0. I traced the problem to the Gradle PITest plugin:

The JavaExec.main property has been deprecated. This is scheduled to be removed in Gradle 8.0.
Please use the mainClass property instead. See for more details.
        at org.gradle.api.tasks.JavaExec.setMain(
        at info.solidsoft.gradle.pitest.PitestTask_Decorated.setMain(Unknown Source)
        at org.gradle.api.tasks.JavaExec.setMain(
        at java.base/java.lang.reflect.Method.invoke(
        at info.solidsoft.gradle.pitest.PitestTask_Decorated.setProperty(Unknown Source)
        at info.solidsoft.gradle.pitest.PitestTask.<init>(PitestTask.groovy:247)
        at info.solidsoft.gradle.pitest.PitestTask_Decorated.<init>(Unknown Source)
        at java.base/java.lang.reflect.Constructor.newInstance(

Hopefully this can be addressed with a new plugin release before Gradle 8.0 is released.


Mike Duigou

Henry Coles

Aug 19, 2021, 4:25:29 AM8/19/21
Hi Mike,

I think this has already been raised here

Marcin is generally much better at responding to issues than I am, so I suspect he's already looking at it. If you're able to help out I'd leave a comment over there.



You received this message because you are subscribed to the Google Groups "PIT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

Marcin Zajączkowski

Aug 19, 2021, 9:57:46 AM8/19/21
to 'Henry Coles' via PIT Users
On 2021-08-19 10:25, 'Henry Coles' via PIT Users wrote:
> Hi Mike,
> I think this has already been raised here

Thanks Henry, that's exactly that case.

@Mike, please subscribe to that issue to get a notification about
further changes. It is planned to have it fixed before Gradle 8.0 :).

Btw, maybe you would like to contribute to the project and provide a
pull request? ;)

Marcin - Working code is not enough

Mike Duigou

Aug 19, 2021, 1:26:44 PM8/19/21
to PIT Users
Thank you Henry and Marcin!

Both for PITest, the gradle plugin and your responses here!



Mike Duigou

Aug 19, 2021, 1:59:49 PM8/19/21
to PIT Users
And now there is a PR :-)

On Thursday, August 19, 2021 at 6:57:46 a.m. UTC-7 Marcin Zajączkowski wrote:
Reply all
Reply to author
0 new messages