title: mvn clean compile package is not including src/main/java files in the build
body: <p>I have generated jar files before with maven and never faced this strange issue which I am facing with my current project.</p>
  
  <p>It's a spring project having following <code>pom.xml</code>:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;com.example&lt;/groupId&gt;
      &lt;artifactId&gt;SAMPLE_AOP&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
  
      &lt;name&gt;SAMPLE_AOP&lt;/name&gt;
      &lt;description&gt;Spring boot project using AspectJ library for adding behavior without modifying existing caps backend micro-services.&lt;/description&gt;
  
      &lt;parent&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
          &lt;version&gt;2.0.3.RELEASE&lt;/version&gt;
          &lt;relativePath /&gt; &lt;!-- lookup parent from repository --&gt;
      &lt;/parent&gt;
  
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
          &lt;java.version&gt;1.8&lt;/java.version&gt;
          &lt;log4j.version&gt;1.2.17&lt;/log4j.version&gt;
      &lt;/properties&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-aop&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;log4j&lt;/groupId&gt;
              &lt;artifactId&gt;log4j&lt;/artifactId&gt;
              &lt;version&gt;${log4j.version}&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-aspects&lt;/artifactId&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.aspectj&lt;/groupId&gt;
              &lt;artifactId&gt;aspectjrt&lt;/artifactId&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;sourceDirectory&gt;src&lt;/sourceDirectory&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
              &lt;/plugin&gt;
  
  
              &lt;plugin&gt;
                  &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                  &lt;configuration&gt;
                      &lt;source&gt;1.8&lt;/source&gt;
                      &lt;target&gt;1.8&lt;/target&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
                  &lt;artifactId&gt;aspectj-maven-plugin&lt;/artifactId&gt;
                  &lt;!-- Full configuration to configure each friendly parameters --&gt;
                  &lt;configuration&gt;
                      &lt;complianceLevel&gt;1.8&lt;/complianceLevel&gt;
                      &lt;source&gt;1.8&lt;/source&gt;
                      &lt;target&gt;1.8&lt;/target&gt;
                      &lt;showWeaveInfo&gt;true&lt;/showWeaveInfo&gt;
                      &lt;verbose&gt;true&lt;/verbose&gt;
                      &lt;Xlint&gt;ignore&lt;/Xlint&gt;
                      &lt;encoding&gt;UTF-8 &lt;/encoding&gt;
                  &lt;/configuration&gt;
                  &lt;executions&gt;
                      &lt;execution&gt;
                          &lt;goals&gt;
                              &lt;!-- use this goal to weave all your main classes --&gt;
                              &lt;goal&gt;compile&lt;/goal&gt;
                              &lt;!-- use this goal to weave all your test classes --&gt;
                              &lt;goal&gt;test-compile&lt;/goal&gt;
                          &lt;/goals&gt;
                      &lt;/execution&gt;
                  &lt;/executions&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
  
  &lt;/project&gt;
  </code></pre>
  
  <p>And I am building using the following command:</p>
  
  <pre><code>mvn clean compile package
  </code></pre>
  
  <p>Which simply includes some other dependencies without the actual code under <code>src/main/java</code>.</p>
  
  <p>Please ignore the jar-with-dependencies part of the pom.xml, I do not want the dependencies to be packaged in my jar. I am not sure what I am missing here, Could you please point out?</p>
  
  <p>Also, I checked in the project's build path, I could see that src/main/java is recognized as source folder and I have also explicitly mentioned it in <code>&lt;sourceDirectory/&gt;</code> tag in pom.xml.</p>
  
  <p>Maven output:</p>
  
  <pre><code>[INFO] Scanning for projects...
  [WARNING] 
  [WARNING] Some problems were encountered while building the effective model for com.example:SAMPLE_AOP:jar:0.0.1-SNAPSHOT
  [WARNING] 'build.plugins.plugin.version' for org.codehaus.mojo:aspectj-maven-plugin is missing. @ line 71, column 12
  [WARNING] 
  [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
  [WARNING] 
  [WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
  [WARNING] 
  [INFO] 
  [INFO] ----------------------&lt; com.example:SAMPLE_AOP &gt;----------------------
  [INFO] Building SAMPLE_AOP 0.0.1-SNAPSHOT
  [INFO] --------------------------------[ jar ]---------------------------------
  [INFO] 
  [INFO] --- maven-clean-plugin:3.0.0:clean (default-clean) @ SAMPLE_AOP ---
  [INFO] Deleting C:\Users\user\Documents\workspace-sts-3.9.5.RELEASE\SAMPLE_AOP\target
  [INFO] 
  [INFO] --- maven-resources-plugin:3.0.1:resources (default-resources) @ SAMPLE_AOP ---
  [INFO] Using 'UTF-8' encoding to copy filtered resources.
  [INFO] Copying 1 resource
  [INFO] Copying 1 resource
  [INFO] 
  [INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ SAMPLE_AOP ---
  [INFO] Changes detected - recompiling the module!
  [INFO] Compiling 7 source files to C:\Users\user\Documents\workspace-sts-3.9.5.RELEASE\SAMPLE_AOP\target\classes
  [INFO] /C:/Users/user/Documents/workspace-sts-3.9.5.RELEASE/SAMPLE_AOP/src/main/java/com.sample/AnnotationHelper.java: C:\Users\user\Documents\workspace-sts-3.9.5.RELEASE\SAMPLE_AOP\src\main\java\com.sample\AnnotationHelper.java uses unchecked or unsafe operations.
  [INFO] /C:/Users/user/Documents/workspace-sts-3.9.5.RELEASE/SAMPLE_AOP/src/main/java/com.sample/AnnotationHelper.java: Recompile with -Xlint:unchecked for details.
  [INFO] 
  [INFO] --- aspectj-maven-plugin:1.11:compile (default) @ SAMPLE_AOP ---
  [INFO] Showing AJC message detail for messages of types: [error, warning, fail]
  [INFO] Join point 'method-execution(void com.sample.Application.testing())' in Type 'com.sample.Application' (Application.java:13) advised by around advice from 'com.sample.aspect.LoggingAspect' (LoggingAspect.java:43)
  [INFO] Join point 'method-execution(void com.sample.Application.testString())' in Type 'com.sample.Application' (Application.java:20) advised by around advice from 'com.sample.aspect.LoggingAspect' (LoggingAspect.java:43)
  [INFO] Join point 'method-call(void com.sample.Application.testing())' in Type 'com.sample.Application' (Application.java:27) advised by around advice from 'com.sample.aspect.LoggingAspect' (LoggingAspect.java:43)
  [INFO] 
  [INFO] --- maven-resources-plugin:3.0.1:resources (default-resources) @ SAMPLE_AOP ---
  [INFO] Using 'UTF-8' encoding to copy filtered resources.
  [INFO] Copying 1 resource
  [INFO] Copying 1 resource
  [INFO] 
  [INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ SAMPLE_AOP ---
  [INFO] Changes detected - recompiling the module!
  [INFO] Compiling 7 source files to C:\Users\user\Documents\workspace-sts-3.9.5.RELEASE\SAMPLE_AOP\target\classes
  [INFO] /C:/Users/user/Documents/workspace-sts-3.9.5.RELEASE/SAMPLE_AOP/src/main/java/com.sample/AnnotationHelper.java: C:\Users\user\Documents\workspace-sts-3.9.5.RELEASE\SAMPLE_AOP\src\main\java\com.sample\AnnotationHelper.java uses unchecked or unsafe operations.
  [INFO] /C:/Users/user/Documents/workspace-sts-3.9.5.RELEASE/SAMPLE_AOP/src/main/java/com.sample/AnnotationHelper.java: Recompile with -Xlint:unchecked for details.
  [INFO] 
  [INFO] --- aspectj-maven-plugin:1.11:compile (default) @ SAMPLE_AOP ---
  [INFO] No modifications found skipping aspectJ compile
  [INFO] 
  [INFO] --- maven-resources-plugin:3.0.1:testResources (default-testResources) @ SAMPLE_AOP ---
  [INFO] Using 'UTF-8' encoding to copy filtered resources.
  [INFO] skip non existing resourceDirectory C:\Users\user\Documents\workspace-sts-3.9.5.RELEASE\SAMPLE_AOP\src\test\resources
  [INFO] 
  [INFO] --- maven-compiler-plugin:3.7.0:testCompile (default-testCompile) @ SAMPLE_AOP ---
  [INFO] Nothing to compile - all classes are up to date
  [INFO] 
  [INFO] --- aspectj-maven-plugin:1.11:test-compile (default) @ SAMPLE_AOP ---
  [WARNING] No sources found skipping aspectJ compile
  [INFO] 
  [INFO] --- maven-surefire-plugin:2.21.0:test (default-test) @ SAMPLE_AOP ---
  [INFO] No tests to run.
  [INFO] 
  [INFO] --- maven-jar-plugin:3.0.2:jar (default-jar) @ SAMPLE_AOP ---
  [INFO] Building jar: C:\Users\user\Documents\workspace-sts-3.9.5.RELEASE\SAMPLE_AOP\target\SAMPLE_AOP-0.0.1-SNAPSHOT.jar
  [INFO] 
  [INFO] --- spring-boot-maven-plugin:2.0.3.RELEASE:repackage (default) @ SAMPLE_AOP ---
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD SUCCESS
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 01:04 min
  [INFO] Finished at: 2018-08-05T21:48:14+05:30
  [INFO] ------------------------------------------------------------------------
  </code></pre>