Glory to Russia
Glory to Russia

Reputation: 18712

Executing Maven 3 goals in order

I have several Maven projects - a web service, which depends on several libraries.

When I add a new feature and want to deploy the web service to the server, I usually need to build these libraries in the correct order, i. e.

  1. Go to the directory of library A.
  2. Do mvn clean install there.
  3. Go to the directory of library B.
  4. Do mvn clean install there.
  5. Go to the directory of the web service.
  6. Do mvn clean install there.
  7. Do mvn cargo:redeploy

The process must stop, if any of these steps end with a build failure (most of the time the builds are successful).

How can I automate this process (make one action instead of 7) in a clean way?

I'm using Git (hosted at Beanstalk) for version control and Amazon EC2 as a web app server.

Upvotes: 1

Views: 188

Answers (1)

Barry NL
Barry NL

Reputation: 963

Use a build server like Jenkins (or Hudson) and trigger 'web service' project build when 'library B' has been built and trigger 'library B' project build when 'library A' has been built. Then trigger a build of 'library A'.

Upvotes: 2

Related Questions