简体   繁体   中英

The POM for com.sun.xml.ws:jaxws-rt:pom:2.2.10 is invalid

I am facing strange problem during build of our project. The problem boils down probably to dependency on jaxws-rt 2.2.10. The main problem is this warning which stops transitive dependencies to propagate to our distibutable. The POM for com.sun.xml.ws:jaxws-rt:pom:2.2.10 is invalid, transitive dependencies (if any) will not be available

The pom is probably wrong as shown in the output of mvn dependency:tree -X or mvn dependency:tree -Dverbose

[WARNING] Failed to build parent project for com.sun.xml.ws:bundles:pom:2.2.10
[WARNING] Failed to build parent project for com.sun.xml.ws:jaxws-rt:pom:2.2.10

[WARNING] The POM for com.sun.xml.ws:jaxws-rt:pom:2.2.10 is invalid, transitive dependencies (if any) will not be available: 5 problems were encountered while building the effective model for co
m.sun.xml.ws:jaxws-rt:2.2.10
[ERROR] 'dependencies.dependency.version' for javax.xml.bind:jaxb-api:jar is missing. @
[ERROR] 'dependencies.dependency.version' for com.sun.xml.bind:jaxb-core:jar is missing. @
[ERROR] 'dependencies.dependency.version' for com.sun.xml.bind:jaxb-impl:jar is missing. @
[ERROR] 'dependencies.dependency.version' for org.jvnet.staxex:stax-ex:jar is missing. @
[ERROR] 'dependencies.dependency.version' for com.sun.xml.fastinfoset:FastInfoset:jar is missing. @

Strange thing is that the jaxws-rt pom does not define versions of aforementioned libraries. The biggest magic of all happen on our jenkins where the build proceeds unlike on any other laptop. Just adding the versions to jaxws-rt pom in local repo resolves this problem. I believe that when I find out why jenkins is able to built it without warning, then I will be able to fix the errors on laptops.

What have we investigated so far

  • seems it is not maven version specific
  • seems it is not OS specific
  • don't believe it can be caused by different java version(just trying out)
  • there are no endoresed files in jenkins
  • downloaded dependencies are the same content-wise(jenkins vs laptops)

Note: rewrite the pom is not possible in short terms as it is kind of complex already

To find out why the build behaves differently in jenkins and on your laptop, you can check following points:

  • verify that you use exactly the same maven version on both sides. You can for instance add a simple "mvn -version" task in jenkins to output version details.
  • verify that there is no special settings in your maven installation: execute "mvn help:effective-pom" and "mvn help:effective-settings" in jenkins and on your laptop and then you can compare both settings: is there some different definition for <repository> or <mirror> on one side ?

If there is some difference in the settings, you can check following files in your maven installations:

  • the global settings in your maven installtion path: conf/settings.xml
  • the user settings in the $home of your jenkins agent: $home/.m2/settings.xml

Note that each of this settings-file can be overriden by using -gs and -s mvn command line options respectively.

In my case JAVA_HOME environment variable pointed to JRE. I set it to my JDK installation folder (ON my systwm it is: JAVA_HOME=C:\\Programme\\Java\\jdk-13.0.2 ).

My second issue was using jaxws-maven-plugin in version 2.3.1 . I changed it in pom.xml to 2.3.3 as following:

<dependency>
    <groupId>com.sun.xml.ws</groupId>
    <artifactId>jaxws-rt</artifactId>
    <version>2.3.3</version>
</dependency>

After this changes everything was fine.

在我的情况下,将 JAVA_HOME 变量设置为正确的 JDK 解决了这个问题,它在 maven 安装文档https://maven.apache.org/install.html 中明确提到

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM