Skip to content
Snippets Groups Projects
Commit 4992780a authored by yannick legoc's avatar yannick legoc
Browse files

Changed the way to deploy.

parent 1e0fa627
Branches
No related tags found
No related merge requests found
#!/bin/bash
# Get the arguments.
projectArtifactId=$1
swtPlatform=$2
projectVersion=$3
destDir=$4
# Check if the version is a snapshot
projectVersionWithoutSnapshot=${projectVersion%SNAPSHOT}
projectVersionWithSnapshot=$projectVersionWithoutSnapshot"SNAPSHOT"
if [[ "$projectVersionWithSnapshot" == "$projectVersion" ]]
then
echo "This is a snapshot version, deploying the full jar is not performed."
exit
fi
echo "Deploying the full jar."
jarFile="target/"$projectArtifactId"-"$swtPlatform"-"$projectVersion".jar"
destFile=$destDir"/"$projectArtifactId"-"$swtPlatform".jar"
cp $jarFile $destFile
echo "Copied $jarFile to $destFile."
\ No newline at end of file
......@@ -175,6 +175,28 @@
</configuration>
</plugin>
<!-- Purge the local repository when deploying the artifact.
This is necessary because the assembly plugin aggregates all the dependencies that could be modified locally, e.g. NomadCommandSystem
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>purge-local-dependencies</id>
<phase>deploy</phase>
<goals>
<goal>purge-local-repository</goal>
</goals>
<configuration>
<excludes>
</excludes>
</configuration>
</execution>
</executions>
</plugin>
<!-- Assemble a single jar -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
......@@ -198,7 +220,7 @@
</configuration>
<executions>
<execution>
<phase>package</phase>
<phase>deploy</phase>
<goals>
<goal>single</goal>
</goals>
......@@ -213,11 +235,16 @@
<version>1.8</version>
<executions>
<execution>
<id>install</id>
<phase>install</phase>
<id>deploy</id>
<phase>deploy</phase>
<configuration>
<target>
<copy file="target/${project.artifactId}-${swt.platform}-${project.version}.jar" tofile="${dest.dir}/${project.artifactId}-${swt.platform}.jar" />
<exec executable="${env.NOMADCLIENT_HOME}../Ploty/Deploy.sh">
<arg value="${project.artifactId}" />
<arg value="${swt.platform}" />
<arg value="${project.version}" />
<arg value="${dest.dir}" />
</exec>
</target>
</configuration>
<goals>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment