java - How can I use a Maven project as a dependency to another Maven project? -


i'm new maven, therefore, sorry in advance if question general. have maven project, call projecta, resides in company's mercurial repository (let's call https://hg.mycompany.com/niceprojects/). recently, built separate maven project, call projectb in same repository. want use in projectb classes have in projecta. directory structure in repository currently:

-----niceprojects        |        |__projecta        |     |__pom.xml        |        |__projectb              |__pom.xml 

what neat way of doing this? avoid manually building projecta, adding jars in projectb. keep same directory structure. step-by-step instructions appreciated. many thanks!

a general advice when using maven use maven repository manager such nexus.

in case nexus has addtional benefit can host jars.

so advice following:

  • configure ci (e.g. jenkins) job build projecta , deploy jar nexus instance
  • declare projecta dependency in projectb

when building projectb, can download projecta jar nexus instance without having build projecta yourself.


Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -