pom.xmlに記載のバージョンが特定の値の時のみ、コマンドを実行する
以下の記事がありました。
ということはこれを応用すると、特定のバージョンの時のみコマンドを実行できます。例えばdeployしたりとか。
こんな感じ。
PROJECT_VERSION=`mvn -q '-Dexec.executable=echo' '-Dexec.args=${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.6.0:exec | awk '{print $1}'` if [ `echo $PROJECT_VERSION | grep 'SNAPSHOT'` ] ; then mvn -e deploy -Dmaven.test.skip=true -Dgpg.skip=true fi