AspectJ 没有编译

AspectJ not compiling

我正在尝试使用 metrics-aspectj 库 (https://github.com/astefanutti/metrics-aspectj) 让带注释的指标在我的 Dropwizard 应用程序中运行,但我在启动时看到以下异常:

[ERROR] Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.8:compile (default) on project app: AJC compiler errors:
[ERROR] error Missing message: configure.incompatibleComplianceForSource in: org.aspectj.ajdt.ajc.messages
[ERROR] error no sources specified
[ERROR] abort AspectJ Compiler 1.8.7

这是我的 pom 文件中的内容:

<dependency>
  <groupId>io.astefanutti.metrics.aspectj</groupId>
  <artifactId>metrics-aspectj</artifactId>
  <version>1.2.0</version>
</dependency>
<dependency>
  <groupId>org.aspectj</groupId>
  <artifactId>aspectjrt</artifactId>
  <version>1.8.10</version>
</dependency>

  <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>aspectj-maven-plugin</artifactId>
    <version>1.8</version>
    <configuration>
      <source>1.8</source>
      <target>1.8</target>
      <aspectLibraries>
        <aspectLibrary>
          <groupId>io.astefanutti.metrics.aspectj</groupId>
          <artifactId>metrics-aspectj</artifactId>
        </aspectLibrary>
      </aspectLibraries>
    </configuration>
    <executions>
      <execution>
        <goals>
          <goal>compile</goal>
        </goals>
      </execution>
    </executions>
  </plugin>

应用详情

[ERROR] error Missing message: configure.incompatibleComplianceForSource in: org.aspectj.ajdt.ajc.messages

将通过添加

来修复
<complianceLevel>1.8</complianceLevel>

除了<source/> & <target/>

<complianceLevel/> 默认为 1.5 并且 <source/> 1.8 不向后兼容 1.5