Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module name cannot be determined if module declaration is annotated #279

Closed
xzel23 opened this issue Nov 6, 2024 · 0 comments · Fixed by #281
Closed

Module name cannot be determined if module declaration is annotated #279

xzel23 opened this issue Nov 6, 2024 · 0 comments · Fixed by #281

Comments

@xzel23
Copy link
Collaborator

xzel23 commented Nov 6, 2024

module-info.java:

import org.jspecify.annotations.NullMarked;

@NullMarked
module org.beryx.modular.annotatedmodule {
    requires org.jspecify;
    opens org.beryx.modular.annotatedmodule;
}

Error with shortened stacktrace:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':prepareModulesDir'.
> Error while evaluating property 'moduleName' of task ':prepareModulesDir'.
   > Failed to query the value of extension 'jlink' property 'moduleName'.
      > Cannot retrieve module name from /private/var/folders/6w/05drv2hn6c731ccrddrcxb7r0000gn/T/spock_should_create_runti_0_testProjectDir5359671681591213750/src/main/java/module-info.java with content: import org.jspecify.annotations.NullMarked;
        
        @NullMarked
        module org.beryx.modular.annotatedmodule {
            requires org.jspecify;
            opens org.beryx.modular.annotatedmodule;
        }


* Try:
> Run with --debug option to get more log output.
> Run with --scan to get full insights.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':prepareModulesDir'.
	at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:38)
	at ...
Caused by: org.gradle.api.internal.tasks.properties.PropertyEvaluationException: Error while evaluating property 'moduleName' of task ':prepareModulesDir'.
	at org.gradle.api.internal.tasks.properties.InputParameterUtils.prepareInputParameterValue(InputParameterUtils.java:33)
	at ...
Caused by: org.gradle.api.internal.provider.AbstractProperty$PropertyQueryException: Failed to query the value of extension 'jlink' property 'moduleName'.
	at org.gradle.api.internal.provider.AbstractProperty.doCalculateValue(AbstractProperty.java:136)
	at ...
Caused by: org.gradle.api.GradleException: Cannot retrieve module name from /private/var/folders/6w/05drv2hn6c731ccrddrcxb7r0000gn/T/spock_should_create_runti_0_testProjectDir5359671681591213750/src/main/java/module-info.java with content: import org.jspecify.annotations.NullMarked;

@NullMarked
module org.beryx.modular.annotatedmodule {
    requires org.jspecify;
    opens org.beryx.modular.annotatedmodule;
}

	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at org.gradle.internal.classpath.intercept.CallInterceptorsSet$DecoratingCallSite.access$401(CallInterceptorsSet.java:129)

@xzel23 xzel23 closed this as completed in a911923 Nov 22, 2024
xzel23 added a commit that referenced this issue Nov 22, 2024
fix #279 determine module name of annotated module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant