How to have the equivalent of main/resources in a non-Maven project?
<p>I was trying to model my project based on <a href="https://github.com/diega/drools-planner-poc" rel="nofollow">this project</a> at Github.</p>

<pre><code>public class DroolsPlannerPoCApp {
....
private static final String   SOLVER_CONFIG    = "/ServiceDeliverySolverConfig.xml";
....
private Solver createSolver() {
        XmlSolverConfigurer configurer = new XmlSolverConfigurer();
        configurer.configure( SOLVER_CONFIG );
        return configurer.buildSolver();
    }
</code></pre>

<p>The file mentioned in <code>SOLVER_CONFIG</code> lies in the <code>resources</code> directory (<a href="https://github.com/diega/drools-planner-poc/tree/master/src/main/resources" rel="nofollow">see here</a>).</p>

<hr>

<p>I tried to do the <strong>same thing</strong>.</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>And there was fail.</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>I understand that <code>main/resources</code> mean something for <strong>Maven builds</strong>. But I am building my project manually.</p>

<p><strong>Question:</strong> How do I implement the same thing (from resources) in my own project? Where must I place the file and what must I specify in the SOLVER_CONFIG?</p>

<hr>

<p>The <a href="http://grepcode.com/file/repository.jboss.org/maven2/org.drools.solver/drools-solver-core/5.0.0.M5/org/drools/solver/config/XmlSolverConfigurer.java#52" rel="nofollow">function itself</a> is implemented as:</p>

<pre><code>public XmlSolverConfigurer configure(String resource) {
    return configure(getClass().getResourceAsStream(resource));
}
</code></pre>
