Use java argument parameter in IntelliJ

So, we are trying to run separate test cases in IntelliJ. Since we are using the jackson-module-parameters parameter name module, we must compile our project using the flag -parameters. All test cases work fine when we execute them through Gradle, but when we run an individual test in IntelliJ, they do not work (due to a missing argument -parameters.

When you run intellij, all tests that depend on Jackson serialization fail.

How to fix it?

We already tried to make it work by setting the following parameter in intellij to -parameters

Settings > Build, Execution, Deployment > Compiler > Java Compiler > Additional command line parameters

In gradle, we have a similar setting that works.

subprojects {
    tasks.withType(JavaCompile) {
        options.compilerArgs << '-parameters'
    }
}
+4
source share

Source: https://habr.com/ru/post/1695164/


All Articles