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

Problems with using Gradle plugin with Gradle 2.14 #1495

Closed
jest opened this issue Jun 9, 2016 · 10 comments
Closed

Problems with using Gradle plugin with Gradle 2.14 #1495

jest opened this issue Jun 9, 2016 · 10 comments
Milestone

Comments

@jest
Copy link
Contributor

jest commented Jun 9, 2016

Trying to run a project using Gradle 2.14 (rc-1 to rc-5) and biz.aQute.bnd plugin results in an error, where Gradle 2.13 works fine.

The error appears during applying a plugin in a script (a copy of enRoute's Gradle workspace):

subprojects {
  def bndProject = bndWorkspace.getProject(name)
  if (bndProject != null) {
    plugins.apply 'biz.aQute.bnd'
  }
}

The exception thrown:

org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'osgi-bnd'.
        at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:93)
        at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl$2.run(DefaultScriptPluginFactory.java:177)
        at org.gradle.configuration.ProjectScriptTarget.addConfiguration(ProjectScriptTarget.java:77)
        at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:182)
        at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:38)
        at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:25)
        at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:34)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:55)
        at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:540)
        at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:93)
        at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:42)
        at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:35)
        at org.gradle.initialization.DefaultGradleLauncher$2.run(DefaultGradleLauncher.java:124)
        at org.gradle.internal.Factories$1.create(Factories.java:22)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:53)
        at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:121)
        at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
        at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:98)
        at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:92)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:91)
        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:63)
        at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:92)
        at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:83)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:99)
        at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
        at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:48)
        at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
        at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:81)
        at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:46)
        at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:51)
        at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:28)
        at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43)
        at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:173)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:239)
        at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:212)
        at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
        at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
        at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:205)
        at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
        at org.gradle.launcher.Main.doAction(Main.java:33)
        at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:55)
        at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:36)
        at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
        at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:30)
        at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
        at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin [id 'biz.aQute.bnd']
        at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:153)
        at org.gradle.api.internal.plugins.DefaultPluginManager.addImperativePlugin(DefaultPluginManager.java:67)
        at org.gradle.api.internal.plugins.DefaultPluginContainer.apply(DefaultPluginContainer.java:55)
        at org.gradle.api.plugins.PluginContainer$apply.call(Unknown Source)
        at build_a5j7xbbue2r2xgv7zs7ymuj6p$_run_closure1.doCall(/home/jest/work/opti/r/core/osgi-bnd/build.gradle:32)
        at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:67)
        at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:107)
        at org.gradle.api.internal.project.AbstractProject.configure(AbstractProject.java:888)
        at org.gradle.api.internal.project.AbstractProject.configure(AbstractProject.java:893)
        at org.gradle.api.internal.project.AbstractProject.subprojects(AbstractProject.java:876)
        at org.gradle.internal.metaobject.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:374)
        at org.gradle.internal.metaobject.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:169)
        at org.gradle.internal.metaobject.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:96)
        at org.gradle.internal.metaobject.MixInClosurePropertiesAsMethodsDynamicObject.invokeMethod(MixInClosurePropertiesAsMethodsDynamicObject.java:30)
        at org.gradle.internal.metaobject.AbstractDynamicObject.invokeMethod(AbstractDynamicObject.java:163)
        at org.gradle.groovy.scripts.BasicScript.methodMissing(BasicScript.java:79)
        at build_a5j7xbbue2r2xgv7zs7ymuj6p.run(/home/jest/work/opti/r/core/osgi-bnd/build.gradle:29)
        at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:91)
        ... 50 more
Caused by: java.lang.NullPointerException: Cannot set property 'project' on null object
        at aQute.bnd.gradle.BndPlugin$_apply_closure1.doCall(BndPlugin.groovy:64)
        at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:67)
        at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:107)
        at org.gradle.api.internal.project.AbstractProject.configure(AbstractProject.java:888)
        at org.gradle.api.Project$configure.call(Unknown Source)
        at aQute.bnd.gradle.BndPlugin.apply(BndPlugin.groovy:42)
        at aQute.bnd.gradle.BndPlugin.apply(BndPlugin.groovy)
        at org.gradle.api.internal.plugins.ImperativeOnlyPluginApplicator.applyImperative(ImperativeOnlyPluginApplicator.java:35)
        at org.gradle.api.internal.plugins.RuleBasedPluginApplicator.applyImperative(RuleBasedPluginApplicator.java:43)
        at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:137)
        ... 67 more

The offending line: https://github.com/bndtools/bnd/blob/master/biz.aQute.bnd.gradle/src/aQute/bnd/gradle/BndPlugin.groovy#L64

@jest
Copy link
Contributor Author

jest commented Jun 9, 2016

The Release Notes give me no hint of what might be wrong.

Maybe something similar to GRADLE-3455 issue?

@bjhargrave
Copy link
Member

This sounds like a bug in Gradle. Did you report it to them?

@bjhargrave
Copy link
Member

The code in the bnd plugin is doing what is described in https://docs.gradle.org/current/dsl/org.gradle.api.plugins.ExtensionAware.html to create a bnd extension on the project.

@jest
Copy link
Contributor Author

jest commented Jun 9, 2016

@jest
Copy link
Contributor Author

jest commented Jun 9, 2016

But isn't extensions.create() for extending DSL and ext for simple properties? Just guessing, I have no experience with plugins...

@bjhargrave
Copy link
Member

extentions.create is to create a named set of properties. I use it to create the bnd set of properties. Then bnd.ext.project is set to hold the bnd Project object. Then project.bnd.project is the Bnd Project object for the Gradle Project object.

@bjhargrave
Copy link
Member

This is an issue in Gradle 2.14 builds. See https://discuss.gradle.org/t/bnd-plugin-broken-in-2-14/17983/4

The Gradle team is investigating.

@bjhargrave
Copy link
Member

bjhargrave commented Jun 10, 2016

This bug resulted in the adding some release notes to the 2.14 release: https://docs.gradle.org/2.14/release-notes#changes-to-dynamic-property-look-up

@hzpz
Copy link

hzpz commented Jun 22, 2016

Is there going to be an intermediary release of the Bnd Gradle plugin to fix this issue? Or in other words: any idea when the fix will be available to the general public?

@bjhargrave bjhargrave added this to the 3.3 milestone Jun 22, 2016
@bjhargrave
Copy link
Member

I think we will release a 3.3 in the next month or two. In the interim, you will need to stick with Gradle 2.13 or use the dev Bnd builds.

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

3 participants