Creating project

This commit is contained in:
Luca Frosini 2020-04-28 17:56:21 +02:00
commit fce8d94c72
3 changed files with 111 additions and 0 deletions

0
README.md Normal file
View File

45
createAndDeploy.sh Executable file
View File

@ -0,0 +1,45 @@
#!/bin/bash
jacksonGroupId=com.fasterxml.jackson.core
jacksonVersion=2.10.3
jacksonOriginalPackage=com.fasterxml.jackson
gcubePrefix=org.gcube
#for i in jackson-core jackson-annotations jackson-databind
for i in jackson-core
do
jacksonArtifactId=$i
cp pom.template.xml pom.xml
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
sed -i 's/GCUBE_PREFIX/'"${gcubePrefix}"'/g' pom.xml
projectDir=${PWD}
mvn -U clean package
cd target
unzip gcube-${jacksonArtifactId}-1.0.0.jar -d ${jacksonArtifactId}
if [ -d "${jacksonArtifactId}/META-INF/services" ]; then
cd ${jacksonArtifactId}/META-INF/services
for FILE in ${jacksonOriginalPackage}.*
do
sed -i 's/'"${jacksonOriginalPackage}"'/'"${gcubePrefix}.${jacksonOriginalPackage}"'/g' ${FILE}
mv ${FILE} ${gcubePrefix}.${FILE}
done
fi
cd ${projectDir}/target/${jacksonArtifactId}
zip -r ../gcube-${jacksonArtifactId}-${jacksonVersion}.jar .
cd ${projectDir}
rm pom.xml
done

66
pom.template.xml Normal file
View File

@ -0,0 +1,66 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.gcube.common</groupId>
<artifactId>JACKSON_ARTIFACT_ID</artifactId>
<version>JACKSON_VERSION</version>
<description>JACKSON_ARTIFACT_ID repackaged artifact</description>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>JACKSON_GROUP_ID</groupId>
<artifactId>JACKSON_ARTIFACT_ID</artifactId>
<version>JACKSON_VERSION</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<shadedArtifactAttached>false</shadedArtifactAttached>
<artifactSet>
<includes>
<include>JACKSON_GROUP_ID:JACKSON_ARTIFACT_ID</include>
</includes>
</artifactSet>
<relocations>
<relocation>
<pattern>JACKSON_ORIGINAL_PACKAGE</pattern>
<shadedPattern>GCUBE_PREFIX.JACKSON_ORIGINAL_PACKAGE</shadedPattern>
</relocation>
</relocations>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/license/**</exclude>
<exclude>META-INF/*</exclude>
<exclude>META-INF/maven/**</exclude>
<exclude>LICENSE</exclude>
<exclude>NOTICE</exclude>
<exclude>/*.txt</exclude>
<exclude>build.properties</exclude>
</excludes>
</filter>
</filters>
</configuration>
</plugin>
</plugins>
</build>
</project>