15

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??

4

6 に答える 6

1

試す

<resources>
  <resource>
    <directory>src/main/resources</directory>
    <includes>
      <include>**/*</include>
    </includes>
  </resource>
</resources>

または、設定 -> コンパイラ -> リソース パターンで、リソース パターン (つまり ?*.prefs) を追加します。

于 2012-09-10T22:50:12.490 に答える