Skip to content

Canonicalization exception when using with the "plugin" profile in a Grails plugin #627

@odinsride

Description

@odinsride

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 new Grails plugin using the "plugin" profile:
    $ grails create-plugin com.odinsride.grails-spring-security-core-plugin --profile=plugin
  2. Add spring-security-core >= v4.0.0 to build.gradle:
    compile "org.grails.plugins:spring-security-core:4.0.3"
  3. Compile the plugin:
    $ grails compile

Expected Behaviour

The Grails plugin compiles successfully.

Actual Behaviour

Compilation fails on the compileGroovy task with the following message:

> Task :compileGroovy FAILED
2 actionable tasks: 1 executed, 1 up-to-date
<-------------> 0% WAITING
> IDLE

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileGroovy'.
> BUG! exception in phase 'canonicalization' in source unit 'C:\dev\grails\upgrade-4.0\grails-spring-security-core-plugin\grails-app\init\com\odinsride\Application.groovy' org.springframework.web.servlet.config.annotation.EnableWebMvc

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org
| Error Gradle build terminated with error: org.springframework.web.servlet.config.annotation.EnableWebMvc (Use --stacktrace to see the full trace)

I will also note that performing the exact same steps but omitting the --profile=plugin flag (which uses the web-plugin profile) does not exhibit this error message.

Further, I found that in a plugin generated with the plugin profile, if the following dependency is defined in build.gradle, the plugin will compile without the above error:

compile "org.grails:grails-web-boot"

Is this a matter of missing documentation or an actual problem?

Environment Information

  • Operating System: Windows 10
  • GORM Version: 7.0.8.RELEASE
  • Grails Version (if using Grails): 4.0.6
  • JDK Version: 1.8 (Adopt OpenJDK)

Example Application

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions