2

I have a multi-module project P with sub-modules A, B and C.

A is dependent on B. B is dependent on C.

With B and C neither available in remote or local repos, is it possible to build from A's directory passing the relative path to dependent modules B and C.

l a s
  • 3,836
  • 10
  • 42
  • 61

1 Answers1

0

I am not entirely sure what you mean but you should be able achieve what you want by doing this:

directory-of-P $ mvn clean install -pl :<artifactId-of-A> -am

or if on Windows:

C:\Directory\Of\P>mvn clean install -pl :<artifactId-of-A> -am

There is no need to change the directory to A. In fact, Maven works best if you always work from the directory containing your root POM. Then you don't need to figure out how many levels deep a certain module is located, Maven will find it for you if it is part of the reactor.

Daniel
  • 4,033
  • 4
  • 24
  • 33