IntelliJ doesn't seem to put the provided dependency on the classpath when I run it, however I can do this successfully in Eclipse.
As it would be a lot more convenient for me, how can I do this in IntelliJ?
From the main menu, select File | Project Structure Ctrl+Alt+Shift+S , and go to Modules | Dependencies. In the next dialog, click Edit, and then click Configure next to the Include transitive dependencies option. Select the dependencies you want to include in the library and click OK.
From the main menu, select File | Project Structure Ctrl+Alt+Shift+S and click Modules | Dependencies. Right-click the necessary dependency and select Analyze This Dependency.
I'm having the same problem. Intellij does not include provided dependencies in classpath. See this source. The best solution I found is to run it as maven app, using the exec:java
goal. For example:
exec:java -Dexec.classpathScope=compile -Dexec.mainClass=com.splout.db.integration.NShardEnsemble -Dexec.args=4
Better solutions are welcome.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With