Files not detected from from the `resources` directory
<p>I am trying to import a file from <code>resources</code> in my project. I specified the <code>SOLVER_CONFIG</code> to take in <code>solver.xml</code> from the root of <code>resources</code>.</p>

<pre><code>package in.co.technovia.sudoku;

import java.util.ArrayList;
....
public class App{
    private static final String SOLVER_CONFIG = "/solver.xml";
    public static void main(String[] args){
    SudokuGenerator sg = new SudokuGenerator();
    ....
    }

    private static Solver createSolver(){

    XmlSolverConfigurer configurer = new XmlSolverConfigurer();
        configurer.configure(SOLVER_CONFIG);
        return configurer.buildSolver();
    }
}
</code></pre>

<p>It's supposed to take <code>solver.xml</code> from the root of <code>resources</code>. It works in <a href="https://github.com/diega/drools-planner-poc/blob/master/src/main/java/ar/com/plugtree/abfm/poc/DroolsPlannerPoCApp.java" rel="nofollow">this case</a>, but the capricious Java gods decreed otherwise for my project:</p>

<pre><code>jesvin@Jesvin-Technovia:~/dev/drools/sudoku$ java in.co.technovia.sudoku.AppException in thread "main" java.lang.IllegalArgumentException: The solver configuration (/solver.xml) does not exist.
    at org.drools.planner.config.XmlSolverConfigurer.configure(XmlSolverConfigurer.java:79)
    at in.co.technovia.sudoku.App.createSolver(App.java:67)
    at in.co.technovia.sudoku.App.main(App.java:43)
</code></pre>

<p><strong>Question:</strong> Why isnt Java detecting the files from <code>resources</code>?</p>

<hr>

<p>I included the contents of the <code>src/main/java/in/co/technovia/sudoku/</code> application and  the <code>src/main/resources/</code> directory and the current classpath.</p>

<pre><code>jesvin@Jesvin-Technovia:~/dev/drools/sudoku$ ls src/main/resources/
score.drl  score.drl~  solver.xml  solver.xml~

jesvin@Jesvin-Technovia:~/dev/drools/sudoku$ ls src/main/java/in/co/technovia/sudoku/
App.class  App.java~  helloworld.class  helloworld.java~
App.java   domain     helloworld.java   solution

jesvin@Jesvin-Technovia:~/dev/drools/sudoku$ export | grep CLASSPATHdeclare -x   
CLASSPATH=".:/home/jesvin/dev/drools/sudoku/binaries/*:/home/jesvin/dev/drools/sudoku/src/main/java"
</code></pre>

<hr>

<p><strong>Solution:</strong> As <strong>khmarbaise</strong> says in his answers, the directory is meant for a maven build. So to include the directory, see ' <a href="http://stackoverflow.com/a/9045680/604511">http://stackoverflow.com/a/9045680/604511</a> '.</p>
