tkruse / gradle-groovysh-plugin

gradle plugin allowing to start a command-line shell
Apache License 2.0
42 stars 10 forks source link

exception when using Gradle 2.14 #14

Open devisnik opened 8 years ago

devisnik commented 8 years ago

With Gradle 2.14 I run into the following exception when running the shell task.

Caused by: org.gradle.api.InvalidUserDataException: Cannot change dependencies of configuration ':terminal:appShellConf_shell' after it has been resolved.
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.validateMutation(DefaultConfiguration.java:603)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$2.run(DefaultConfiguration.java:150)
        at org.gradle.api.internal.DefaultDomainObjectCollection.assertMutable(DefaultDomainObjectCollection.java:267)
        at org.gradle.api.internal.DefaultDomainObjectCollection.add(DefaultDomainObjectCollection.java:158)
        at org.gradle.api.internal.DelegatingDomainObjectSet.add(DelegatingDomainObjectSet.java:81)
        at org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.doAdd(DefaultDependencyHandler.java:84)
        at org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.add(DefaultDependencyHandler.java:61)
        at org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.add(DefaultDependencyHandler.java:57)
        at org.gradle.api.artifacts.dsl.DependencyHandler$add.call(Unknown Source)
        at com.tkruse.gradle.groovysh.TaskHelper.addIfMissing(TaskHelper.groovy:102)
        at com.tkruse.gradle.groovysh.TaskHelper.addIfMissing(TaskHelper.groovy)
        at com.tkruse.gradle.groovysh.TaskHelper$addIfMissing$2.callStatic(Unknown Source)
        at com.tkruse.gradle.groovysh.TaskHelper.addGroovyDependencies(TaskHelper.groovy:61)
        at com.tkruse.gradle.groovysh.TaskHelper$addGroovyDependencies$0.call(Unknown Source)
        at com.tkruse.gradle.groovysh.AbstractShellTask.addGroovyDependencies(AbstractShellTask.groovy:73)
        at com.tkruse.gradle.groovysh.AbstractShellTask.exec(AbstractShellTask.groovy:81)
        at com.tkruse.gradle.groovysh.ApplicationShellTask.super$6$exec(ApplicationShellTask.groovy)
        at com.tkruse.gradle.groovysh.ApplicationShellTask.exec(ApplicationShellTask.groovy:80)
        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:75)
carstenlenz commented 8 years ago

The same here. It occurs when using the default tasks and also when defining custom tasks with the type com.tkruse.gradle.groovysh.ApplicationShellTask.

tkruse commented 8 years ago

Unfortunately I believe this problem and the one in #13 will not be solved, at least I don't see how I could find the time. After trying to find a fix yesterday, it seems the required research and changes would be more effort than I can spend.

So likely I will have to drop this plugin, meaning users would have to define custom shells as described in the docs folder.

It may be more viable for the future to write a separate CLI app that integrates with Gradle (or maven) via it's API than to embed a plugin in the gradle process.

carstenlenz commented 8 years ago

Ok but thanks for your effort and time. As I am maintaining a public Gradle plugin and a few internal ones I know how time intensive this can get. I'll have a look into the custom shells for now.

Thank you.