2017-02-14 18 views
1

私は、これは、コードの行である私はEclipseは戦争の成功を構築しますが、Mavenのコマンドcanot

mvn clean install 

を実行すると、それは誤り

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project foo: Compilation failure: Compilation failure: 
[ERROR] /E:/bar/XmlUtils.java:[9,44] package com.sun.xml.internal.bind.marshaller does not exist 
[ERROR] /E:/bar/XmlUtils.java:[11,34] cannot find symbol 
[ERROR] symbol: class CharacterEscapeHandler 
[ERROR] /E:/.../FooServiceImpl.java:[106,44] package com.sun.xml.internal.bind.marshall 

を表示するJava 8 JDK 上でJava 7をコーディングエラー

を作ります
CharacterEscapeHandler.class.getName() 

Mavenが見つかりません import com.sun.xml.internal.bind.marshaller.Char acterEscapeHandler;

MavenがCharacterEscapeHandleを見つけられません。それを修正するには?

私はビルド、パッケージ、Eclipse Neonで動作しても問題ありません。それを修正するには?

+0

http://stackoverflow.com/questions/13068146/how-to-overcome-package-com-sun-xml-internal-xxx-does-not-exist-when-compiling .. ??? – Akshay

答えて

0

これは

<dependency> 
     <groupId>sun.jdk</groupId> 
     <artifactId>rt.jar</artifactId> 
     <version>1.8</version> 
     <scope>system</scope> 
     <systemPath>${java.home}/lib/rt.jar</systemPath> 
    </dependency> 
</dependencies> 
<build> 
    <pluginManagement> 
     <plugins> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <version>3.6.1</version> 
       <configuration> 
        <fork>true</fork> 
        <compilerArgument>-XDignore.symbol.file</compilerArgument> 
       </configuration> 
      </plugin> 
     </plugins> 
    </pluginManagement> 
</build> 

一時的な解決策であるMavenは成功を構築します。

関連する問題