Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Update Jersey in GlassFish 4.0.1
#!/bin/bash
JERSEY_VERSION=2.5.1
HK2_VERSION=2.2.0-b26
JAVASSIST_VERSION=3.18.1-GA
MODULES_DIR=`pwd`/modules
OSGI_CACHE_DIR=`pwd`/domains/domain1/osgi-cache/felix
processArtifact() {
# Backup artifact
if [ ! -f ${MODULES_DIR}/$1.bak ]; then
echo "Backuping $1 ..."
cp ${MODULES_DIR}/$1 ${MODULES_DIR}/$1.bak
fi
# Download new version
echo "Downloading $1 ..."
if curl -s -o ${MODULES_DIR}/$1 $2 ; then
echo "Downloaded $1"
else
echo "Error downloading $1"
fi
return 0
}
# Backup and download new Jersey
processArtifact jersey-gf-cdi.jar http://repo.maven.apache.org/maven2/org/glassfish/jersey/containers/glassfish/jersey-gf-cdi/${JERSEY_VERSION}/jersey-gf-cdi-${JERSEY_VERSION}.jar
processArtifact jersey-gf-ejb.jar http://repo.maven.apache.org/maven2/org/glassfish/jersey/containers/glassfish/jersey-gf-ejb/${JERSEY_VERSION}/jersey-gf-ejb-${JERSEY_VERSION}.jar
processArtifact jersey-container-grizzly2-http.jar http://repo.maven.apache.org/maven2/org/glassfish/jersey/containers/jersey-container-grizzly2-http/${JERSEY_VERSION}/jersey-container-grizzly2-http-${JERSEY_VERSION}.jar
processArtifact jersey-container-servlet-core.jar http://repo.maven.apache.org/maven2/org/glassfish/jersey/containers/jersey-container-servlet-core/${JERSEY_VERSION}/jersey-container-servlet-core-${JERSEY_VERSION}.jar
processArtifact jersey-container-servlet.jar http://repo.maven.apache.org/maven2/org/glassfish/jersey/containers/jersey-container-servlet/${JERSEY_VERSION}/jersey-container-servlet-${JERSEY_VERSION}.jar
processArtifact jersey-client.jar http://repo.maven.apache.org/maven2/org/glassfish/jersey/core/jersey-client/${JERSEY_VERSION}/jersey-client-${JERSEY_VERSION}.jar
processArtifact jersey-common.jar http://repo.maven.apache.org/maven2/org/glassfish/jersey/core/jersey-common/${JERSEY_VERSION}/jersey-common-${JERSEY_VERSION}.jar
processArtifact jersey-server.jar http://repo.maven.apache.org/maven2/org/glassfish/jersey/core/jersey-server/${JERSEY_VERSION}/jersey-server-${JERSEY_VERSION}.jar
processArtifact jersey-bean-validation.jar http://repo.maven.apache.org/maven2/org/glassfish/jersey/ext/jersey-bean-validation/${JERSEY_VERSION}/jersey-bean-validation-${JERSEY_VERSION}.jar
processArtifact jersey-entity-filtering.jar http://repo.maven.apache.org/maven2/org/glassfish/jersey/ext/jersey-entity-filtering/${JERSEY_VERSION}/jersey-entity-filtering-${JERSEY_VERSION}.jar
processArtifact jersey-mvc-jsp.jar http://repo.maven.apache.org/maven2/org/glassfish/jersey/ext/jersey-mvc-jsp/${JERSEY_VERSION}/jersey-mvc-jsp-${JERSEY_VERSION}.jar
processArtifact jersey-mvc.jar http://repo.maven.apache.org/maven2/org/glassfish/jersey/ext/jersey-mvc/${JERSEY_VERSION}/jersey-mvc-${JERSEY_VERSION}.jar
processArtifact jersey-media-json-jackson.jar http://repo.maven.apache.org/maven2/org/glassfish/jersey/media/jersey-media-json-jackson/${JERSEY_VERSION}/jersey-media-json-jackson-${JERSEY_VERSION}.jar
processArtifact jersey-media-json-jettison.jar http://repo.maven.apache.org/maven2/org/glassfish/jersey/media/jersey-media-json-jettison/${JERSEY_VERSION}/jersey-media-json-jettison-${JERSEY_VERSION}.jar
processArtifact jersey-media-json-processing.jar http://repo.maven.apache.org/maven2/org/glassfish/jersey/media/jersey-media-json-processing/${JERSEY_VERSION}/jersey-media-json-processing-${JERSEY_VERSION}.jar
processArtifact jersey-media-moxy.jar http://repo.maven.apache.org/maven2/org/glassfish/jersey/media/jersey-media-moxy/${JERSEY_VERSION}/jersey-media-moxy-${JERSEY_VERSION}.jar
processArtifact jersey-media-multipart.jar http://repo.maven.apache.org/maven2/org/glassfish/jersey/media/jersey-media-multipart/${JERSEY_VERSION}/jersey-media-multipart-${JERSEY_VERSION}.jar
processArtifact jersey-media-sse.jar http://repo.maven.apache.org/maven2/org/glassfish/jersey/media/jersey-media-sse/${JERSEY_VERSION}/jersey-media-sse-${JERSEY_VERSION}.jar
# Backup and download new HK2
processArtifact hk2-api.jar http://central.maven.org/maven2/org/glassfish/hk2/hk2-api/${HK2_VERSION}/hk2-api-${HK2_VERSION}.jar
processArtifact class-model.jar http://central.maven.org/maven2/org/glassfish/hk2/class-model/${HK2_VERSION}/class-model-${HK2_VERSION}.jar
processArtifact core.jar http://central.maven.org/maven2/org/glassfish/hk2/core/${HK2_VERSION}/core-${HK2_VERSION}.jar
processArtifact hk2-locator.jar http://central.maven.org/maven2/org/glassfish/hk2/hk2-locator/${HK2_VERSION}/hk2-locator-${HK2_VERSION}.jar
processArtifact hk2-utils.jar http://central.maven.org/maven2/org/glassfish/hk2/hk2-utils/${HK2_VERSION}/hk2-utils-${HK2_VERSION}.jar
processArtifact hk2.jar http://central.maven.org/maven2/org/glassfish/hk2/hk2/${HK2_VERSION}/hk2-${HK2_VERSION}.jar
processArtifact hk2-runlevel.jar http://central.maven.org/maven2/org/glassfish/hk2/hk2-runlevel/${HK2_VERSION}/hk2-runlevel-${HK2_VERSION}.jar
processArtifact hk2-config.jar http://central.maven.org/maven2/org/glassfish/hk2/hk2-config/${HK2_VERSION}/hk2-config-${HK2_VERSION}.jar
processArtifact osgi-adapter.jar http://central.maven.org/maven2/org/glassfish/hk2/osgi-adapter/${HK2_VERSION}/osgi-adapter-${HK2_VERSION}.jar
processArtifact bean-validator-cdi.jar http://central.maven.org/maven2/org/glassfish/hk2/external/bean-validator-cdi/${HK2_VERSION}/bean-validator-cdi-${HK2_VERSION}.jar
processArtifact bean-validator.jar http://central.maven.org/maven2/org/glassfish/hk2/external/bean-validator/${HK2_VERSION}/bean-validator-${HK2_VERSION}.jar
processArtifact aopalliance-repackaged.jar http://central.maven.org/maven2/org/glassfish/hk2/external/aopalliance-repackaged/${HK2_VERSION}/aopalliance-repackaged-${HK2_VERSION}.jar
processArtifact asm-all-repackaged.jar http://central.maven.org/maven2/org/glassfish/hk2/external/asm-all-repackaged/${HK2_VERSION}/asm-all-repackaged-${HK2_VERSION}.jar
processArtifact javax.inject.jar http://central.maven.org/maven2/org/glassfish/hk2/external/javax.inject/${HK2_VERSION}/javax.inject-${HK2_VERSION}.jar
processArtifact javassist.jar http://repo.maven.apache.org/maven2/org/javassist/javassist/${JAVASSIST_VERSION}/javassist-${JAVASSIST_VERSION}.jar
# Clean up OSGi cache
if [ -d "$OSGI_CACHE_DIR" ]; then
rm -rf $OSGI_CACHE_DIR
fi
@jnwelzel

This comment has been minimized.

Copy link

jnwelzel commented Apr 1, 2014

Thanks! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.