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

Failure to select a strategy may result in Failed to apply plugin class 'org.gradle.api.plugins.JavaPlugin'. #234

Open
bric3 opened this issue Jan 2, 2023 · 0 comments

Comments

@bric3
Copy link

bric3 commented Jan 2, 2023

id("nebula.release") version "17.1.0"

When trying the plugin to replace yet another git based versioning plugin I stumbled on this error:

* What went wrong:
Failed to apply plugin class 'org.gradle.api.plugins.JavaPlugin'.
> Could not create domain object 'test' (JvmTestSuite)

The actual issue is hidden, I found it by running the same command with --stacktrace, I believe the plugin should instead log an error rather than failing with an exception, so it can be diagnosed more easily. The actual message is ok No version strategies were selected. Run build with --info for more detail..

* Exception is:
org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin class 'org.gradle.api.plugins.JavaPlugin'.
        at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:173)
        at org.gradle.api.internal.plugins.DefaultPluginManager.apply(DefaultPluginManager.java:151)
        at org.gradle.api.plugins.JavaLibraryPlugin.apply(JavaLibraryPlugin.java:51)
        at org.gradle.api.plugins.JavaLibraryPlugin.apply(JavaLibraryPlugin.java:40)
        at org.gradle.api.internal.plugins.ImperativeOnlyPluginTarget.applyImperative(ImperativeOnlyPluginTarget.java:43)
        ...

Caused by: java.lang.IllegalStateException: Could not create domain object 'test' (JvmTestSuite)
        at org.gradle.api.internal.DefaultNamedDomainObjectCollection$AbstractDomainObjectCreatingProvider.domainObjectCreationException(DefaultNamedDomainObjectCollection.java:976)
        at org.gradle.api.internal.DefaultNamedDomainObjectCollection$AbstractDomainObjectCreatingProvider.tryCreate(DefaultNamedDomainObjectCollection.java:948)
        ...

Caused by: org.gradle.api.GradleException: No version strategies were selected. Run build with --info for more detail.
        at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:67)
        at nebula.plugin.release.git.base.ReleasePluginExtension$DelayedVersion.infer(ReleasePluginExtension.groovy:119)
        at nebula.plugin.release.git.base.ReleasePluginExtension$DelayedVersion.toString(ReleasePluginExtension.groovy:129)
        ...
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

No branches or pull requests

1 participant