maven dependency scopes

Hi,

Does does IDEA handle dependency scopes when a project is synchronized with pom.xml? In other words, how would IDEA set up a jar that is only needed during compilation but is provided by the environment at run-time or a jar that is only needed when running unit tests.


Thanks
Dmitry

0
5 comments

I don't think IDEA supports scopes. Here is my JIRA issue about it:

http://www.jetbrains.net/jira/browse/IDEA-16584

0

just voted for the issue. thanks

0

I just voted for this fix as well.

0

My experience is limited to Web projects (WAR files) and as far as I can tell IDEA works fine.

If I have a dependency in my Maven module with scope 'provided' or 'test', IDEA automatically configures these as 'Do not package' for the Web module.

Am I misunderstanding something?

0

It appears that Web modules export values are set properly sometimes. However for a regular java module, that is not the case.

For example I have a java module with the following dependencies scope defined with test and provided

junit junit 3.8.1 test log4j log4j 1.2.13 provided ]]>

After importing the master pom file, the sub-module is exporting both junit and log4j. Even if I open the sub-module pom file as it's own project, it is still exporting both of these jars. This is different behavior than what the maven build project would do.

The workaround is to manually uncheck the jars that should not be exported, but that can get really hairy when you're dealing with spring or hibernate libraries which have dozens of dependent jars, some with conflicting versions of the same jar.

0

Please sign in to leave a comment.