java - Using maven in scripts or adding a script-runner task at the end -


i'm using maven on both mac , linux build .war file website. i'd know best way automatically run script deploy website server after build.

what doing have deploy.sh script run

mvn -p<profile> clean package

and bunch of ssh / scp stuff copy target/file.war web server , run bunch of commands start/stop tomcat - clean out logs etc.

problems

although various stack posts using $? supposed catch error code maven have yet working , if reason have bad maven build have no way detect it. not deploy tasks if build fails.

options?

1) there correct way detect bad "build" maven , have script abort (i guess check if war doesn't exist ...??)

2) there maven "plugin" handle me, , if provide small code example.

i 2 things in shell script calls maven , deployment commands:

  • test whether war file exists before attempting deploy it, suggest yourself;
  • save maven output timestamped log file reference.

Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -