在尝试了我发布的几件事后:
在尝试了多个版本的 mojo jaxws 插件后,我发现了以下问题,该插件已在网站中讨论过:
尽管类在类路径中,但获取“java.lang.NoClassDefFoundError”
因此,根据建议,我尝试在 org.codehaus.mojo 上方的插件部分添加工具 jar。我认为这是建议的内容,其中一个人找到了解决方案。
<plugin>
<dependencies>
<dependency>
<groupId>jdk.tools</groupId>
<artifactId>jdk.tools</artifactId>
<version>1.7</version>
<scope>system</scope>
<systemPath>${JAVA_HOME}/../lib/tools.jar</systemPath>
</dependency>
</dependencies>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>${jaxws-maven-plugin.version}</version>
</plugin>
但是尝试这样做最终会遇到以下问题:如果我在任何地方出错,请提供任何建议。
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Failed to resolve artifact.
Missing:
----------
1) jdk.tools:jdk.tools:jar:1.7
Try downloading the file manually from the project website.
Then, install it using the command:
mvn install:install-file -DgroupId=jdk.tools -DartifactId=jdk.tools -Dversion=1.7 -Dpackaging=jar -Dfile=/path/to/file
Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=jdk.tools -DartifactId=jdk.tools -Dversion=1.7 -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
Path to dependency:
1) org.codehaus.mojo:jaxws-maven-plugin:maven-plugin:1.9
2) jdk.tools:jdk.tools:jar:1.7
----------
1 required artifact is missing.
for artifact:
org.codehaus.mojo:jaxws-maven-plugin:maven-plugin:1.9
from the specified remote repositories:
releases (https://dsnexus.us.hibm.hex:8081/nexus/content/repositories/releases),
dsnexus-snapshots (https://dsnexus.us.hibm.hex:8081/nexus/content/repositories/snapshots),
R2 (http://dsnexus.us.hibm.hex:8081/nexus/content/groups/public),
snapshots (https://dsnexus.us.hibm.hex:8081/nexus/content/repositories/snapshots),
jboss (http://repository.jboss.org/nexus/content/groups/public-jboss),
dsnexus (https://dsnexus.us.hibm.hex:8081/nexus/content/groups/prd)
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Missing: