Salil
Salil

Reputation: 536

Clean/Install Multiple maven projects in order without reactor

Project Structure:

Parent-Prj (pom.xml)

Details:

We are using a custom maven plugin (eclipse plugin with buttons provided for clean/install/compile etc). Issues due to that:

  1. P1/P2 specified as modules in parent project pom. However the projects are not being executed in order. i'e P1 should be build before P1 due to dependency specified. Suspect the reactor is not working
  2. There is no command line interface.

Problem:

I want to clean / install these project in order from parent pom.

The order should be:

Is there a way I can do that without reactor plugin as it does not seem to work in this custom plugin ?

Update: Taking look at assembly plugin

Upvotes: 2

Views: 4464

Answers (1)

pappu_kutty
pappu_kutty

Reputation: 2488

just make sure you have this code in you parent pom file

<modules>
  <module>p1</module>
  <module>p2</module>
</modules>

the above is order of which the projects will be build.

in above configuration p1 will be compiled first and later p2 will.

EDIT - since p2 depends on P1, P1 needs to be compiled first.

to achieve this you need to clean install of the parent pom.

  1. which cleans module 1 and build.
  2. second module 2 cleaned and build.

and also see this maven example link , for building multiple module projects.

http://books.sonatype.com/mvnex-book/reference/multimodule-sect-building-multimodule.html

Upvotes: 1

Related Questions