apache / apache/grails-intellij-plugin
IDEA does not resolve dependencies declared in inline plugins
- Dominant language
- Java
- Stars
- 17
- Forks
- 4
- Avg merge
- 5d 15h
- Merged PRs (30d)
- 4
Description
Steps to reproduce (IDEA 12.1.1, Mac OSX):
- Add an inline plugin to the BuildConfig.groovy of an application: `grails.plugin.location.'my-plugin' = '../my-plugin'`
- Add a dependency on plugin `spring-security-core` to the inline plugin's BuildConfig.groovy
- In some groovy/java file in the project, add a reference to a `spring-security-core` object (say `org.codehaus.groovy.grails.plugins.springsecurity.SpringSecurityUtils`)
- Note the reference does not resolve (though it resolves fine if we compile from the command line)
- This prevents IDEA from building/launching a valid Grails project
After wrestling with this for a fair bit, I did stumble on the following:
**Workaround**
- Copy the dependencies from the inline plugin's BuildConfig.groovy into the app's BuildConfig.groovy (we'll revert this in a sec)
- Synchronize Grails settings, then run your app
- Now delete the dependencies from the app's BuildConfig.groovy (though leave them in the inline plugin, naturally)
- IDEA will continue to properly resolve the dependency
Ideally this is a good candidate to get some attention in spite of the workaround; I'd imagine most folks working with inline plugins will get bit by this.
Also note: this may be a dupe of [IDEA-69277](https://youtrack.jetbrains.com/issue/IDEA-69277), but I created a new ticket since that one is focused on the Project Structure representation of the dependencies; seems like incorrect loading I'm describing here could be fixed without necessarily fixing the Product Structure view (though I won't be surprised if they go hand in hand).
---
*Imported from [IDEA-106458](https://youtrack.jetbrains.com/issue/IDEA-106458) · Type: Bug · Votes: 1*
*Comments, attachments, dates and reporter are not part of the export — follow the link above for the full history.*
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the issue in IntelliJ IDEA 12.1.1 with the application and inline plugin BuildConfig.groovy files described, then synchronize Grails settings and compare dependency resolution with a command-line build. Trace how the inline plugin's dependencies are loaded; done means spring-security-core references resolve and the project can be built and launched without copying dependencies into the application.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- groovy
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100