Skip to content

Incompatible with Gradle Configuration Cache #269

Open

Description

@Fleshgrinder

The plugin is incompatible with the Gradle configuration cache feature.

I'm mostly creating this as a tracking issue and might come back later and raise a PR to fix it. I'm currently not blocked by this, but having support for all current Gradle features would obviously be desirable.

Activity

  1. koppor commented on May 6, 2025

    @koppor

    The error message is

    Caused by: java.lang.NullPointerException: Cannot invoke "org.gradle.api.Project.getExtensions()" because "this.project" is null
            at org.javamodularity.moduleplugin.JavaProjectHelper.extension(JavaProjectHelper.java:36)
            at org.javamodularity.moduleplugin.JavaProjectHelper.modularityExtension(JavaProjectHelper.java:44)
            at org.javamodularity.moduleplugin.tasks.CompileJavaTaskMutator.buildCompilerArgs(CompileJavaTaskMutator.java:60)
            at org.javamodularity.moduleplugin.tasks.CompileJavaTaskMutator.modularizeJavaCompileTask(CompileJavaTaskMutator.java:44)
            at org.javamodularity.moduleplugin.tasks.CompileTask$2.execute(CompileTask.java:103)
            at org.javamodularity.moduleplugin.tasks.CompileTask$2.execute(CompileTask.java:100)
    

    The workaround is to have following line in gradle.properties

    org.gradle.configuration-cache=false
  2. koppor commented on May 13, 2025

    @koppor

    I was given following hints:

    1. Gradle has native support for the module system: https://docs.gradle.org/current/userguide/java_library_plugin.html#sec:java_library_modular
    2. General information page on gradle and modules: https://github.com/jjohannes/java-module-system
    3. The "modern" way to add extra module information: https://github.com/gradlex-org/extra-java-module-info#defining-extra-module-information
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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