Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Better mvn deploy
#!/bin/bash
if [[ ! -e pom.xml ]]; then
echo "Missing pom.xml" 1>&2
exit 1
fi
sed \
-e '/<distributionManagement>/,/<\/distributionManagement>/d' \
-e '/<\/project/d' \
pom.xml > pom-deploy.xml || exit 1
cat >> pom-deploy.xml <<EOF
<!-- ADDED BY $0 -->
<distributionManagement>
... whatever you need ...
</distributionManagement>
</project>
EOF
mvn -f pom-deploy.xml clean install && \
mvn -f pom-deploy.xml deploy -DskipTests=true && \
rm pom-deploy.xml
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.