0

In Maven is it possible to depend on jar1 and jar2 but establish this dependency via a middle pom file like so:

mypom.xml --> middle_pom.xml --> jar1, jar2

Can this be done in that way?

Of course the packaging for mypom.xml is whatever I want like 'war' but the packaging for middle_pom.xml would be 'pom', agree?

jakstack
  • 2,143
  • 3
  • 20
  • 37

1 Answers1

1

As you say, make the packaging for middle_pom pom, then just add a dependency to mypom.xml like so:

<dependency>
    <groupId>com.my.group</groupId>
    <artifactId>middle_pom</artifactId>
    <version>0.1</version>
    <type>pom</type>
<dependency>

Though if you explain the reason you want to do this someone might be able to give you a more helpful suggestion.

stripybadger
  • 4,539
  • 3
  • 19
  • 26
  • Thanks, i solved it pretty much after I posted the question and yes I used what you suggested but also in the maven repo for each jar I created a name-version.pom file. Cheers – jakstack Dec 23 '13 at 22:02