Reputation: 86905
I have a fine running project that uses Maven for dependency management. The project itself is run by eclipse (Run As...
).
In the project menu > Deployment Assembly
, I have included the MAVEN_REPO
.
Problem: when I run the project, everything gets copied correctly to war/WEB-INF/lib
.
BUT I'm constantly getting an error that PersistenceProvider
cannot be found.
IF I copy manually all libraries from deployed war dir to src/main/webapp/WEB-INF/lib
, and then restart the application, everthing works fine!
So I can conclude that my jpa/hibernate config in general is fine.
But how can I come over the need to add all libraries manually to the src lib folder?
Upvotes: 2
Views: 854
Reputation: 2653
So, when you do 'Run As - Web Applicaiton' eclipse/google plugin uses the War directory path you specify. To change this, you right click on your project, and select properties. Then under the google drop down, select 'Web Applicaiton'. There, you can edit the 'WAR directory' path. this is probably set to src/main/webapp, which is NOT what you want.
When maven builds your war, it takes all built class files and libraries, and packages them into the target directory. This is the directory you want to use as the 'War directory'. This will be something like '/target/myappname-1.0.0'
Sidenote: If you are using gwt/maven, you'll probably want to use the command 'mvn gwt:run' versus running using the google/eclipse plugin. This allows maven to do some work (like resolve dependencies) before the dev server is run.
Upvotes: 3