Java Callout Issue - Not Able To Resolve Dependencies On Remote Machine

I am writing a Java Callout policy, thus need to have expressions and message-flow dependencies to be added to pom file. I need to manage these my lib or Java Callout jar as a git repo for version management, also we will build the code using jenkins on remote slave and publish the callout jar file.

I am able to add them to my local .m2 folder and resolve the dependencies locally, but how to achieve that on remote servers [As these two dependencies are not available in any public repos].

Currently, build fails as it is not able to resolve these two dependencies.

Please suggest what needs to be done here.

@dchiesa1 @ssvaidyanathan @sgilson 

1 REPLY 1

You have few options

  1. In your pipeline, run a script like this https://github.com/apigee/api-platform-samples/blob/master/doc-samples/java-hello/buildsetup.sh so that the pipeline installs the jar files in its local repo. With this you can guarantee that the slave machines have this jar 
  2. If you are not using the public central repo and have a repo within your company, then you can install these jars in the repo and then have your pom point to that repo instead of the public repo
  3. Having the jar files in your source code and then add the dependencies and include them using "<systemPath>" in the pom file

Give it a try and let me know how it goes