Skip to content

Commit

Permalink
Fixed maven url issues with jetty
Browse files Browse the repository at this point in the history
  • Loading branch information
Tien Tran committed Jun 3, 2018
1 parent 46f2c23 commit db4f7e1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Dockerfile.jdk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@ RUN apk --no-cache add tar curl tzdata && \
rm -rf /opt/jetty.tar.gz && \
mv /opt/jetty-distribution-* /opt/jetty && \
rm -rf /opt/jetty/demo-base && \
# fix gibberish in module file
sed -i 's|jar.*$|jar|g' /opt/jetty/modules/gcloud-datastore.mod && \
# fix maven urls resolved to outdated central.maven.org
for f in `ls -1 /opt/jetty/modules/*.mod`; do \
for u in `grep -oE 'maven://[^|]+' $f`; do \
path=`echo $u | cut -d '/' -f 3`;\
path=${path//./\/};\
artifact=`echo $u | cut -d '/' -f 4`;\
version=`echo $u | cut -d '/' -f 5`;\
regex="s|$u|https://repo1.maven.org/maven2/$path/$artifact/$version/$artifact-$version.jar|g";\
sed -i $regex $f;\
done \
done && \
chown -R alpine:alpine /opt/jetty && \
apk del tar curl && \
rm -rf /apk /tmp/* /var/cache/apk/*
Expand Down
13 changes: 13 additions & 0 deletions Dockerfile.jre
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@ RUN apk --no-cache add tar curl tzdata && \
rm -rf /opt/jetty.tar.gz && \
mv /opt/jetty-distribution-* /opt/jetty && \
rm -rf /opt/jetty/demo-base && \
# fix gibberish in module file
sed -i 's|jar.*$|jar|g' /opt/jetty/modules/gcloud-datastore.mod && \
# fix maven urls resolved to outdated central.maven.org
for f in `ls -1 /opt/jetty/modules/*.mod`; do \
for u in `grep -oE 'maven://[^|]+' $f`; do \
path=`echo $u | cut -d '/' -f 3`;\
path=${path//./\/};\
artifact=`echo $u | cut -d '/' -f 4`;\
version=`echo $u | cut -d '/' -f 5`;\
regex="s|$u|https://repo1.maven.org/maven2/$path/$artifact/$version/$artifact-$version.jar|g";\
sed -i $regex $f;\
done \
done && \
chown -R alpine:alpine /opt/jetty && \
apk del tar curl && \
rm -rf /apk /tmp/* /var/cache/apk/*
Expand Down

0 comments on commit db4f7e1

Please sign in to comment.