Multi-module project, jpa persistence and building with GWT breaks running

I have a project with lots of modules. I have two modules that build into jars, both containing JPA Entity classes. I have a WAR that wants entities in both jars, but only want one persistence.xml. This is kind of a classic JPA hassle.

I solved this by adding <jar-file> into my WAR persistence.xml, pointing to the two jar files in the build.

This builds and deploys fine on our production server with Maven.

My problem is running the WAR, which is a GWT-module in Intellij. Intellij compiles and moves everything into a cache/GWT directory, which has historically worked just fine. Now however, i can't start the server since it complains that it can't find the jars in the persistence.xml config.

I tried adding a "build with maven" prior to running since i had hoped that it perhaps would copy the jars into the right place and make it work. Not optimal since it would increase my setting-up time every time i want to run, but still. However it doesn't work since the maven build don't copy the jars into the place where intellij looks.

Any idea how i can setup my module so that the jars are copied into my structure?

Comment actions Permalink

How do you start the GWT from IDEA? Do you use a GWT Run Configuration or an app server run configuration?

Nikolay Chashnikov
Software Developer
JetBrains, Inc
"Develop with pleasure!"

Comment actions Permalink

I'm running a GWT run configuration, hosted mode.


Please sign in to leave a comment.