Trying out IntelliJ on a small maven 2, GWT project. Got most things working pretty quickly, but ran into an issue with one maven external dependency jar which was marked as "provided" scope. This jar was not present in the classpath when I launched from within intellij. If I remove the "provided" scope, it is present, and the app works.
This makes sense so far, but here is the problem. The particular jar is only used in the IDE, it is "commons-dbcp" and is used to connect to the database. When deployed, we use a container datasource looked up via JNDI, so commons-dbcp is not needed in the deployed runtime environments - only for developers running inside their IDE. If I remove the "provided" scope, the jar will be unnecessarily included in the deployed war.
Solution? I have tried:
- marking scope as "test". GWT launch inside intellij still does not pick up the jar in the classpath.
- removing the provided scope, but putting the dependency inside a maven profile, and selecting that profile as active in the maven tab in intellij. same problem - gwt launch inside intellij does not pick up the jar.
In eclipse, there is a way in the run configuration to force a particular jar to be added that is not normally on the project classpath. I don't see a similar option inside intellij, and in any case that's a little bit of a kluge because it's something that isn't in your pom that developers need to know to do manually to get the thing to run. But at this point, since it's one jar, I'd accept that...
May be more of a GWT plugin issue / question than an intellij one.