aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.pgm
diff options
context:
space:
mode:
authorMedha Bhargav Prabhala <mprabhala@salesforce.com>2018-12-03 20:13:27 +0100
committerGunnar Wagenknecht <gunnar@wagenknecht.org>2019-01-16 10:05:10 +0100
commit137e91a4654b4f516d1f82885c669e14473dbfd6 (patch)
tree729d177de129ac05110ef6f03a7595dbeb632371 /org.eclipse.jgit.pgm
parent9150f5d83654b2589c4dba2aeb76582de8df37f4 (diff)
downloadjgit-137e91a4654b4f516d1f82885c669e14473dbfd6.tar.gz
jgit-137e91a4654b4f516d1f82885c669e14473dbfd6.zip
Implement signing commits using BouncyCastle
This also includes a change to generating the jgit CLI jar. Shading is no longer possible because it breaks the signature of BouncyCastle. Instead, the Spring Boot Loader Maven plug-in is now used to generate an executable jar. Bug: 382212 Change-Id: I35ee3d4b06d9d479475ab2e51b29bed49661bbdc Also-by: Gunnar Wagenknecht <gunnar@wagenknecht.org> Signed-off-by: Gunnar Wagenknecht <gunnar@wagenknecht.org> Signed-off-by: Medha Bhargav Prabhala <mprabhala@salesforce.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.pgm')
-rw-r--r--org.eclipse.jgit.pgm/jgit.sh4
-rw-r--r--org.eclipse.jgit.pgm/pom.xml47
-rw-r--r--org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java2
3 files changed, 17 insertions, 36 deletions
diff --git a/org.eclipse.jgit.pgm/jgit.sh b/org.eclipse.jgit.pgm/jgit.sh
index 826714751c..e263782738 100644
--- a/org.eclipse.jgit.pgm/jgit.sh
+++ b/org.eclipse.jgit.pgm/jgit.sh
@@ -110,9 +110,9 @@ then
LESS=${LESS:-FSRX}
export LESS
- "$java" $java_args org.eclipse.jgit.pgm.Main "$@" | $use_pager
+ "$java" $java_args org.springframework.boot.loader.JarLauncher "$@" | $use_pager
exit
else
- exec "$java" $java_args org.eclipse.jgit.pgm.Main "$@"
+ exec "$java" $java_args org.springframework.boot.loader.JarLauncher "$@"
exit 1
fi
diff --git a/org.eclipse.jgit.pgm/pom.xml b/org.eclipse.jgit.pgm/pom.xml
index 049d4de4af..6faaa00eb4 100644
--- a/org.eclipse.jgit.pgm/pom.xml
+++ b/org.eclipse.jgit.pgm/pom.xml
@@ -172,40 +172,19 @@
</plugin>
<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-shade-plugin</artifactId>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
- <phase>package</phase>
<goals>
- <goal>shade</goal>
+ <goal>repackage</goal>
</goals>
<configuration>
<finalName>jgit-cli</finalName>
- <createDependencyReducedPom>false</createDependencyReducedPom>
- <transformers>
- <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
- <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
- <manifestEntries>
- <Main-Class>org.eclipse.jgit.pgm.Main</Main-Class>
- <Implementation-Title>JGit Command Line Interface</Implementation-Title>
- </manifestEntries>
- </transformer>
- </transformers>
- <filters>
- <!-- exclude the signing data for individual jars, ueberjar will be signed again -->
- <filter>
- <artifact>*:*</artifact>
- <excludes>
- <exclude>META-INF/*.SF</exclude>
- <exclude>META-INF/*.DSA</exclude>
- <exclude>META-INF/*.RSA</exclude>
- <exclude>OSGI-OPT/**</exclude>
- </excludes>
- </filter>
- </filters>
- <shadedArtifactAttached>true</shadedArtifactAttached>
- <shadedClassifierName>shaded</shadedClassifierName> <!-- Any name that makes sense -->
+ <attach>false</attach>
+ <mainClass>org.eclipse.jgit.pgm.Main</mainClass>
+ <executable>true</executable>
+ <embeddedLaunchScript>jgit.sh</embeddedLaunchScript>
</configuration>
</execution>
</executions>
@@ -220,11 +199,13 @@
<phase>package</phase>
<configuration>
<target>
- <concat destfile="${basedir}/target/jgit" force="yes" binary="true">
- <fileset file="${basedir}/jgit.sh" />
- <fileset file="${basedir}/target/jgit-cli.jar" />
- </concat>
- <chmod file="${basedir}/target/jgit" perm="a+x"/>
+ <move
+ file="${basedir}/target/jgit-cli.jar"
+ force="yes"
+ tofile="${basedir}/target/jgit" />
+ <chmod
+ file="${basedir}/target/jgit"
+ perm="a+x" />
</target>
</configuration>
<goals>
diff --git a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java
index 81c4731914..00d2d100d2 100644
--- a/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java
+++ b/org.eclipse.jgit.pgm/src/org/eclipse/jgit/pgm/Commit.java
@@ -120,7 +120,7 @@ class Commit extends TextBuiltin {
try {
commit = commitCmd.call();
} catch (JGitInternalException e) {
- throw die(e.getMessage());
+ throw die(e.getMessage(), e);
}
String branchName;