Sergey
Sergey

Reputation: 1089

How to exclude one of Maven's lifecycle phase

I have .war file and I need to do "deploy script". Is it possible to do this with maven? Can I execute only deploy phase of lifecycle? Or it will be better to use some other instruments for deployment like ant, gant etc.

Upvotes: 12

Views: 6685

Answers (2)

Andreas Covidiot
Andreas Covidiot

Reputation: 4755

you can (now) skip phases by directly calling the goal via

mvn <plugin>:<goal>

e.g.

mvn compiler:compile

see this answer for details

Upvotes: 2

MaDa
MaDa

Reputation: 10762

No, you can't skip phases. The mvn phase-x command always means "run all phases until phase-x, inclusive". Some plugins, however can detect if there have been changes since their last execution and decide (on their own) not to run — the subsequent build is faster.

I'm not sure what exactly you want to achieve — perhaps you could take a look at Maven assembly plugin?

Upvotes: 6

Related Questions