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:
C:\dev\myproject\build\classes
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?
From the main menu, select File | Project Structure Ctrl+Alt+Shift+S . Under Project Settings, select Modules | Paths. Change the paths specified in the Output path and Test output path or select Inherit project compile output path to use the paths specified for the project.
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:
<build>
...
<resources>
<resource>
<directory>src/com</directory>
<targetPath>com</targetPath>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
...
</build>
change path according to your project. More about the Maven Resources Plugin here.
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