Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ not seeing resources folder

I created a new Project from scratch in IntelliJ by using a Maven Module. I didn't select any specific archetypes and I clicked on finish. The project gets created nicely and I have the java and resources folders under src/main as expected.

Unfortunately, my application does not find any property files in the resources folder because it looks in the project base folder instead.

I double checked that the resources folder is marked as 'source folder' in the Project Structure and I also tried to add the following to the pom.xml with no success:

<resources>
  <resource>
    <directory>src/main/resources</directory>
  </resource>
</resources>

I'm using Maven 2.2.1 and IntelliJ 11.1, Any thoughts??

like image 806
Marsellus Wallace Avatar asked Sep 07 '12 20:09

Marsellus Wallace


People also ask

How do I create a resource folder in IntelliJ?

From the main menu, select File | Project Structure Ctrl+Alt+Shift+S and click Project Settings | Modules. Select the necessary module and then open the Sources tab in the right-hand part of the dialog. Click Add Content Root and specify the folder that you want to add as a new content root. ).

How do I open a resource file in IntelliJ?

To do this, open the File > Project Structure dialog, select the Modules tab, and click on the resources folder. The result will be as shown below. Your application can now access resources from the resources folder.


1 Answers

There is a bug in Intellij 12 please go to Settings->Compiler and un-check "Use external build" check box - the idea behind it was that it was suppose to run faster with a compiler run in a separate process but in fact there is a bug and when using maven it does not copy resources.

like image 70
Ichtion Avatar answered Sep 19 '22 15:09

Ichtion