title: How am I supposed to choose the location of config files in maven project
body: <p>I am building a command line tool which relies on some configuration files. </p>
  
  <p>On development, I put those files under <code>src/main/resources</code>, and accessed by <code>getClass().getResourceAsStream("/config-file-name")</code>, which works well.</p>
  
  <p>I choose maven-assembly-plugin to build the jar with all dependencies.</p>
  
  <pre><code>    &lt;plugin&gt;
              &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
              &lt;configuration&gt;
                  &lt;archive&gt;
                      &lt;manifest&gt;
                          &lt;mainClass&gt;com.myproject.Scheduler&lt;/mainClass&gt;
                      &lt;/manifest&gt;
                  &lt;/archive&gt;
                  &lt;descriptorRefs&gt;
                      &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;
                  &lt;/descriptorRefs&gt;
              &lt;/configuration&gt;
              &lt;executions&gt;
                 &lt;execution&gt;
                     &lt;id&gt;make-my-jar-with-dependencies&lt;/id&gt;
                     &lt;phase&gt;package&lt;/phase&gt;
                     &lt;goals&gt;
                         &lt;goal&gt;single&lt;/goal&gt;
                     &lt;/goals&gt;
                 &lt;/execution&gt;
              &lt;/executions&gt;
      &lt;/plugin&gt;       
  </code></pre>
  
  <p>The configuration files are all wrapped in jar, but I want to separate them.</p>
  
  <p>So, I add following config,</p>
  
  <pre><code>    &lt;resources&gt;
          &lt;resource&gt;
              &lt;directory&gt;src/main/resources&lt;/directory&gt;
              &lt;includes&gt;
                  &lt;include&gt;conf.properties&lt;/include&gt;
              &lt;/includes&gt;
              &lt;filtering&gt;true&lt;/filtering&gt;
              &lt;excludes&gt;
                  &lt;exclude&gt;&lt;/exclude&gt;
              &lt;/excludes&gt;
          &lt;targetPath&gt;..&lt;/targetPath&gt;             
          &lt;/resource&gt;
      &lt;/resources&gt;
  </code></pre>
  
  <p>After done this, configuration files are along side with jar instead of wrapped in jar.</p>
  
  <p>But my code can't access the files now.</p>
  
  <p>Do I need to change my way of accessing the files in code?</p>
  
  <p>Or should I need to not put those files in <code>src/main/resources/</code>, any alternative?</p>
  
  <p>If someone knows, please help.</p>
  
  <p>Thanks.</p>
  
  <hr>
  
  <p>Update: Finally, I give up using maven resource file, instead, I set the file path to the same path as jar by default, everything works well except Eclipse complains. </p>
  
  <p>Since I want to move the config file out of jar, and don't want it to be in target/classes folder, so I use <code>&lt;targetPath&gt;..&lt;/targetPath&gt;</code> to move the configure file to the same directory as jar file.</p>
  
  <p>When I re-generate eclipse project settings, Eclipse says: Cannot nest output folder "project/target/test-classes" inside output folder "project/target".</p>
  
  <p>Anybody help me?</p>