2020-04-28 17:56:21 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
jacksonGroupId=com.fasterxml.jackson.core
|
2020-04-28 18:52:00 +02:00
|
|
|
jacksonVersion=2.6.0
|
2020-04-28 17:56:21 +02:00
|
|
|
|
|
|
|
jacksonOriginalPackage=com.fasterxml.jackson
|
2020-04-28 18:18:46 +02:00
|
|
|
gCubePrefix=org.gcube
|
|
|
|
|
|
|
|
gCubeGroupId=org.gcube.common
|
2020-04-28 17:56:21 +02:00
|
|
|
|
2020-04-28 18:38:03 +02:00
|
|
|
for i in jackson-core jackson-annotations jackson-databind
|
|
|
|
#for i in jackson-core
|
2020-04-28 17:56:21 +02:00
|
|
|
do
|
|
|
|
jacksonArtifactId=$i
|
|
|
|
|
2020-04-28 18:29:31 +02:00
|
|
|
cp pom.repackage.template.xml pom.xml
|
2020-04-28 17:56:21 +02:00
|
|
|
|
|
|
|
sed -i 's/JACKSON_GROUP_ID/'"${jacksonGroupId}"'/g' pom.xml
|
|
|
|
sed -i 's/JACKSON_ARTIFACT_ID/'"${jacksonArtifactId}"'/g' pom.xml
|
|
|
|
sed -i 's/JACKSON_VERSION/'"${jacksonVersion}"'/g' pom.xml
|
|
|
|
|
|
|
|
sed -i 's/JACKSON_ORIGINAL_PACKAGE/'"${jacksonOriginalPackage}"'/g' pom.xml
|
2020-04-28 18:18:46 +02:00
|
|
|
sed -i 's/GCUBE_PREFIX/'"${gCubePrefix}"'/g' pom.xml
|
2020-04-28 17:56:21 +02:00
|
|
|
|
|
|
|
projectDir=${PWD}
|
|
|
|
|
|
|
|
mvn -U clean package
|
|
|
|
cd target
|
|
|
|
|
2020-04-28 18:18:46 +02:00
|
|
|
repackagedJacksonArtifact=repackaged-${jacksonArtifactId}-${jacksonVersion}
|
|
|
|
unzip ${repackagedJacksonArtifact}.jar -d ${repackagedJacksonArtifact}
|
|
|
|
|
|
|
|
|
|
|
|
if [ -d "${repackagedJacksonArtifact}/META-INF/services" ]; then
|
|
|
|
cd ${repackagedJacksonArtifact}/META-INF/services
|
2020-04-28 17:56:21 +02:00
|
|
|
for FILE in ${jacksonOriginalPackage}.*
|
|
|
|
do
|
2020-04-28 18:18:46 +02:00
|
|
|
sed -i 's/'"${jacksonOriginalPackage}"'/'"${gCubePrefix}.${jacksonOriginalPackage}"'/g' ${FILE}
|
|
|
|
mv ${FILE} ${gCubePrefix}.${FILE}
|
2020-04-28 17:56:21 +02:00
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
2020-04-28 18:18:46 +02:00
|
|
|
gCubeArtifactJar=gcube-${jacksonArtifactId}-${jacksonVersion}.jar
|
|
|
|
gCubeArtifactId=gcube-${jacksonArtifactId}
|
|
|
|
|
|
|
|
cd ${projectDir}/target/${repackagedJacksonArtifact}
|
|
|
|
zip -r ../${gCubeArtifactJar} .
|
|
|
|
|
|
|
|
cd ${projectDir}/target
|
2020-04-28 18:29:31 +02:00
|
|
|
|
|
|
|
cp ../pom.deploy.template.${jacksonArtifactId}.xml deploy.pom.xml
|
|
|
|
sed -i 's/JACKSON_ARTIFACT_ID/'"${jacksonArtifactId}"'/g' deploy.pom.xml
|
|
|
|
sed -i 's/JACKSON_VERSION/'"${jacksonVersion}"'/g' deploy.pom.xml
|
|
|
|
mvn install:install-file -DpomFile=deploy.pom.xml -Dfile=${gCubeArtifactJar}
|
2020-04-28 18:38:03 +02:00
|
|
|
|
|
|
|
#mvn deploy:deploy-file -DpomFile=deploy.pom.xml -Dfile=${gCubeArtifactJar}
|
2020-04-28 17:56:21 +02:00
|
|
|
|
|
|
|
cd ${projectDir}
|
2020-04-28 18:29:31 +02:00
|
|
|
mvn clean
|
2020-04-28 17:56:21 +02:00
|
|
|
rm pom.xml
|
2020-04-28 18:18:46 +02:00
|
|
|
rm dependency-reduced-pom.xml
|
2020-04-28 17:56:21 +02:00
|
|
|
done
|
|
|
|
|