ClassNotFoundException:org / jaxen / NamespaceContext

时间:2016-05-24 11:21:42

标签: java maven dependencies dom4j

我正在使用Maven + tycho-surefire来运行一些junit-plugin-tests。每当我运行它时,我都会收到以下错误:

ClassNotFoundException: org.jaxen.JaxenException

一些谷歌搜索显示这意味着缺少jaxen.jar,但如果我用

运行它

install -X

它的内容如下:

 reference:file:C:\Users\Simon\.m2\repository\p2\osgi\bundle\org.jaxen\1.1.6.v01\org.jaxen-1.1.6.v01.jar[+org/jaxen/*;+org/jaxen/dom/*;+org/jaxen/dom4j/*;+org/jaxen/expr/*;+org/jaxen/expr/iter/*;+org/jaxen/function/*;+org/jaxen/function/ext/*;+org/jaxen/function/xslt/*;+org/jaxen/javabean/*;+org/jaxen/jdom/*;+org/jaxen/pattern/*;+org/jaxen/saxpath/*;+org/jaxen/saxpath/base/*;+org/jaxen/saxpath/helpers/*;+org/jaxen/util/*;+org/jaxen/xom/*;?**/*]
 reference:file:C:\Users\Simon\.m2\repository\.cache\tycho\org.jaxen-1.1.6.v01.jar\jaxen-1.1.6.jar[+org/jaxen/*;+org/jaxen/dom/*;+org/jaxen/dom4j/*;+org/jaxen/expr/*;+org/jaxen/expr/iter/*;+org/jaxen/function/*;+org/jaxen/function/ext/*;+org/jaxen/function/xslt/*;+org/jaxen/javabean/*;+org/jaxen/jdom/*;+org/jaxen/pattern/*;+org/jaxen/saxpath/*;+org/jaxen/saxpath/base/*;+org/jaxen/saxpath/helpers/*;+org/jaxen/util/*;+org/jaxen/xom/*;?**/*]

以及

reference:file:C:/Users/Simon/.m2/repository/p2/osgi/bundle/org.dom4j/1.6.1.v201312101416/org.dom4j-1.6.1.v201312101416.jar

这是否意味着jaxen可用?我还能提供什么来帮助追踪错误吗?

编辑: 按要求我的pom:

<build>
    <plugins>
        <plugin>
           <groupId>org.eclipse.tycho</groupId>
           <artifactId>target-platform-configuration</artifactId>
           <version>${tycho-version}</version>
           <configuration>
               <dependency-resolution>
                <optionalDependencies>ignore</optionalDependencies>
                <extraRequirements>
                    <requirement>
                        <type>eclipse-plugin</type>
                        <id>org.eclipse.ocl.pivot.uml</id>
                        <versionRange>0.0.0</versionRange>
                    </requirement>
                    <requirement>
                        <type>eclipse-plugin</type>
                        <id>org.eclipse.ocl.xtext.completeocl</id>
                        <versionRange>0.0.0</versionRange>
                    </requirement>
                    <requirement>
                        <type>eclipse-plugin</type>
                        <id>org.eclipse.ocl.xtext.oclinecore</id>
                        <versionRange>0.0.0</versionRange>
                    </requirement>
                    <requirement>
                        <type>eclipse-plugin</type>
                        <id>org.eclipse.ocl.xtext.oclstdlib</id>
                        <versionRange>0.0.0</versionRange>
                    </requirement>
                    <requirement>
                        <type>eclipse-plugin</type>
                        <id>org.jaxen</id>
                        <versionRange>1.1.6</versionRange>
                    </requirement>
                    <requirement>
                        <type>eclipse-plugin</type>
                        <id>org.jaxen</id>
                        <versionRange>1.1.6</versionRange>
                    </requirement>
                </extraRequirements>
            </dependency-resolution>
           </configuration>
        </plugin>
        <plugin>
            <groupId>org.eclipse.tycho</groupId>
            <artifactId>tycho-surefire-plugin</artifactId>
            <version>${tycho-version}</version>
            <configuration>
              <skipTests>false</skipTests>
            </configuration>
            </plugin>
        </plugins>
</build>

EDIT2: 如果我使用:

<plugin>
        <artifactId>maven-dependency-plugin</artifactId>
        <executions>
          <execution>
            <phase>install</phase>
            <goals>
              <goal>copy-dependencies</goal>
            </goals>
            <configuration>
              <outputDirectory>${project.build.directory}\lib1234</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>

该文件夹包含:

org.jaxen-1.1.6.v01.jar
org.jaxen-1.1.6.v01-jaxen-1.1.6.jar.jar
org.dom4j-1.6.1.v201312101416

为什么jaxen有两次,这是否意味着什么?

0 个答案:

没有答案