2016-06-01 4 views
0

코 틀린 프로젝트에 HtmlUnit과를 포함하는 방법 : ElementTraversal이 자바 7 기능 때문에나는 코 틀린 프로젝트에 <a href="http://htmlunit.sourceforge.net/" rel="nofollow">HtmlUnit</a>를 사용하려고 해요하지만 컴파일 할 때 나는 다음과 같은 오류가

Error:Kotlin: Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath: 
    class com.gargoylesoftware.htmlunit.html.DomElement, unresolved supertypes: ElementTraversal 

이입니다. 이 문제를 어떻게 해결할 수 있습니까?

+0

당신은 당신이 컴파일하는 방법을 표시하지 않으며, 어떤 JDK는 컴파일 사용하고 있습니다. 그리고 당신은 IDE에서 컴파일하고 있습니까? (?), 또는 시스템을 구축하고 있습니까? –

답변

0

org.w3c.dom.ElementTraversal은 의 일부이며, 종속성은 xerces:xercesImpl입니다. xerces:xercesImpl의 종속성은 htmlunit입니다.

htmlunit의 전이 종속성을 프로젝트에 추가해야합니다. 필요 Gradle을 가진

모두는 다음과 같습니다

compile 'net.sourceforge.htmlunit:htmlunit:2.22' 
+0

그래, net.sourceforge.htmlunit HtmlUnit과'으로 내 받는다는에 2.22 ' – Johnny

+0

이 한 번 봐 걸릴 @Johnny 것을 가지고 ['의존성 : tree'] (HTTP ://maven.apache.org/plugins/maven-dependency-plugin/tree-mojo.html) – miensol

+0

XML-API에 추가함으로써 수정 ' XML-API에 1.4.01 'HtmlUnit의 종속성 때문에 이상합니다. – Johnny