我在Java8项目中通过其插件使用AspectJ,在我的pom.xml文件中使用此配置:
<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>
我收到一些警告,如下所示:
[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
但由于缺少文件/行信息,它们无用。 我不认为我使用任何关于Maven记录格式的特殊定制,这可能会吞噬我感兴趣的环境。 这是默认的ajc日志记录吗?它可以定制吗?
答案 0 :(得分:0)
我认为这是AspectJ Maven插件中的一个缺点,需要解决。我刚为它创建了一个ticket。请观看它以便及时了解最新进展。
更新:此问题已在2014年9月14日发布的AspectJ Maven插件版本1.7中得到修复。