2017-11-03 8 views
0

私はちょうど作業するプロジェクトを受け取り、インストールされているすべてのプラグインと依存関係を取得するために「mvn clean install」を実行しようとしていますこのエラーが発生しています。何か案は?org.apache.maven.lifecycle.LifecycleExecutionExceptionをビルドするために私のJavaプロジェクトを取得できません:

org.apache.maven.lifecycle.LifecycleExecutionException:mavenの-コンパイラプラグイン:3.1:プロジェクトEHS_ITO_BACKEND上(デフォルトコンパイル)コンパイル:コンパイルの失敗 いいえゴールorg.apache.maven.pluginsの実行に失敗しましたコンパイラはこの環境で提供されます。おそらくあなたはJDKではなくJREで実行していますか?

Environment Variables

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>D</groupId> 
    <version>0.0.1-SNAPSHOT</version> 
    <packaging>war</packaging> 
    <build> 
    <sourceDirectory>src</sourceDirectory> 
    <finalName>${project.artifactId}</finalName> 
    <plugins> 
     <plugin> 
     <artifactId>maven-compiler-plugin</artifactId> 
     <version>3.1</version> 
     <configuration> 
      <source>1.9</source> 
      <target>1.9</target> 
     </configuration> 
     </plugin> 
     <plugin> 
     <artifactId>maven-war-plugin</artifactId> 
     <version>2.4</version> 
     <configuration> 
      <warSourceDirectory>WebContent</warSourceDirectory> 
      <failOnMissingWebXml>false</failOnMissingWebXml> 
     </configuration> 
     </plugin> 
    </plugins> 
    </build> 

    <dependencies> 
     <dependency> 
      <groupId>asm</groupId> 
      <artifactId>asm</artifactId> 
      <version>3.3.1</version> 
     </dependency> 
     <dependency> 
      <groupId>com.sun.jersey</groupId> 
      <artifactId>jersey-bundle</artifactId> 
      <version>1.19</version> 
     </dependency> 
     <dependency> 
      <groupId>org.json</groupId> 
      <artifactId>json</artifactId> 
      <version>20140107</version> 
     </dependency> 
     <dependency> 
      <groupId>com.sun.jersey</groupId> 
      <artifactId>jersey-server</artifactId> 
      <version>1.19</version> 
     </dependency> 
     <dependency> 
      <groupId>com.sun.jersey</groupId> 
      <artifactId>jersey-core</artifactId> 
      <version>1.19</version> 
     </dependency> 
     <dependency> 
      <groupId>com.sun.jersey.contribs</groupId> 
      <artifactId>jersey-multipart</artifactId> 
      <version>1.19</version> 
     </dependency> 
     <dependency> 
      <groupId>org.jvnet</groupId> 
      <artifactId>mimepull</artifactId> 
      <version>1.6</version> 
     </dependency> 
     <dependency> 
     <groupId>com.sun.jersey</groupId> 
     <artifactId>jersey-servlet</artifactId> 
     <version>1.19</version> 
    </dependency> 

     <dependency> 
      <groupId>mysql</groupId> 
      <artifactId>mysql-connector-java</artifactId> 
      <version>5.1.35</version> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.poi</groupId> 
      <artifactId>poi</artifactId> 
      <version>3.10-FINAL</version> 
     </dependency> 
     <dependency> 
      <groupId>org.apache.poi</groupId> 
      <artifactId>poi-ooxml</artifactId> 
      <version>3.9</version> 
     </dependency> 
    </dependencies> 
    <artifactId></artifactId> 
</project> 

答えて

0

Mavenは、プロジェクトをコンパイルするためにはJDKが必要です。 Mavenはこのメッセージに基づいてJAVA_HOMEを使用してこのメ​​ッセージに基づいてJDKを検索します。

コンパイルエラーこの環境ではコンパイラは提供されません。おそらくあなたはJDKではなくJREで実行していますか?

... JAVA_HOMEが存在しないか、JDKを指していません。

mvn -versionを実行すると、Javaで何を使用しているかがわかります。あなたは、あなたがあなたのJAVA_HOMEを設定する必要があることを表示されない場合

Java version: 1.8.0_51, vendor: Oracle Corporation 
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/jre 

:あなたこのように表示されます。 the docsから:Unixでは

:Windowsの

Right click My Computer and select Properties. 

On the Advanced tab, select Environment Variables, and then edit JAVA_HOME to point to where the JDK software is located, for example, C:\Program Files\Java\jdk1.6.0_02. 

export JAVA_HOME=jdk-install-dir 

関連する問題