Maven 插件依赖项:class 未找到

Maven Plugin Dependency : class not found

我正在尝试将 Apache CXF 的 "cxf-java2ws-plugin" 添加到我的 pom.xml 文件中 在 "process-classes" 阶段执行默认目标 (java2ws) 时,出现 class not found 异常:

A required class was missing while executing org.apache.cxf:cxf-java2ws-plugin:3.1.11:java2ws: org/apache/cxf/helpers/CastUtil

奇怪的是我有正确的依赖关系,我可以在领域 url 中看到具有所需 class 文件的 JAR (cxf-core-3.1.11.jar)。我检查了 JAR 内部,class 文件在那里。 (见下面的 urls[4])

[ERROR] Failed to execute goal org.apache.cxf:cxf-java2ws-plugin:3.1.11:java2ws (default) on project MasterCardServiceStub: Execution default of goal org.apache.cxf:cxf-java2ws-plugin:3.1.11:java2ws failed: A required class was missing while executing org.apache.cxf:cxf-java2ws-plugin:3.1.11:java2ws: org/apache/cxf/helpers/CastUtils
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.apache.cxf:cxf-java2ws-plugin:3.1.11
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/SBIv2/m2/repository/org/apache/cxf/cxf-java2ws-plugin/3.1.11/cxf-java2ws-plugin-3.1.11.jar
[ERROR] urls[1] = file:/C:/SBIv2/m2/repository/org/apache/cxf/cxf-rt-frontend-jaxws/3.1.11/cxf-rt-frontend-jaxws-3.1.11.jar
[ERROR] urls[2] = file:/C:/SBIv2/m2/repository/xml-resolver/xml-resolver/1.2/xml-resolver-1.2.jar
[ERROR] urls[3] = file:/C:/SBIv2/m2/repository/org/ow2/asm/asm/5.0.4/asm-5.0.4.jar
[ERROR] urls[4] = file:/C:/SBIv2/m2/repository/org/apache/cxf/cxf-core/3.1.11/cxf-core-3.1.11.jar
[ERROR] urls[5] = file:/C:/SBIv2/m2/repository/org/codehaus/woodstox/woodstox-core-asl/4.4.1/woodstox-core-asl-4.4.1.jar
...

这是我的 "most simple" 插件配置

        <plugin>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-java2ws-plugin</artifactId>
            <version>3.1.11</version>


            <dependencies>
                <dependency>
                    <groupId>org.apache.cxf</groupId>
                    <artifactId>cxf-rt-frontend-jaxws</artifactId>
                    <version>3.1.11</version>
                </dependency>
                <dependency>
                    <groupId>org.apache.cxf</groupId>
                    <artifactId>cxf-rt-frontend-simple</artifactId>
                    <version>3.1.11</version>
                </dependency>
            </dependencies>


            <executions>
                <execution>

                    <!-- bind this plugin goal to the specific maven phase -->
                    <phase>process-classes</phase>
                    <configuration>

                        <className>org.apache.hello_world.Greeter</className>
                        <genWsdl>true</genWsdl>
                        <verbose>true</verbose>
                    </configuration>
                    <!-- the plugin specific goal -->
                    <goals>
                        <goal>java2ws</goal>
                    </goals>
                </execution>
            </executions>

        </plugin>

尝试使用低于 3.1.11 版本的 <artifactId>cxf-rt-frontend-simple</artifactId>。并更新 Maven 项目

由本地存储库中损坏的 JAR 引起