I am working on a Java web project that uses Liquibase groovy DSL to manage database changes. For the sake of this topic, there can be any other third-party library that uses *.groovy files as sources. The project is built using gradle. In one of my modules ( dao-base ) in the src/main/resources folder I have groovy files ( changelog01.groovy, master_changelog.groovy , etc.). these files must be downloaded by Liquibase at runtime.
Now, when I try to make a project in IntelliJ, it gives the following error message:
Groovyc: Unable to compile groovy files: The groovy library is defined for the dao-base module.
I realized that the groovy plugin detects *.groovy files, tries to compile them, and unsurprisingly fails. These are groovy DSL files that should only be downloaded by a third-party Liquibase analyzer, and I donโt need the IntelliJ groovy plugin to try to compile them.
I managed to find 2 partial solutions: 1. disable the groovy plugin in intellij. The problem with this solution is that the gradle plugin is dependent on the groovy plugin and therefore automatically shuts down when the groovy plugin is disabled. I need a gradle plugin. 2. excluding the src/main/resources folder in the project settings โ modules โ dao-base (my module) โ sources tab. The problem with this solution is that when I create a project and deploy it to tomcat, there are no files from the resource folder, and since the files are required at runtime, I get a file exception not found when loading the war.
I was hoping that someone could come up with a better solution to this problem.
source share