Skip to content

javac reports "--add-opens has no effect at compile time" #211

Closed
@big-andy-coates

Description

@big-andy-coates

When using the module plugin I'm seeing warnings being reported at when compiling test classes if the module-info.test file contains --add-opens lines.

e.g. from https://github.com/creek-service/creek-system-test, if I run:

>  gradle :model:testClasses

> Configure project :
Project :executor => 'creek.system.test.executor' Java module
Project :extension => 'creek.system.test.extension' Java module
Project :model => 'creek.system.test.model' Java module
Project :parser => 'creek.system.test.parser' Java module

> Task :model:compileTestJava
warning: [options] --add-opens has no effect at compile time
1 warning

BUILD SUCCESSFUL in 2s
6 actionable tasks: 6 executed

While the build passes, it would be nice to avoid these warnings by not passing --add-opens to javac.

Passing --add-opens to javac caused me to run into github/codeql-action#1040.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions