You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

同配置下Eclipse创建的Maven项目同事无法运行,报jaxws-maven-plugin错误

Troubleshooting jaxws-maven-plugin:2.5:wsimport Failure in Identical Environments

Hey there, it’s super frustrating when a project runs smoothly on your machine but breaks for a teammate—even with matching JDK, Maven, OS, and Eclipse setups. Let’s walk through the most common fixes for this jaxws-maven-plugin error:

1. Clear Corrupted Maven Plugin Cache

Maven caches plugin artifacts locally, and a corrupted download can cause random failures. Have your teammate:

  • Delete the jaxws-maven-plugin directory from their local repo: ~/.m2/repository/org/codehaus/mojo/jaxws-maven-plugin/2.5
  • Run mvn clean install -U in the project root—the -U flag forces Maven to refresh dependencies and plugins from remote repositories.

2. Verify JDK’s WSImport Tool Works

Even with JDK 1.8, minor distribution differences (Oracle JDK vs. OpenJDK) or missing components can break wsimport. Ask your teammate to:

  • Open a command prompt and run wsimport -version—if this throws an error, their JDK might be missing JAX-WS tools.
  • Check that their JDK’s lib directory contains jaxws-api.jar, jaxws-rt.jar, and related JARs. If not, they may need to reinstall a full JDK distribution that includes JAX-WS components.

3. Validate WSDL File Paths and Existence

Double-check that your teammate has all required WSDL files in the right place:

  • Confirm the wsdlLocation configured in the jaxws-maven-plugin section of your pom.xml matches the actual file path on their machine.
  • Ensure no WSDL files were excluded via .gitignore or missed during the code pull.
  • Check for file encoding mismatches (e.g., UTF-8 vs. system default) that could cause parsing errors.

4. Align Maven Mirror Configuration

If your teammate’s settings.xml uses a different Maven mirror than yours, it might serve incomplete or outdated plugin artifacts. Have them:

  • Compare their ~/.m2/settings.xml with yours to ensure mirror settings are identical.
  • Temporarily switch to the official Maven Central repo by commenting out custom mirrors, then rerun the build to test.

5. Explicitly Pin JAX-WS Tools Version in the Plugin

Sometimes the plugin pulls in incompatible transitive dependencies. Add an explicit jaxws-tools dependency to lock in a version compatible with JDK 1.8:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>jaxws-maven-plugin</artifactId>
    <version>2.5</version>
    <dependencies>
        <dependency>
            <groupId>com.sun.xml.ws</groupId>
            <artifactId>jaxws-tools</artifactId>
            <version>2.3.5</version>
            <scope>runtime</scope>
        </dependency>
    </dependencies>
    <!-- Your existing plugin configuration -->
</plugin>

6. Test Build via Command Line (Bypass Eclipse)

Eclipse’s Maven integration can have quirks. Ask your teammate to run the build directly from the terminal:

  • Navigate to the project root in a command prompt.
  • Execute mvn clean install.
    If this works, the issue is likely with Eclipse—try refreshing the project, updating Eclipse’s Maven plugin, or reimporting the project into Eclipse.

If none of these steps fix the problem, ask your teammate to share the full error stack trace (not just the top-level failure message). More details will help pinpoint the exact root cause.

内容的提问来源于stack exchange,提问作者Johnny Maublanc

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.22 10:00:32