2

I'm trying to use the grails standalone plugin with a new grails project but I can't get it to work.

I've added it as a plugin dependency in my BuildConfig.groovy file:

plugins {
    compile: ":standalone:1.2.3"
}

But I get the following error when I attempt to run grails prod build-standalone:

Script 'BuildStandalone' not found, did you mean:
1) InstallDependency
2) Stats
3) InstallJQuery
4) CreateMultiProjectBuild_
5) TestApp

I tried running grails clean, grails clean-all, grails refresh-dependencies, and grails compile as answered in this question, but nothing seems to help. I would expect refresh-dependencies to either download the necessary artifacts or fail trying.

What am I doing wrong?

Here is my environment:

  • Mac OS X 10.9.5
  • JDK 1.8.0_05
  • Grails v2.4.4 installed with GVM
Community
  • 1
  • 1
james.lorenzen
  • 466
  • 1
  • 5
  • 13

1 Answers1

1

Always run grails compile after editing dependencies in BuildConfig.groovy; this triggers dependency resolution and installs the plugin, downloads the jars and adds them to the classpath etc. Once that happens the plugins' scripts will resolve.

Burt Beckwith
  • 75,342
  • 5
  • 143
  • 156
  • Thanks @burt-beckwith. I'm not sure what changed, but I was able to get it working. I did create a new grails app, added the standalone plugin, and ran `grails compile` and it added it with no issues. I tried running `grails compile` again in my original project and it didn't add the plugin for some reason. I noticed in my original posting I was missing the beginning colon in front of `standalone:1.2.3` but when I tried adding and then removing it, I wasn't able to compile. So I'm not sure what fixed my issue, but it seems to be working now. Thanks. – james.lorenzen Nov 14 '14 at 05:35
  • Spoke too soon. After I got the plugin working I ran `grails prod build-standalone` and got the following error: `java.lang.ClassNotFoundException: javac1.8`. Looks like from ant. Note I'm using jdk 1.8. Since I don't have any java code using 1.8 features I was able to run it with this option to workaround the issue: `grails prod build-standalone -Dbuild.compiler=javac1.7` which I found here: http://stackoverflow.com/questions/20702626/javac1-8-class-not-found. – james.lorenzen Nov 14 '14 at 05:53