forked from forcedotcom/dataloader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dlbuilder.sh
executable file
·23 lines (19 loc) · 1.07 KB
/
dlbuilder.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
# script parameters
#
run_mvn() {
# run a mvn build to download dependencies from the central maven repo
mvn clean compile
# remove vulnerable class from log4j jar file
log4j_version_num=$(awk '/<artifactId>log4j-core/{getline; print}' pom.xml | awk '{$1=$1};1' )
log4j_version_num=${log4j_version_num#<version>};
log4j_version_num=${log4j_version_num%</version>};
echo "removing JndiLookup.class from ${log4j_version_num}"
zip -q -d "${HOME}/.m2/repository/org/apache/logging/log4j/log4j-core/${log4j_version_num}/log4j-core-${log4j_version_num}.jar org/apache/logging/log4j/core/lookup/JndiLookup.class"
zip -q -d "${HOME}/.m2/repository/org/apache/logging/log4j/log4j-core/${log4j_version_num}/log4j-core-${log4j_version_num}.jar org/apache/logging/log4j/core/appender/mom/JmsAppender.class"
zip -q -d "${HOME}/.m2/repository/org/apache/logging/log4j/log4j-core/${log4j_version_num}/log4j-core-${log4j_version_num}.jar org/apache/logging/log4j/core/appender/db/jdbc/JdbcAppender.class"
# build uber jar
mvn clean package
}
#################
run_mvn