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

Grails 4.0.0.RC2 - Compile issue with profile "plugin" andgrails create-service command #11342

Closed
4 tasks done
puneetbehl opened this issue Jun 8, 2019 · 3 comments
Closed
4 tasks done

Comments

@puneetbehl
Copy link
Contributor

puneetbehl commented Jun 8, 2019

Task List

  • Steps to reproduce provided
  • Stacktrace (if present) provided
  • Example that reproduces the problem uploaded to Github
  • Full description of the issue provided (see below)

Steps to Reproduce

  1. Create a new Grails plugin. (grails create-app example.myplugin --profile=plugin.
  2. Create a new service via command grails create-service example.BookService
  3. Execute ./gradlew compileGroovy.

Expected Behaviour

Project should compile successfully.

Actual Behaviour

> Task :compileGroovy FAILED
startup failed:
/private/tmp/plugin/grails-app/services/demo/BookService.groovy: 3: unable to resolve class grails.gorm.transactions.Transactional
 @ line 3, column 1.
   import grails.gorm.transactions.Transactional
   ^

1 error

Environment Information

  • Operating System: macOS Mojave (Version 10.14.5)
  • Grails Version: 4.0.0.RC2
  • JDK Version: 1.8
  • Container Version (If Applicable): N/A

Example Project

See https://travis-ci.org/grails-profiles-tests/plugin/builds/543070082

@ZacharyKlein ZacharyKlein self-assigned this Jun 17, 2019
@ZacharyKlein
Copy link
Member

The issue here is that the base profile provides create-service command, which uses a template that in turn imports grails.gorm.transactions.Transactional. However, the base profile doesn't require the hibernate5 feature which brings in the required GORM dependency for that import to work. This doesn't seem to be an issue with the plugin profile per se, except that this profile doesn't include the GORM dependency (which makes sense - not every plugin needs GORM), which causes this issue to pop up.

@jameskleeh I'm not sure if the solution is to remove the create-service command from base, or remove the @Transactional from the Service.groovy template, or make hibernate5 a required dependency. Thoughts?

@jameskleeh
Copy link
Contributor

@ZacharyKlein Most likely only make it so create-service is available from the profiles where a gorm implementation is provided by default

@ZacharyKlein
Copy link
Member

ZacharyKlein commented Jun 18, 2019

@jameskleeh jameskleeh added this to the grails-4.0.0 milestone Jun 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants