tomcat-debug.sh 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/sh
  2. echo off
  3. echo [INFO] Use maven tomcat-plugin run the project, with debug options.
  4. CWD=`pwd`
  5. cd $CWD
  6. cd ..
  7. mvn compile -o -e
  8. echo --------------------- Set Jrebel ---------------------
  9. export REBEL_HOME=./bin
  10. export REBEL_CLASS_PATH=./target/classes
  11. export MAVEN_OPTS="$MAVEN_OPTS -javaagent:$REBEL_HOME/jrebel.jar -noverify -Drebel.spring_plugin=true -Drebel.hibernate_plugin=true"
  12. export MAVEN_OPTS="$MAVEN_OPTS -Drebel.dirs=$REBEL_CLASS_PATH"
  13. echo ${MAVEN_OPTS}
  14. echo --------------------- Set Jmxremote ---------------------
  15. export JMX_OPTS=
  16. export JMX_OPTS="$JMX_OPTS -Dcom.sun.management.jmxremote=true"
  17. export JMX_OPTS="$JMX_OPTS -Dcom.sun.management.jmxremote.port=9090"
  18. export JMX_OPTS="$JMX_OPTS -Dcom.sun.management.jmxremote.ssl=false"
  19. export JMX_OPTS="$JMX_OPTS -Dcom.sun.management.jmxremote.authenticate=false"
  20. echo ${JMX_OPTS}
  21. echo --------------------- Set Maven Debug ---------------------
  22. export MAVEN_OPTS="$JMX_OPTS $MAVEN_OPTS -XX:MaxPermSize=128m -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"
  23. #export MAVEN_OPTS="$MAVEN_OPTS -XX:MaxPermSize=128m -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000"
  24. echo ${MAVEN_OPTS}
  25. echo --------------------- RUN ---------------------
  26. mvn tomcat:run -Dmaven.test.skip=true -e -o