Skip to content

Instantly share code, notes, and snippets.

@d235j
Created October 31, 2013 23:06
Show Gist options
  • Select an option

  • Save d235j/7258653 to your computer and use it in GitHub Desktop.

Select an option

Save d235j/7258653 to your computer and use it in GitHub Desktop.
fixup script for gradle/maven versions
#!/bin/bash
# This fixes the versioning in the generated .pom files.
# Gradle simply copies the version string overs, which causes Maven to choke if the string ends with a plus.
find . -name '*.pom' -exec perl -i -pe 's/>((\.?[0-9]?)*)(\.?([0-9]))(\.?)\+</$5 eq "." ? ">[".$1.$3.",".$1.($3+1).")<" : ">[".$1.$3.",)<"/ge' {} \;
find . -name "*.pom" -exec sh -c "openssl md5 < {} > {}.md5" \;
find . -name "*.pom" -exec sh -c "openssl sha1 < {} > {}.sha1" \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment