Maven support wrongly add contentroot

Hello,

while importing a maven project, idea wrongly adds a new content for test sources (in maven structure, src/test/java becomes a content root. I think this a) wrong, b) not coherent

The behaviour would be acceptable if idea would do this for both test and source files.

6 comments
Comment actions Permalink

What is the project layout and configuration?
I've just tried to import some projects with standard layout
src/main/java/...
src/test/java/...
and it have been imported just fine, with 'source folder' and 'test source folder' under one content root.

0
Comment actions Permalink

src/main/resources and src/test/resources are also added as content roots IIRC.

Considering the way IDEA works today, it has to be this way if you want to be able to run tests. Event though it would be nice to have IDEA enforce that non test resources should not reference test resources (also for test-scope dependencies)

0
Comment actions Permalink

Can you provide example POM file, please? I can not make IDEA to import test classes and resources as separate content roots.

0
Comment actions Permalink

just a bare pom should work , and does for me (where you don't refine the resources directories)

You can have a look at http://ideamksplugin.googlecode.com/svn/trunk/pom.xml
(checkout the trunk from subversion).

0
Comment actions Permalink

I've tried pom provided and IDEA still didn't make separate content roots for java and resources. It did create separate source folders for them. Is this that you meant saying content roots?

0
Comment actions Permalink

you're right, i read your original message too fast

0

Please sign in to leave a comment.