title: Maven 2.2.1: [Warning] JAR will be empty - no content was marked for inclusion
body: <p>Maven 2.2.1
  JDK - 1.6.0_45</p>
  
  <p>[WARNING] JAR will be empty - no content was marked for inclusion!
  BUILD SUCCESSFUL</p>
  
  <p>But build creates jar with pom.xml <strong>but no class files</strong>.</p>
  
  <p>On the maven source code this exception is thrown only when source directory is not found.</p>
  
  <p><strong>The build is working for all other developers except on my workstation and one more workstation</strong></p>
  
  <p>I have tried all the solutions provided for this issue on stack overflow.</p>
  
  <p>My source directory is <strong>src/java</strong>. 
  I also created src/main/java as source still no result.
  I am calling  mvn -o jar:jar &amp;&amp; call mvn -o antrun:run
  -o is becuase at this point I am testing with some old jars.</p>
  
  <pre><code>&lt;build&gt;
          &lt;sourceDirectory&gt;src/java&lt;/sourceDirectory&gt;
          &lt;resources&gt;
              &lt;resource&gt;
                  &lt;directory&gt;${basedir}/src/java&lt;/directory&gt;
                  &lt;includes&gt;
                      &lt;include&gt;**/*.xml&lt;/include&gt;
                      &lt;include&gt;**/*.properties&lt;/include&gt;
                  &lt;/includes&gt;
              &lt;/resource&gt;
          &lt;/resources&gt;
          &lt;testResources&gt;
              &lt;testResource&gt;
                  &lt;directory&gt;${basedir}/src/test/resources&lt;/directory&gt;
                  &lt;includes&gt;
                      &lt;include&gt;**/*.properties&lt;/include&gt;
                      &lt;include&gt;**/*.xml&lt;/include&gt;
                  &lt;/includes&gt;
              &lt;/testResource&gt;
          &lt;/testResources&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;configuration&gt;
                      &lt;debug&gt;true&lt;/debug&gt;
                      &lt;optimize&gt;false&lt;/optimize&gt;
                      &lt;showDeprecation&gt;true&lt;/showDeprecation&gt;
                      &lt;source&gt;1.5&lt;/source&gt;
                      &lt;target&gt;1.5 &lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
                  &lt;configuration&gt;
                      &lt;excludes&gt;
                          &lt;exclude&gt;test*/temp/*.java&lt;/exclude&gt;
                          &lt;exclude&gt;test*/support/*.java&lt;/exclude&gt;
                          &lt;exclude&gt;test*/debug/*.java&lt;/exclude&gt;
                      &lt;/excludes&gt;
                      &lt;includes&gt;
                          &lt;include&gt;test*/**/AllTests.java&lt;/include&gt;
                      &lt;/includes&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;artifactId&gt;maven-antrun-plugin&lt;/artifactId&gt;
                  &lt;version&gt;1.7&lt;/version&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;id&gt;default-cli&lt;/id&gt;
                          &lt;phase&gt;install&lt;/phase&gt;
                          &lt;configuration&gt;
                              &lt;target&gt;
                                  &lt;copy file="${project.build.directory}/${artifactId}-${version}.jar"
                                      todir="${user.home}/.m2/repository/${groupId}/${artifactId}/${version}" /&gt;
                              &lt;/target&gt;
                          &lt;/configuration&gt;
                          &lt;goals&gt;
                              &lt;goal&gt;run&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  </code></pre>