Library dependency not exported when deploying project?

Hello, I'm a new IDEA user and am having an issue getting a dependent JAR exported when deploying and running a project. In this case, it is a Grails project, and I am trying to use MySQL as the data source. I have tried creating both a global and a project library, marked it for export in the library dependencies of the project, and even added it to the Modules and Libraries to package under the GrailsWeb module. Nothing I do actually deploys the MySQL JAR. As a result, I get a class not found error when the application attempts to use the MySQL JDBC driver. I can export the project as a WAR and look into the WEB-INF/lib and see that the JAR is not there.

However, if I manually copy the JAR into the project/lib folder and then run it or create a WAR, the JAR is properly deployed. I assume this must be a bug, but I'm not sure if it is an issue with IDEA itself, or an issue with the Grails plugin. Any advice would be appreciated, since obviously having to manually manage dependent libraries would be a major problem with using IDEA.



1 comment
Comment actions Permalink

Just to add on to this, I also added the MySQL library to the GrailsWeb module under the Grails app in "Modules and Libraries to Export". If I set the GrailsWeb module to generate a Web Facet WAR file, and look at that WAR, the MySQL JAR is there within the WEB-INF/lib folder. However, no matter what I do, when I compile and run the Grails app, the MySQL JAR is never exported to the WEB-INF/lib folder, even though all the other dependencies such as Spring and Hibernate do. I'm pretty much at the point where there seems to be no conclusion other than a bug in the way IDEA handles Grails apps which prevents any user-defined libraries from being deployed correctly.


Please sign in to leave a comment.