0

I'm developing a plugin and working locally before publishing. I'd like to avoid publishing until the work is finished.

I've read the latest Grails Plugins entry but it doesn't address my issue, nor do the few similar questions here.

My dir structure is like so (a little different than the docs based on this SO link):

    PROJECT_DIR
  - settings.gradle
  - myapp
    - build.gradle
    - settings.gradle
  - myplugin
    - build.gradle

In myApp build.gradle:

  grails {
    plugins {
        compile project(':../myPlugin')
    }
  }

In myApp settings.gradle (from the link above):

include '../myPlugin'

project(':../myPlugin').projectDir = new File('../myPlugin')

Here is the error I'm getting when the build fails:

| Resolving Dependencies. Please wait...

...

:../proper-remote:compileWebappGroovyPages UP-TO-DATE
:../proper-remote:compileGroovyPages
:../proper-remote:jar FAILED

...

* What went wrong:
Execution failed for task ':../myPlugin:jar'.
> Could not create ZIP '/Users/me/projects/myPlugin/build/libs/../myPlugin.jar'.

...

Total time: 9.733 secs
| Error Gradle build terminated with error: /Users/me/projects/myPlugin/build/libs/../myPlugin.jar' (No such file or directory)

Are my paths incorrect? Do I need to create the jar? If so, how do I do it? I've tried grails package-plugin to no avail.

Thanks!

Community
  • 1
  • 1
beechovsky
  • 133
  • 2
  • 17

1 Answers1

0

https://objectcomputing.com/products/grails/multi-project-builds/

In general you don't reference the dependency like a relative folder

compile project(':myPlugin')

include 'myPlugin', 'myApp'

Additionally, you need to move any info from each app/plugin's settings.gradle to the 'main' one in the parent folder and comment out/remove each app/plugin's setting.gradle file.

beechovsky
  • 133
  • 2
  • 17
James Kleeh
  • 12,094
  • 5
  • 34
  • 61
  • Hi! In addition to not specifying the dependency like a folder, I also realized that I had to move any info from each app/plugin's settings.gradle to the 'main' one in the parent folder and comment out/remove each app/plugin's setting.gradle file. – beechovsky May 02 '17 at 18:54