How to Reference Maven Dependencies from other Upsource Projects

I have a situation where I have two Upsource projects, each with a maven build; the first is for our common libraries and the second depends on those common libraries. I am having an issue where the second project cannot find its dependencies from the first project when being analyzed by Upsource, even though that first project has been set up and analyzed by Upsource.

Looking through the maven repository that gets built by Upsource (<Upsource Home>/temp/upsource-analyzer/upsource-tmp/m2repo/) I notice that the jars from the common project are not there, even after the project has been analyzed (though the dependencies used for that build are). I've tried deleting and recreating the project a number of times as well as deleting the Upsource maven repository, all with no luck. I have the same setup in TeamCity which works fine and building the projects locally works fine as well. However, in both of those cases, I know that the associated maven repositories are getting updated properly with the contents of the required common libraries.

My questions are:

  1. Should the jars from the common project get put into the Upsource maven repository?
  2. Am I just going about this in the wrong way? I am starting to wonder if there is just a better way to handle dependencies between projects, any advice would be welcome.


Thanks!

2 comments
Comment actions Permalink

Hi Akmad,

Thanks for getting in touch.

Let me clarify a few things and I believe it will become more obvious why it's happening and what to do in order to get it fixed.

First of all Upsource is not a build system as TeamCity. It doesn't build artifacts and correlate them between projects/repos in attempt to find dependencies. So having two projects in Upsource doesn't mean that dependencies between these project will be found automatically. In your case Upsource just doesn't know where to find dependencies for your second project.

Not aware of your Maven configuration, but it looks like you might want to specify path to "Common Libraries" repository on Maven side, either in pom.xml on in maven settings (depends on how Maven is configured in your environment) In case you have it in maven settings, a corresponding field is presented in Upsource project administration, called "Maven Settings".

Hope it helps.

0
Comment actions Permalink

Hy,
I did this worakround for your problem:
https://devnet.jetbrains.com/thread/465804?tstart=0

Best regards,
Tom

0

Please sign in to leave a comment.