openapi-generator/bin/jaxrs-jersey1-petstore-server.sh
David Fischer 506c58ec74 [JaxRS] Fix response annotation generation (fixes #2588) (#6373)
* [JaxRS] Fix response annotation generation (fixes #2588)

* [JaxRS] Fix jaxrs jersey1 usetags sample provider

* Revert "[JaxRS] Fix jaxrs jersey1 usetags sample provider"

This reverts commit 73fef2e451e376b23f6c1d43d8781f0b4a0bd1f5.

* [JaxRS] Fix jaxrs jersey1 sample generator

* [JaxRS] Fix samples for jersey1 and jersey2

* [Server: Java] Fix diamond operator defaultValue for Java < 1.7
2017-08-30 00:31:56 +08:00

35 lines
1.2 KiB
Bash
Executable File

#!/bin/sh
SCRIPT="$0"
while [ -h "$SCRIPT" ] ; do
ls=`ls -ld "$SCRIPT"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
SCRIPT="$link"
else
SCRIPT=`dirname "$SCRIPT"`/"$link"
fi
done
if [ ! -d "${APP_DIR}" ]; then
APP_DIR=`dirname "$SCRIPT"`/..
APP_DIR=`cd "${APP_DIR}"; pwd`
fi
executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
if [ ! -f "$executable" ]
then
mvn clean package
fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -t modules/swagger-codegen/src/main/resources/JavaJaxRS -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l jaxrs -o samples/server/petstore/jaxrs/jersey1 -DhideGenerationTimestamp=true,serverPort=8080 --library=jersey1 --artifact-id=swagger-jaxrs-jersey1-server"
echo "Removing files and folders under samples/server/petstore/jaxrs/jersey1/src/main"
rm -rf samples/server/petstore/jaxrs/jersey1/src/main
find samples/server/petstore/jaxrs/jersey1 -maxdepth 1 -type f ! -name "README.md" -exec rm {} +
java $JAVA_OPTS -jar $executable $ags