0

I use AspectJ via its plugin in a Java8 project, with this configuration in my pom.xml file:

    <plugin>
      <groupId>org.codehaus.mojo</groupId>
      <artifactId>aspectj-maven-plugin</artifactId>
      <version>1.6</version>
      <configuration>
        <Xlint>warning</Xlint>
        <XaddSerialVersionUID>true</XaddSerialVersionUID>
        <encoding>UTF-8</encoding>
        <complianceLevel>1.8</complianceLevel>
        <source>1.8</source>
        <target>1.8</target>
        <warn>constructorName,packageDefaultMethod,deprecation,maskedCatchBlocks,unusedLocals,unusedArguments,unusedImports,all</warn>
      </configuration>
      <dependencies>
        <dependency>
          <groupId>org.aspectj</groupId>
          <artifactId>aspectjrt</artifactId>
          <version>1.8.0</version>
        </dependency>
        <dependency>
          <groupId>org.aspectj</groupId>
          <artifactId>aspectjtools</artifactId>
          <version>1.8.0</version>
        </dependency>
      </dependencies>
    </plugin>

I get some warnings such as the following:

[WARNING] Unnecessary @SuppressWarnings("unused")
[WARNING] Non-externalized string literal; it should be followed by //$NON-NLS-<n>$
[WARNING] The import org.acmsl.queryj.metadata.DecoratorFactory is never used
[WARNING] The method buildMetadataManagerKey() from the type AbstractQueryJTemplateContext can potentially be declared as static
[WARNING] The method buildCustomSqlProviderKey() from the type AbstractQueryJTemplateContext can potentially be declared as static
[WARNING] Non-externalized string literal; it should be followed by //$NON-NLS-<n>$
[WARNING] Non-externalized string literal; it should be followed by //$NON-NLS-<n>$
[WARNING] The method retrieveHeaderFromFile(QueryJCommand, FileUtils) from the type AbstractQueryJTemplateContext can potentially be declared as static
[WARNING] The method buildBasePackageNameKey() from the type AbstractQueryJTemplateContext can potentially be declared as static
[WARNING] The method buildRepositoryNameKey() from the type AbstractQueryJTemplateContext can potentially be declared as static
[WARNING] The method buildJndiLocationKey() from the type AbstractQueryJTemplateContext can potentially be declared as static
[WARNING] The method getBooleanValue(QueryJCommand, String) from the type AbstractQueryJTemplateContext can potentially be declared as static
[WARNING] The expression of type Boolean is unboxed into boolean
[WARNING] The method toCsv(List<Attribute<String>>) from the type AbstractQueryJTemplateContext can potentially be declared as static
[WARNING] Non-externalized string literal; it should be followed by //$NON-NLS-<n>$
[WARNING] Empty block should be documented
[WARNING] Empty block should be documented
[WARNING] Redundant specification of type arguments <String, STGroup>
[WARNING] Unnecessary semicolon
[WARNING] The method retrieveUncachedGroup(String, List<String>, STErrorListener, Charset) from the type STUtils can potentially be declared as static
[WARNING] The method PerCommentTabIsaVisitor.visitTabIsa(PerCommentParser.TabIsaContext) is overriding a method without making a super invocation
[WARNING] Non-externalized string literal; it should be followed by //$NON-NLS-<n>$
[WARNING] Unnecessary @SuppressWarnings("unused")
[WARNING] Unnecessary @SuppressWarnings("unused")
[WARNING] The method AbstractBasePerCustomResultTemplate<C>.buildHeader() is overriding a method without making a super invocation

But they're useless since the file/line information is missing. I don't think I'm using any special customization regarding Maven's logging format, which could be swallowing the context I'm interested in. Is this the default ajc logging? Can it be customized?

rydnr
  • 51
  • 3
  • Please accept and upvote my answer, I have even created a ticket for you and made sure the issue in the plugin got resolved. – kriegaex Sep 15 '14 at 10:30

1 Answers1

0

I think this is a shortcoming in AspectJ Maven Plugin which needs to be addressed. I have just created a ticket for it. Please watch it in order to stay updated on the progress.

Update: The issue has been fixed in AspectJ Maven Plugin version 1.7 which was released on 2014-09-14.

kriegaex
  • 63,017
  • 15
  • 111
  • 202