2016-07-23 2 views
7

で、ファイルの失敗:のmaven-pluginの-プラグイン:記述子の目標は、ビルドプリントエラーをプラグインMavenを開発している間

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-plugin-plugin:3.3:descriptor (default-descriptor) on project default-method-demo: Execution default-descriptor of goal org.apache.maven.plugins:maven-plugin-plugin:3.3:descriptor failed: syntax error @[8,1] in file:/full/path/to/project/default-method/src/main/java/org/example/Iface.java -> [Help 1] 

でもファイルIface.javaがコンパイルされていることをけれども。

Iface.java:問題の原因は何pom.xml

<packaging>maven-plugin</packaging> 

<build> 
    <plugins> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <version>3.3</version> 
      <configuration> 
       <source>1.8</source> 
       <target>1.8</target> 
      </configuration> 
     </plugin> 
    </plugins> 
</build> 

<dependencies> 
    <dependency> 
     <groupId>org.apache.maven</groupId> 
     <artifactId>maven-plugin-api</artifactId> 
     <version>3.0.5</version> 
    </dependency> 
    <dependency> 
     <groupId>org.apache.maven.plugin-tools</groupId> 
     <artifactId>maven-plugin-annotations</artifactId> 
     <version>3.4</version> 
     <scope>provided</scope> 
    </dependency> 
</dependencies> 

から

package org.example; 

public interface Iface { 
    default String getString() { 
     return "string"; 
    } 
} 

?どのように修正することができますか?

答えて

13

問題は、プラグイン記述子を生成するmaven-plugin-pluginがデフォルトメソッドを使用してJava 8インタフェースを解析するのが困難だったことです。

それが明示的にpom.xmlに新しいプラグインのバージョンを示すことによって固定することができます。

<build> 
    <plugins> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-plugin-plugin</artifactId> 
      <version>3.4</version> 
     </plugin> 
     <!-- other plugins --> 
    </plugins> 
</build> 

それとも実装するクラスに自分の体を動かすことで、デフォルトの方法を回避することによって

関連するバグ:MPLUGIN-272

関連する問題