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

3

6

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

Conduce answered 8/8, 2018 at 10:49 Comment(2)
I think your configuration/repository manager etc. has some issues: Cause search.maven.org/… and search.maven.org/… and search.maven.org/… the staxex-ex seemed to be not existing...Can you post your full pom file ....Fallacious
The problem is only with those who don't have the version in jaxws-rt pom. If I add the missing version on my laptop to this exact pom, everything works fine and all libraries are part of resulting war-file. We are using some pom hierarchy so posting is quite complex. But I had the same issue, when defining the dependency to jaxws-rt directly in dependencies section of main pom. Maven is unable to resolve proper version for those libraries, but on jenkins he can and I don't know whyConduce
S
5

In my case JAVA_HOME environment variable pointed to JRE. I set it to my JDK installation folder (On my system 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.

Shelli answered 8/7, 2020 at 7:35 Comment(1)
I had a similar issue, and switching to JDK8 (I was using JDK11) fixed the problemRubberize
S
0

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.

Supple answered 28/11, 2018 at 5:32 Comment(0)
H
0

In my case, setting the JAVA_HOME variable to the correct JDK fixed the issue, its clearly mentioned in the maven installation doc https://maven.apache.org/install.html

Hurt answered 22/6, 2021 at 3:20 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.