所以我可以使用ant来构建我的应用程序,但是当我去运行服务器时会显示此消息
begin: 2014-09-08 15:37:12
Buildtools dir - /Users/tylerrice/Documents/Universe-backend-master/buildtools
Ant home - /Users/tylerrice/Documents/Universe-backend-master/buildtools/ant
JAVA_HOME - /Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home
Buildfile: /Users/tylerrice/Documents/Universe-backend-master/universe-backend/build.xml
_installGaeSdkIfMissing:
startup:
[osExec] Executing -
[osExec] sh dev_appserver.sh --port=8080 --disable_update_check --jvm_flag=-
Ddatastore.default_high_rep_job_policy_unapplied_job_pct=20 --jvm_flag=-Ddatastore.auto_id_allocation_policy=scattered --jvm_flag=-Xdebug --jvm_flag=-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 /Users/tylerrice/Documents/Universe-backend-master/universe-backend/target/universe-backend-1.2.0.28-SNAPSHOT
[echo] GAE started locally. You can go to http://localhost:8080/_ah/admin
BUILD SUCCESSFUL
Total time: 0 seconds
end: 2014-09-08 15:37:1
当我转到http://localhost:8080/_ah/admin
时,它会抛出404页面找不到错误。我在这做错了什么?似乎服务器一启动就会关闭,并且没有给我时间在浏览器中进行测试。
我尝试在/buildtools/appengine-java-sdk-1.8.8/bin/dev_appserver.sh中添加“sleep 5”命令 但它似乎没有延迟服务器关闭。
因为有人问这里是蚂蚁脚本
#!/bin/sh
# This file is designed to be includable in other scripts to encapsulate
# the code that finds build tools. Both release.sh and ant.sh need to
# use the same buildtools.
## FUNCTIONS ##
# search up from given path for buildtools
find_buildtools_in_path() {
cur_dir="$1"
while true ; do
buildtools="$cur_dir/buildtools"
if [ -d "$buildtools" ]; then
echo "$buildtools"
return 0
else
cur_dir="`dirname "$cur_dir"`"
if [ "$cur_dir" = "/" ]; then
echo ""
return 1
fi
fi
done
}
# Find buildtools and set BUILDTOOLS_DIR
find_buildtools() {
logical_path="`pwd -L`"
valid_buildtools="`find_buildtools_in_path "$logical_path"`"
if [ -z "$valid_buildtools" ]; then
physical_path="`pwd -P`"
valid_buildtools="`find_buildtools_in_path "$physical_path"`"
fi
if [ -z "$valid_buildtools" ]; then
echo "Error: cannot find buildtools"
exit 1
fi
BUILDTOOLS_DIR="$valid_buildtools"
}
test_java_home() {
if [ -z "${JAVA_HOME}" ]; then
echo "Error: JAVA_HOME is not set"
exit 1
fi
}
set_buildtools_dir() {
[ "$BUILDTOOLS_DIR" ] || find_buildtools
if [ ! -d "${BUILDTOOLS_DIR}" ]; then
echo "Error: buildtools is missing: $BUILDTOOLS_DIR"
exit 1
fi
BUILDTOOLS_DIR="` cd "$BUILDTOOLS_DIR" >/dev/null 2>&1 ; pwd `"
}
execute_ant() {
ANT_HOME="$BUILDTOOLS_DIR/ant"
export ANT_HOME
echo "Buildtools dir - $BUILDTOOLS_DIR"
echo "Ant home - $ANT_HOME"
echo "JAVA_HOME - $JAVA_HOME"
CLASSPATH="$BUILDTOOLS_DIR/ant/lib/ant-launcher.jar"
export CLASSPATH
"$JAVA_HOME/bin/java" -Xms512m -Xmx512m \
-classpath "$CLASSPATH" \
-Djavax.net.ssl.trustStore="$BUILDTOOLS_DIR/nexus/nexus-certs" \
-Dfile.encoding=UTF-8 \
-Djava.awt.headless=true \
"-Dbuildtools.dir=$BUILDTOOLS_DIR" \
"-Dant.home=$ANT_HOME" \
org.apache.tools.ant.launch.Launcher "$@"
ANT_RESULT="$?"
}
echo_date() {
NOW=`date "+%Y-%m-%d %H:%M:%S"`
echo "$1: $NOW"
}
## CODE START ##
clear
SCRIPT_NAME="`basename "$0"`"
if [ "$SCRIPT_NAME" = "ant.sh" ]; then
echo_date begin
test_java_home;
set_buildtools_dir;
execute_ant "$@"
echo_date end
exit $ANT_RESULT
fi