问题
We are running a Jenkins on Ubuntu.
When we try to use a Java library in a Pipeline that uses REST calls, we run into problems. UriBuilder is apparently used in a old version: The method toTemplate
is missing and caused a MethodNotFound. This is strange because the Java library depends transitively on
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.0.1</version>
which contains the new version of UriBuilder. We used Grape and correctly copied the library with all transitive dependencies to Jenkins. Outside Jenkins, the library works fine.
My guess: Jenkins runs on a version of Jetty which provides an old version of UriBuilder which somehow "wins" against the new version of UriBuilder from javax.ws.rs-api 2.0.1?
Can anybody shed light on this?
来源:https://stackoverflow.com/questions/49407079/which-jersey-version-runs-in-jenkins-2-107-1