Fork me on GitHub

AspectJ Compiler reference: standard options

Mojo's AspectJ Maven Plugin delegates the majority of its arguments to the AspectJ Compiler ("ajc"), which is part of the AspectJ binary distribution. For convenience, the help text and option reference of the AJC is reproduced below verbatim. Relevant options found in the listing below are mirrored in the options of its goals, as defined in the Plugin Documentation page.

For a reference of non-standard AJC options, please refer to AJC Experimental Options.

    AspectJ Compiler 1.8.2

            Usage: <options> <source file | @argfile>..

    AspectJ-specific options:
            -inpath <list>      use classes in dirs and jars/zips in <list> as source
                                (<list> uses platform-specific path delimiter)
        -injars <jarList>   use classes in <jarList> zip files as source
                            (<jarList> uses classpath delimiter)
                            deprecated - use inpath instead.
        -aspectpath <list>  weave aspects in .class files from <list> dirs and jars/zip into sources
                            (<list> uses classpath delimiter)
        -outjar <file>      put output classes in zip file <file>
            -outxml             generate META-INF/aop.xml
            -outxmlfile <file>  specify alternate destination output of -outxml
            -argfile <file>     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 <dirs> compile all .aj and .java files in <dirs>
                            (<dirs> uses classpath delimiter)
        -crossrefs          generate .ajsym file into the output directory
        -parameters         stores formal parameter names of constructors and methods
                            in the generated class file so that the method
                            java.lang.reflect.Executable.getParameters from the Reflection API can retrieve them.
        -emacssym           generate .ajesym symbol files for emacs support
        -Xlint              same as '-Xlint:warning'
        -Xlint:<level>      set default level for crosscutting messages
                            (<level> may be ignore, warning, or error)
        -Xlintfile <file>   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 <directories and zip/jar files separated by ;>
                       specify location for application classes and sources
        -bootclasspath <directories and zip/jar files separated by ;>
                       specify location for system classes
        -d <dir>           destination directory (if omitted, no directory is created)
        -d none            generate no .class files
        -encoding <enc>    specify custom encoding for all sources. Each file/directory can override it
                           when suffixed with '['<enc>']' (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 <version>  set source level: 1.3 to 1.8 (or 5, 5.0, etc)
        -target <version>  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:<warnings separated by ,>    enable exactly the listed warnings
        -warn:+<warnings separated by ,>   enable additional warnings
        -warn:-<warnings separated by ,>   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-<n>$
            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(<tags separated by |>) 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