title: Classpath messages_xx.properties files not included in JAR
body: <p>I've run into some problems when practicing with Maven in IntelliJ and somehow the resource files in my class path never gets included in the built JAR.</p>
  
  <p>My module structure:</p>
  
  <pre><code>src/main/java/com/abc/Main.class                
  src/main/java/com/abc/Messages.class            
  src/main/java/com/abc/messages_en.properties    the not included resource files.
  src/main/java/com/abc/messages_es.properties    
  src/main/resources/                             misc resources
  </code></pre>
  
  <p>Project builds successfully, but when I run the JAR file, I would receive a error message as below. And when I unpacked the JAR file, the messages_xx.properties files are missing. </p>
  
  <pre><code>Exception in thread "main" java.util.MissingResourceException: Can't find bundle for base name com.abc.messages, locale en
          at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1564)
          at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1387)
          at java.util.ResourceBundle.getBundle(ResourceBundle.java:845)
          at org.jis.Messages.&lt;init&gt;(Messages.java:42)
          at org.jis.Main.main(Main.java:205)
  </code></pre>
  
  <p>My pom.xml:</p>
  
  <pre><code>&lt;build&gt;
    &lt;plugins&gt;
      &lt;plugin&gt;
        &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
        &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
        &lt;version&gt;2.6&lt;/version&gt;
        &lt;configuration&gt;
          &lt;includes&gt;
            &lt;include&gt;${basedir}/src/main/java/com/abc/*.properties&lt;/include&gt;
          &lt;/includes&gt;
          &lt;archive&gt;
            &lt;manifest&gt;
              &lt;mainClass&gt;com.abc.Main&lt;/mainClass&gt;
              &lt;addClasspath&gt;true&lt;/addClasspath&gt;
            &lt;/manifest&gt;
          &lt;/archive&gt;
        &lt;/configuration&gt;
      &lt;/plugin&gt;
    &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p>Came across many similar threads on SO but the solutions don't seem to fit my case. Any suggestions what's happening here? I've been trying to figure out why this happened for a while now but haven't found an answer yet. It would be great if someone could give me some hints. Thanks a lot.</p>