I seem to have done something to tell IntelliJ to not copy source resources (e.g. XML and property files) to the compiler output folder.
Resources are not being copied to the Compiler output path. Test resources are copied to the test ouput folder, but no source resources are copied.
Source folder: src
(this is C:\dev\myproject\src
and contains XML files)
Test Source folder: tests\integration\src
(this is C:\dev\myproject\tests\integration\src
and contains XML files)
Compiler output:
- Use module compile output path
- Output path:
C:\dev\myproject\build\classes
- Test output path:
C:\dev\myproject\build\test
Settings -> Compiler -> Resource patterns:
?*.properties;?*.xml;?*.gif;?*.png;?*.jpeg;?*.jpg;?*.html;?*.dtd;?*.tld;?*.ftl
This is preventing me from running integration tests which load files from the classpath. (I do not have full control over the structure of this legacy project and most of the other developers use Eclipse.)
Can anyone give me some pointers as to what I need to do in order to have IntelliJ copy the resource to the output folders?
I have faced the same issue. Idea seems to have a bug in projects with maven dependencies.
The workarounds I could found so far:
Once you have successfully created your artifacts with either way, Idea continues to use them until the next maven dependency change.
In the case of jpa when you add a jpa facet, Intellij creates:
But it does not update the build
Added this to pom.xml to fix the problem:
i had same problems with IntelliJ IDEA 13 using Maven.
i solved it by adding this to my build tag in the pom.xml file:
change path according to your project. More about the Maven Resources Plugin here.
When using Gradle, try adding the resources to the
sourceSets
(use below code when you have the resource files in the same folder as the source files, otherwise adapt the path)Refer to How do I add resources to sourceSet with gradle?