Avoiding the default data context

Hello everyone!

I want to detect all uses of default data context. As stated in the documentation:

Using both the compiler plugin and ExceptionalDataContext together will be able to detect all uses of the default data context.

My question is: how to use this compiler plugin with gradle? The documentation provides example only for maven.

Thank you in advance for your answers.

just have to specify a command line argument for javac: -Xplugin:dataContextPlugin. I don’t know the details of gradle, but hopefully they document how to provide flags to javac.

I use this solution with options.compilerArgs << '-Xplugin:dataContextPlugin', and It doesn’t work(
I have an error: plug-in not found: dataContextPlugin

I don’t know your syntax, but here is what I have in my pom in the build section:

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <!-- latest version to work with maven 3.0.5-->
        <version>3.8.1</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
          <showWarnings>true</showWarnings>
          <compilerArgs>
            <arg>-Xlint:unchecked</arg>
            <arg>-Xlint:deprecation</arg>
            <arg>-Xplugin:dataContextPlugin</arg>
          </compilerArgs>
        </configuration>
      </plugin>