2

I want to deploy a Java & Maven micro services application on OpenShift however I have one small issue. These micro services are dependent on a commons project containing some common components.

How can i add the jar of the commons project ( private jar, not on public repo) to the class path of the micro services about to be deployed on Openshift?

When building the application locally we used a maven plugin which would move the jar of the commons project into the local maven repository, from where it was easily referenced via a dependency tag in the pom file.

Here are some approaches that I thought about:

  • use an internal maven repository
  • create a folder on the root of the project and use it as a local maven repo, declaring it via repository tags in the pom files
  • deploy a nexus repository on the Openshift cluster

The first approach is not viable since our company does not have an internal maven repository.

We also tried the third approach , however we did not manage to deploy a running nexus repo on Openshift.

The only viable solution left is the second one, however I am a little bit reluctant to implement it since it does seem to be the standard way of doing things. What approach would you reccommend?

theAsker
  • 527
  • 3
  • 14

1 Answers1

0

create a folder on the root of the project and use it as a local maven repo, declaring it via repository tags in the pom files

This won't be a good approach TBH.

My recommendation would be using a nexus/jfrog etc. repo OpenShift internal or externally (a more recommended approach for enterprises) and get the commons and other libraries from that repo via defining maven dependencies.