AJC throws error no sources specified when compiling in Eclipse
<p>I am trying to compile a Spring-generated Maven project in Eclipse with maven-eclipse-plugin.</p>

<p>Maven throws the following error during <code>compile</code>:</p>

<pre><code>[ERROR] Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.8:test-compile (default) on project kkos01: AJC compiler errors:
[ERROR] error no sources specified
[ERROR] abort AspectJ Compiler 1.8.0
[ERROR] 
[ERROR] Usage: &lt;options&gt; &lt;source file | @argfile&gt;..
</code></pre>

<p>It seems that somehow the <code>maven-eclipse-plugin</code> does not hand over the source files to <code>ajc</code>.</p>

<p>Note: most Aspects where generated by <code>spring-roo</code>.</p>

<p>Here's my <strong>pom.xml</strong>:</p>

<pre><code>&lt;project&gt;
    &lt;properties&gt;
        &lt;aspectj.version&gt;1.8.0&lt;/aspectj.version&gt;
        &lt;java.version&gt;1.8&lt;/java.version&gt;
        &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
    &lt;/properties&gt;
...
    &lt;build&gt;
    &lt;plugins&gt;
        &lt;plugin&gt;
            &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
            &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
            &lt;version&gt;2.4&lt;/version&gt;
            &lt;configuration&gt;
                &lt;source&gt;${java.version}&lt;/source&gt;
                &lt;target&gt;${java.version}&lt;/target&gt;
                &lt;complianceLevel&gt;${java.version}&lt;/complianceLevel&gt;
                &lt;encoding&gt;${project.build.sourceEncoding}&lt;/encoding&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;version&gt;1.8&lt;/version&gt;
            &lt;dependencies&gt;
                &lt;dependency&gt;
                    &lt;groupId&gt;org.aspectj&lt;/groupId&gt;
                    &lt;artifactId&gt;aspectjrt&lt;/artifactId&gt;
                    &lt;version&gt;${aspectj.version}&lt;/version&gt;
                &lt;/dependency&gt;
                &lt;dependency&gt;
                    &lt;groupId&gt;org.aspectj&lt;/groupId&gt;
                    &lt;artifactId&gt;aspectjtools&lt;/artifactId&gt;
                    &lt;version&gt;${aspectj.version}&lt;/version&gt;
                &lt;/dependency&gt;
            &lt;/dependencies&gt;
            &lt;executions&gt;
                &lt;execution&gt;
                    &lt;phase&gt;process-sources&lt;/phase&gt;
                    &lt;goals&gt;
                        &lt;goal&gt;compile&lt;/goal&gt;
                        &lt;goal&gt;test-compile&lt;/goal&gt;
                    &lt;/goals&gt;
                &lt;/execution&gt;
            &lt;/executions&gt;
            &lt;configuration&gt;
                &lt;outxml&gt;true&lt;/outxml&gt;
                &lt;aspectLibraries&gt;
                    &lt;aspectLibrary&gt;
                        &lt;groupId&gt;org.springframework&lt;/groupId&gt;
                        &lt;artifactId&gt;spring-aspects&lt;/artifactId&gt;
                    &lt;/aspectLibrary&gt;
                &lt;/aspectLibraries&gt;
                &lt;complianceLevel&gt;${java.version}&lt;/complianceLevel&gt;
                &lt;source&gt;${java.version}&lt;/source&gt;
                &lt;target&gt;${java.version}&lt;/target&gt;
                &lt;forceAjcCompile&gt;true&lt;/forceAjcCompile&gt;
            &lt;/configuration&gt;
        &lt;/plugin&gt;
...
        &lt;plugin&gt;
            &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
            &lt;artifactId&gt;maven-eclipse-plugin&lt;/artifactId&gt;
            &lt;version&gt;2.7&lt;/version&gt;
            &lt;configuration&gt;
                &lt;downloadSources&gt;true&lt;/downloadSources&gt;
                &lt;downloadJavadocs&gt;false&lt;/downloadJavadocs&gt;
                &lt;wtpversion&gt;2.0&lt;/wtpversion&gt;
                &lt;additionalBuildcommands&gt;
                    &lt;buildCommand&gt;
                        &lt;name&gt;org.eclipse.ajdt.core.ajbuilder&lt;/name&gt;
                        &lt;arguments&gt;
                            &lt;aspectPath&gt;org.springframework.aspects&lt;/aspectPath&gt;
                        &lt;/arguments&gt;
                    &lt;/buildCommand&gt;
                    &lt;buildCommand&gt;
                        &lt;name&gt;org.springframework.ide.eclipse.core.springbuilder&lt;/name&gt;
                    &lt;/buildCommand&gt;
                &lt;/additionalBuildcommands&gt;
                &lt;additionalProjectnatures&gt;
                    &lt;projectnature&gt;org.eclipse.ajdt.ui.ajnature&lt;/projectnature&gt;
                    &lt;projectnature&gt;com.springsource.sts.roo.core.nature&lt;/projectnature&gt;
                    &lt;projectnature&gt;org.springframework.ide.eclipse.core.springnature&lt;/projectnature&gt;
                &lt;/additionalProjectnatures&gt;
            &lt;/configuration&gt;
        &lt;/plugin&gt;
    &lt;/plugins&gt;
    &lt;/build&gt;
&lt;/project&gt;
</code></pre>

<p>Full error output:</p>

<pre><code>[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building kkos01 0.1.0.BUILD-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-eclipse-plugin:2.7:clean (default-cli) @ kkos01 ---
[INFO] Deleting file: .project
[INFO] Deleting file: .classpath
[INFO] Deleting file: .wtpmodules
[INFO] Deleting file: .component
[INFO] Deleting file: org.eclipse.wst.common.component
[INFO] Deleting file: org.eclipse.wst.common.project.facet.core.xml
[INFO] Deleting file: org.eclipse.jdt.core.prefs
[INFO] Deleting file: org.eclipse.ajdt.ui.prefs
[INFO] 
[INFO] &gt;&gt;&gt; maven-eclipse-plugin:2.7:eclipse (default-cli) &gt; generate-resources @ kkos01 &gt;&gt;&gt;
[INFO] 
[INFO] --- aspectj-maven-plugin:1.8:compile (default) @ kkos01 ---
[INFO] Showing AJC message detail for messages of types: [error, warning, fail]
[WARNING] can't find type org.w3c.dom.ElementTraversal whilst determining signatures of call or execution join point for java.lang.String com.gargoylesoftware.htmlunit.html.HtmlElement.getAttribute(java.lang.String), this may cause a pointcut to fail to match at this join point 
when weaving type kk.os.scrape.ScreenCaptureHtmlUnitDriver
when weaving classes 
when weaving 
when batch building BuildConfig[null] #Files=1315 AopXmls=#0
 [Xlint:cantFindTypeAffectingJPMatch]
    C:\sync\workspace-kkos\kkos01\src\main\java\kk\os\scrape\ScreenCaptureHtmlUnitDriver.java:0
(no source information available)

[WARNING] advice defined in org.springframework.mock.staticmock.AnnotationDrivenStaticEntityMockingControl has not been applied [Xlint:adviceDidNotMatch]
    C:\sync\workspace-kkos\kkos01\org\springframework\mock\staticmock\AnnotationDrivenStaticEntityMockingControl.aj:117

[INFO] 
[INFO] --- aspectj-maven-plugin:1.8:test-compile (default) @ kkos01 ---
[INFO] Showing AJC message detail for messages of types: [error, warning, fail]
[ERROR] no sources specified
    &lt;unknown source file&gt;:&lt;no line information&gt;

[ERROR] AspectJ Compiler 1.8.0

    Usage: &lt;options&gt; &lt;source file | @argfile&gt;..

AspectJ-specific options:
    -inpath &lt;list&gt;      use classes in dirs and jars/zips in &lt;list&gt; as source
                        (&lt;list&gt; uses platform-specific path delimiter)
    -injars &lt;jarList&gt;   use classes in &lt;jarList&gt; zip files as source
                        (&lt;jarList&gt; uses classpath delimiter)
                        deprecated - use inpath instead.
    -aspectpath &lt;list&gt;  weave aspects in .class files from &lt;list&gt; dirs and jars/zip into sources
                        (&lt;list&gt; uses classpath delimiter)
    -outjar &lt;file&gt;      put output classes in zip file &lt;file&gt;
    -outxml             generate META-INF/aop.xml
    -outxmlfile &lt;file&gt;  specify alternate destination output of -outxml
    -argfile &lt;file&gt;     specify line-delimited list of source files
    -showWeaveInfo      display information about weaving
    -incremental        continuously-running compiler, needs -sourceroots
                        (reads stdin: enter to recompile and 'q' to quit)
    -sourceroots &lt;dirs&gt; compile all .aj and .java files in &lt;dirs&gt;
                        (&lt;dirs&gt; uses classpath delimiter)
    -crossrefs          generate .ajsym file into the output directory
    -emacssym           generate .ajesym symbol files for emacs support
    -Xlint              same as '-Xlint:warning'
    -Xlint:&lt;level&gt;      set default level for crosscutting messages
                        (&lt;level&gt; may be ignore, warning, or error)
    -Xlintfile &lt;file&gt;   specify properties file to set per-message levels
                        (cf org/aspectj/weaver/XlintDefault.properties)
    -X                  print help on non-standard options

Standard Eclipse compiler options:
 Options enabled by default are prefixed with '+'

 Classpath options:
    -cp -classpath &lt;directories and zip/jar files separated by ;&gt;
                       specify location for application classes and sources
    -bootclasspath &lt;directories and zip/jar files separated by ;&gt;
                       specify location for system classes
    -d &lt;dir&gt;           destination directory (if omitted, no directory is created)
    -d none            generate no .class files
    -encoding &lt;enc&gt;    specify custom encoding for all sources. Each file/directory can override it
                       when suffixed with '['&lt;enc&gt;']' (e.g. X.java[utf8])

 Compliance options:
    -1.3               use 1.3 compliance level (implicit -source 1.3 -target 1.1)
    -1.4             + use 1.4 compliance level
    -1.5 -5 -5.0       use 1.5 compliance (-source 1.5 -target 1.5)
    -1.6 -6 -6.0       use 1.6 compliance (-source 1.6 -target 1.6)
    -1.7 -7 -7.0       use 1.7 compliance (-source 1.7 -target 1.7)
    -1.8 -8 -8.0       use 1.8 compliance (-source 1.8 -target 1.8)
    -source &lt;version&gt;  set source level: 1.3 to 1.8 (or 5, 5.0, etc)
    -target &lt;version&gt;  set classfile target: 1.1 to 1.8 (or 5, 5.0, etc)

 Warning options:
    -deprecation         + deprecation outside deprecated code
    -nowarn -warn:none disable all warnings
    -warn:&lt;warnings separated by ,&gt;    enable exactly the listed warnings
    -warn:+&lt;warnings separated by ,&gt;   enable additional warnings
    -warn:-&lt;warnings separated by ,&gt;   disable specific warnings
      allDeadCode          dead code including trivial if(DEBUG) check
      allDeprecation       deprecation including inside deprecated code
      allJavadoc           invalid or missing javadoc
      allOver-ann          all missing @Override annotations
      all-static-method    all method can be declared as static warnings
      assertIdentifier   + 'assert' used as identifier
      boxing               autoboxing conversion
      charConcat         + char[] in String concat
      compareIdentical   + comparing identical expressions
      conditionAssign      possible accidental boolean assignment
      constructorName    + method with constructor name
      deadCode           + dead code excluding trivial if (DEBUG) check
      dep-ann              missing @Deprecated annotation
      deprecation        + deprecation outside deprecated code
      discouraged        + use of types matching a discouraged access rule
      emptyBlock           undocumented empty block
      enumIdentifier       'enum' used as identifier
      enumSwitch           incomplete enum switch
      fallthrough          possible fall-through case
      fieldHiding          field hiding another variable
      finalBound           type parameter with final bound
      finally            + finally block not completing normally
      forbidden          + use of types matching a forbidden access rule
      hashCode              missing hashCode() method when overriding equals()
      hiding               macro for fieldHiding, localHiding, typeHiding and
                           maskedCatchBlock
      includeAssertNull    raise null warnings for variables
                           that got tainted in an assert expression
      indirectStatic       indirect reference to static member
      intfAnnotation     + annotation type used as super interface
      intfNonInherited   + interface non-inherited method compatibility
      intfRedundant        find redundant superinterfaces
      javadoc              invalid javadoc
      localHiding          local variable hiding another variable
      maskedCatchBlock   + hidden catch block
      nls                  string literal lacking non-nls tag //$NON-NLS-&lt;n&gt;$
      noEffectAssign     + assignment without effect
      null                 potential missing or redundant null check
      nullDereference    + missing null check
      over-ann             missing @Override annotation (superclass)
      paramAssign          assignment to a parameter
      pkgDefaultMethod   + attempt to override package-default method
      raw                + usage of raw type
      semicolon            unnecessary semicolon, empty statement
      serial             + missing serialVersionUID
      specialParamHiding   constructor or setter parameter hiding a field
      static-method        method can be declared as static
      static-access        macro for indirectStatic and staticReceiver
      staticReceiver     + non-static reference to static member
      super                overriding a method without making a super invocation
      suppress           + enable @SuppressWarnings
                           When used with -err:, it can also silent optional
                           errors and warnings
      syncOverride         missing synchronized in synchr. method override
      syntheticAccess      synthetic access for innerclass
      tasks(&lt;tags separated by |&gt;) tasks identified by tags inside comments
      typeHiding         + type parameter hiding another type
      unavoidableGenericProblems + ignore unavoidable type safety problems
                                   due to raw APIs
      unchecked          + unchecked type operation
      unnecessaryElse      unnecessary else clause
      unqualifiedField     unqualified reference to field
      unused               macro for unusedAllocation, unusedArgument,
                               unusedImport, unusedLabel, unusedLocal,
                               unusedPrivate, unusedThrown, and unusedTypeArgs
      unusedAllocation     allocating an object that is not used
      unusedArgument       unread method parameter
      unusedImport       + unused import declaration
      unusedLabel        + unused label
      unusedLocal        + unread local variable
      unusedPrivate      + unused private member declaration
      unusedThrown         unused declared thrown exception
      unusedTypeArgs     + unused type arguments for method and constructor
      uselessTypeCheck     unnecessary cast/instanceof operation
      varargsCast        + varargs argument need explicit cast
      warningToken       + unsupported or unnecessary @SuppressWarnings

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 26.469 s
[INFO] Finished at: 2016-08-17T19:03:39+02:00
[INFO] Final Memory: 40M/1833M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.8:test-compile (default) on project kkos01: AJC compiler errors:
[ERROR] error no sources specified
[ERROR] abort AspectJ Compiler 1.8.0
[ERROR] 
[ERROR] Usage: &lt;options&gt; &lt;source file | @argfile&gt;..
[ERROR] 
[ERROR] AspectJ-specific options:
[ERROR] -inpath &lt;list&gt;      use classes in dirs and jars/zips in &lt;list&gt; as source
[ERROR] (&lt;list&gt; uses platform-specific path delimiter)
[ERROR] -injars &lt;jarList&gt;   use classes in &lt;jarList&gt; zip files as source
[ERROR] (&lt;jarList&gt; uses classpath delimiter)
[ERROR] deprecated - use inpath instead.
[ERROR] -aspectpath &lt;list&gt;  weave aspects in .class files from &lt;list&gt; dirs and jars/zip into sources
[ERROR] (&lt;list&gt; uses classpath delimiter)
[ERROR] -outjar &lt;file&gt;      put output classes in zip file &lt;file&gt;
[ERROR] -outxml             generate META-INF/aop.xml
[ERROR] -outxmlfile &lt;file&gt;  specify alternate destination output of -outxml
[ERROR] -argfile &lt;file&gt;     specify line-delimited list of source files
[ERROR] -showWeaveInfo      display information about weaving
[ERROR] -incremental        continuously-running compiler, needs -sourceroots
[ERROR] (reads stdin: enter to recompile and 'q' to quit)
[ERROR] -sourceroots &lt;dirs&gt; compile all .aj and .java files in &lt;dirs&gt;
[ERROR] (&lt;dirs&gt; uses classpath delimiter)
[ERROR] -crossrefs          generate .ajsym file into the output directory
[ERROR] -emacssym           generate .ajesym symbol files for emacs support
[ERROR] -Xlint              same as '-Xlint:warning'
[ERROR] -Xlint:&lt;level&gt;      set default level for crosscutting messages
[ERROR] (&lt;level&gt; may be ignore, warning, or error)
[ERROR] -Xlintfile &lt;file&gt;   specify properties file to set per-message levels
[ERROR] (cf org/aspectj/weaver/XlintDefault.properties)
[ERROR] -X                  print help on non-standard options
[ERROR] 
[ERROR] Standard Eclipse compiler options:
[ERROR] Options enabled by default are prefixed with '+'
[ERROR] 
[ERROR] Classpath options:
[ERROR] -cp -classpath &lt;directories and zip/jar files separated by ;&gt;
[ERROR] specify location for application classes and sources
[ERROR] -bootclasspath &lt;directories and zip/jar files separated by ;&gt;
[ERROR] specify location for system classes
[ERROR] -d &lt;dir&gt;           destination directory (if omitted, no directory is created)
[ERROR] -d none            generate no .class files
[ERROR] -encoding &lt;enc&gt;    specify custom encoding for all sources. Each file/directory can override it
[ERROR] when suffixed with '['&lt;enc&gt;']' (e.g. X.java[utf8])
[ERROR] 
[ERROR] Compliance options:
[ERROR] -1.3               use 1.3 compliance level (implicit -source 1.3 -target 1.1)
[ERROR] -1.4             + use 1.4 compliance level
[ERROR] -1.5 -5 -5.0       use 1.5 compliance (-source 1.5 -target 1.5)
[ERROR] -1.6 -6 -6.0       use 1.6 compliance (-source 1.6 -target 1.6)
[ERROR] -1.7 -7 -7.0       use 1.7 compliance (-source 1.7 -target 1.7)
[ERROR] -1.8 -8 -8.0       use 1.8 compliance (-source 1.8 -target 1.8)
[ERROR] -source &lt;version&gt;  set source level: 1.3 to 1.8 (or 5, 5.0, etc)
[ERROR] -target &lt;version&gt;  set classfile target: 1.1 to 1.8 (or 5, 5.0, etc)
[ERROR] 
[ERROR] Warning options:
[ERROR] -deprecation         + deprecation outside deprecated code
[ERROR] -nowarn -warn:none disable all warnings
[ERROR] -warn:&lt;warnings separated by ,&gt;    enable exactly the listed warnings
[ERROR] -warn:+&lt;warnings separated by ,&gt;   enable additional warnings
[ERROR] -warn:-&lt;warnings separated by ,&gt;   disable specific warnings
[ERROR] allDeadCode          dead code including trivial if(DEBUG) check
[ERROR] allDeprecation       deprecation including inside deprecated code
[ERROR] allJavadoc           invalid or missing javadoc
[ERROR] allOver-ann          all missing @Override annotations
[ERROR] all-static-method    all method can be declared as static warnings
[ERROR] assertIdentifier   + 'assert' used as identifier
[ERROR] boxing               autoboxing conversion
[ERROR] charConcat         + char[] in String concat
[ERROR] compareIdentical   + comparing identical expressions
[ERROR] conditionAssign      possible accidental boolean assignment
[ERROR] constructorName    + method with constructor name
[ERROR] deadCode           + dead code excluding trivial if (DEBUG) check
[ERROR] dep-ann              missing @Deprecated annotation
[ERROR] deprecation        + deprecation outside deprecated code
[ERROR] discouraged        + use of types matching a discouraged access rule
[ERROR] emptyBlock           undocumented empty block
[ERROR] enumIdentifier       'enum' used as identifier
[ERROR] enumSwitch           incomplete enum switch
[ERROR] fallthrough          possible fall-through case
[ERROR] fieldHiding          field hiding another variable
[ERROR] finalBound           type parameter with final bound
[ERROR] finally            + finally block not completing normally
[ERROR] forbidden          + use of types matching a forbidden access rule
[ERROR] hashCode              missing hashCode() method when overriding equals()
[ERROR] hiding               macro for fieldHiding, localHiding, typeHiding and
[ERROR] maskedCatchBlock
[ERROR] includeAssertNull    raise null warnings for variables
[ERROR] that got tainted in an assert expression
[ERROR] indirectStatic       indirect reference to static member
[ERROR] intfAnnotation     + annotation type used as super interface
[ERROR] intfNonInherited   + interface non-inherited method compatibility
[ERROR] intfRedundant        find redundant superinterfaces
[ERROR] javadoc              invalid javadoc
[ERROR] localHiding          local variable hiding another variable
[ERROR] maskedCatchBlock   + hidden catch block
[ERROR] nls                  string literal lacking non-nls tag //$NON-NLS-&lt;n&gt;$
[ERROR] noEffectAssign     + assignment without effect
[ERROR] null                 potential missing or redundant null check
[ERROR] nullDereference    + missing null check
[ERROR] over-ann             missing @Override annotation (superclass)
[ERROR] paramAssign          assignment to a parameter
[ERROR] pkgDefaultMethod   + attempt to override package-default method
[ERROR] raw                + usage of raw type
[ERROR] semicolon            unnecessary semicolon, empty statement
[ERROR] serial             + missing serialVersionUID
[ERROR] specialParamHiding   constructor or setter parameter hiding a field
[ERROR] static-method        method can be declared as static
[ERROR] static-access        macro for indirectStatic and staticReceiver
[ERROR] staticReceiver     + non-static reference to static member
[ERROR] super                overriding a method without making a super invocation
[ERROR] suppress           + enable @SuppressWarnings
[ERROR] When used with -err:, it can also silent optional
[ERROR] errors and warnings
[ERROR] syncOverride         missing synchronized in synchr. method override
[ERROR] syntheticAccess      synthetic access for innerclass
[ERROR] tasks(&lt;tags separated by |&gt;) tasks identified by tags inside comments
[ERROR] typeHiding         + type parameter hiding another type
[ERROR] unavoidableGenericProblems + ignore unavoidable type safety problems
[ERROR] due to raw APIs
[ERROR] unchecked          + unchecked type operation
[ERROR] unnecessaryElse      unnecessary else clause
[ERROR] unqualifiedField     unqualified reference to field
[ERROR] unused               macro for unusedAllocation, unusedArgument,
[ERROR] unusedImport, unusedLabel, unusedLocal,
[ERROR] unusedPrivate, unusedThrown, and unusedTypeArgs
[ERROR] unusedAllocation     allocating an object that is not used
[ERROR] unusedArgument       unread method parameter
[ERROR] unusedImport       + unused import declaration
[ERROR] unusedLabel        + unused label
[ERROR] unusedLocal        + unread local variable
[ERROR] unusedPrivate      + unused private member declaration
[ERROR] unusedThrown         unused declared thrown exception
[ERROR] unusedTypeArgs     + unused type arguments for method and constructor
[ERROR] uselessTypeCheck     unnecessary cast/instanceof operation
[ERROR] varargsCast        + varargs argument need explicit cast
[ERROR] warningToken       + unsupported or unnecessary @SuppressWarnings
[ERROR] -&gt; [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
</code></pre>