Skip to content

Commit 5291040

Browse files
committed
more log4j and sonar nonsense preping docker
1 parent 8b2e79c commit 5291040

3 files changed

Lines changed: 16 additions & 7 deletions

File tree

Examples/Docker/Dockerfile.offline

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ RUN cd ./Core && mvn -o install -Dmaven.repo.local=$LOCAL_REPO
4242
RUN mvn -o -Dopensextant.solr=./xponents-solr/solr7 \
4343
-Dmaven.repo.local=$LOCAL_REPO clean package dependency:copy-dependencies
4444

45+
# 1a. Log4J cleanup
46+
RUN for log4jdir in `find $LOCAL_REPO -type d | grep log4j | grep "2.11"`; do rm -rf $log4jdir; done
47+
48+
4549
# 2. Copy built items and metadata from install to final runtime CLASSPATH ./lib
4650
RUN cp ./target/*jar ./lib/
4751

script/dist-docker-offline.sh

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@ VERSION="3.5"
66
script=`dirname $0;`
77
basedir=`cd -P $script/..; echo $PWD`
88

9+
10+
run_sonar=0
911
SONAR_URL=http://localhost:9000
1012
if [ -n "$1" ]; then
1113
SONAR_URL=$1
1214
if [ -n "$2" ] ; then
1315
SONAR_TOKEN=$2
16+
# run sonar only if command line args are given
17+
run_sonar=1
1418
else
1519
echo "Usage: $0 SONAR_URL SONAR_TOKEN"
1620
echo
@@ -62,7 +66,7 @@ echo "++++++++++++++++ EXAMPLES ++++++++++++++++"
6266

6367

6468
# Code scan using Sonarqube:
65-
if [ -n "$SONAR_TOKEN" ]; then
69+
if [ $run_sonar -eq 1 ]; then
6670

6771
git init
6872
git add .gitignore pom.xml Core/pom.xml Core/src src script python
@@ -89,11 +93,6 @@ if [ -n "$SONAR_TOKEN" ]; then
8993
fi
9094

9195

92-
# Log4J cleanup
93-
for log4jdir in `find ./maven-repo -type d | grep log4j | grep "2.11"`; do
94-
echo "Remove $log4jdir"
95-
rm -rf $log4jdir
96-
done
9796

9897
# One last time: go-offline
9998
# -- Remove cache files from any Internet downloads
@@ -102,6 +101,12 @@ find ./$REPO -name "*.sha1" -exec rm {} \;
102101
find ./$REPO -name "*.repositories" -exec rm {} \;
103102
mvn dependency:go-offline -Dmaven.repo.local=$REPO
104103

104+
# Log4J cleanup
105+
for log4jdir in `find ./maven-repo -type d | grep log4j | grep "2.11"`; do
106+
echo "Remove $log4jdir"
107+
rm -rf $log4jdir
108+
done
109+
105110

106111
# Docker
107112
echo "++++++++++++++++ DOCKER / Maven Offline ++++++++++++++++"

script/dist.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ rm -r $REL/xponents-solr/retired
7474
rm -r $REL/xponents-solr/script/__pycache__
7575
rm -f $REL/xponents-solr/solr7-dist/licenses/log4j*2.11*
7676

77-
cp -r $basedir/dev.env $basedir/Examples/Docker/* $REL/
77+
cp -r $basedir/.gitignore $basedir/dev.env $basedir/Examples/Docker/* $REL/
7878
rm -r $REL/Sonarqube
7979

8080
# Distro has API docs in JAR files.

0 commit comments

Comments
 (0)