Skip to content

Instantly share code, notes, and snippets.

@brunorozendo
Created March 23, 2017 17:59
Show Gist options
  • Select an option

  • Save brunorozendo/c1a7793b1e21707755b6424c4c50b2c7 to your computer and use it in GitHub Desktop.

Select an option

Save brunorozendo/c1a7793b1e21707755b6424c4c50b2c7 to your computer and use it in GitHub Desktop.
debug_maven
#Inside mvn(sh)#
read LOWERPORT UPPERPORT < /proc/sys/net/ipv4/ip_local_port_range
while :
do
PORT="`shuf -i $LOWERPORT-$UPPERPORT -n 1`"
ss -lpn | grep -q ":$PORT " || break
done
MAVEN_OPTS="$MAVEN_OPTS -Xdebug -agentlib:jdwp=transport=dt_socket,address=$PORT,server=y,suspend=n"
export JAVA_HOME=/opt/jdk/jdk6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment