Skip to content

Commit afff72a

Browse files
committed
Update JGit to 7.0, this now requires JDK 17
Also update commons-io, junit
1 parent 8b4513d commit afff72a

File tree

4 files changed

+20
-16
lines changed

4 files changed

+20
-16
lines changed

README.md

+8-4
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,16 @@ The JGit framework is rich and diverse, it has two layers, a low-level _api_ and
1010

1111
This project tries to provide a collection of ready-to-run snippets which provide a quick start for building functionality using JGit.
1212

13-
Please make sure to take a look at the nicely written [introduction](http://www.codeaffine.com/2015/12/15/getting-started-with-jgit/) and also use the existing [JavaDoc](http://download.eclipse.org/jgit/site/6.10.0.202406032230-r/apidocs/) and the [User Guide](http://wiki.eclipse.org/JGit/User_Guide) as well, as they are well done and provide detailed information and a general overview of JGit respectively.
13+
Please make sure to take a look at the nicely written [introduction](http://www.codeaffine.com/2015/12/15/getting-started-with-jgit/) and also use the existing [JavaDoc](https://download.eclipse.org/jgit/site/7.0.0.202409031743-r/apidocs/) and the [User Guide](http://wiki.eclipse.org/JGit/User_Guide) as well, as they are well done and provide detailed information and a general overview of JGit respectively.
1414

1515
*Note: Please use sites such as http://stackoverflow.com for general questions about JGit usage, not issues in this project. Issues should be used for problems with snippets and suggestions of missing snippets. Snippets from good answers on stackoverflow can then be included here, naturally.*
1616

1717
#### Getting started
1818

19+
##### Install JDK
20+
21+
You will need at least JDK 17 for JGit 7.0 and newer.
22+
1923
##### Grab it
2024

2125
git clone https://github.com/centic9/jgit-cookbook.git
@@ -134,12 +138,12 @@ Another simple way to start the sample-server is to run `./gradlew run` in the h
134138

135139
* Iterate all commits of a repository: https://gerrit.googlesource.com/plugins/branch-network/+log/refs/heads/master/src/main/java/com/googlesource/gerrit/plugins/branchnetwork/data/JGitFacade.java
136140
* Take some of the unit tests as example: https://github.com/eclipse/jgit/tree/master/org.eclipse.jgit.test/tst/org/eclipse/jgit/api
137-
* SubModules: http://stackoverflow.com/questions/13426798/jgit-read-gitmodules http://www.codeaffine.com/2014/04/16/how-to-manage-git-submodules-with-jgit/ https://stackoverflow.com/questions/26090139/jgit-reading-commits-from-a-submodule https://download.eclipse.org/jgit/site/6.10.0.202406032230-r/apidocs/org/eclipse/jgit/submodule/package-frame.html
141+
* SubModules: http://stackoverflow.com/questions/13426798/jgit-read-gitmodules http://www.codeaffine.com/2014/04/16/how-to-manage-git-submodules-with-jgit/ https://stackoverflow.com/questions/26090139/jgit-reading-commits-from-a-submodule https://download.eclipse.org/jgit/site/7.0.0.202409031743-r/apidocs/org/eclipse/jgit/submodule/package-frame.html
138142
* Diffing: http://stackoverflow.com/questions/12987364/how-to-diff-with-two-files-by-jgit-without-creating-repo
139143
* Amend a previous commit: http://stackoverflow.com/questions/4772142/jgit-unstaging-files-removing-files-from-the-index-and-ammending-a-commit
140144
* Remove a file from the index: http://stackoverflow.com/questions/4803462/jgit-java-git-library-unstaging-files
141145
* Git repo on Amazon S3: http://stackoverflow.com/questions/8744611/git-repository-on-s3-as-origin-not-as-backup http://stackoverflow.com/questions/7031729/publish-to-s3-using-git http://www.fancybeans.com/blog/2012/08/24/how-to-use-s3-as-a-private-git-repository/
142-
* CherryPick: http://download.eclipse.org/jgit/site/6.10.0.202406032230-r/apidocs/org/eclipse/jgit/api/CherryPickCommand.html http://stackoverflow.com/questions/18300898/how-to-cherry-pick-a-commit-that-has-more-than-one-parent
146+
* CherryPick: https://download.eclipse.org/jgit/site/7.0.0.202409031743-r/apidocs/org/eclipse/jgit/api/CherryPickCommand.html http://stackoverflow.com/questions/18300898/how-to-cherry-pick-a-commit-that-has-more-than-one-parent
143147
* More authentication: http://www.lordofthejars.com/2016/09/authenticating-with-jgit.html
144148
* How to do a shallow clone (i.e. --depth 1) as soon as https://bugs.eclipse.org/bugs/show_bug.cgi?id=475615 is implemented
145149

@@ -151,7 +155,7 @@ If you find these snippets useful and would like to support it, you can [Sponsor
151155

152156
The following sources were used to build the snippets:
153157

154-
* [JGit JavaDoc](http://download.eclipse.org/jgit/site/6.10.0.202406032230-r/apidocs/)
158+
* [JGit JavaDoc](https://download.eclipse.org/jgit/site/7.0.0.202409031743-r/apidocs/)
155159
* [JGit User Guide](http://wiki.eclipse.org/JGit/User_Guide)
156160
* [JGit related questions on stackoverflow](http://stackoverflow.com/questions/tagged/jgit)
157161
* [AlBlue's Blog: Embedding JGit](http://alblue.bandlem.com/2013/11/embedding-jgit.html)

build.gradle

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ repositories {
88
}
99

1010
dependencies {
11-
implementation 'org.eclipse.jgit:org.eclipse.jgit:6.10.0.202406032230-r'
12-
implementation 'org.eclipse.jgit:org.eclipse.jgit.archive:6.10.0.202406032230-r'
13-
implementation 'org.eclipse.jgit:org.eclipse.jgit.ssh.jsch:6.10.0.202406032230-r'
14-
implementation 'org.eclipse.jgit:org.eclipse.jgit.ssh.apache:6.10.0.202406032230-r'
15-
implementation 'commons-io:commons-io:2.17.0'
11+
implementation 'org.eclipse.jgit:org.eclipse.jgit:7.0.0.202409031743-r'
12+
implementation 'org.eclipse.jgit:org.eclipse.jgit.archive:7.0.0.202409031743-r'
13+
implementation 'org.eclipse.jgit:org.eclipse.jgit.ssh.jsch:7.0.0.202409031743-r'
14+
implementation 'org.eclipse.jgit:org.eclipse.jgit.ssh.apache:7.0.0.202409031743-r'
15+
implementation 'commons-io:commons-io:2.18.0'
1616
implementation 'org.slf4j:slf4j-simple:2.0.10'
1717

1818
// optional dependency of commons-compress which is needed by JGit
1919
implementation 'org.tukaani:xz:1.9'
2020

21-
testImplementation 'org.junit.vintage:junit-vintage-engine:5.11.0'
21+
testImplementation 'org.junit.vintage:junit-vintage-engine:5.11.3'
2222
}
2323

2424
wrapper {

httpserver/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ repositories {
1919
}
2020

2121
dependencies {
22-
implementation 'org.eclipse.jgit:org.eclipse.jgit.http.server:6.10.0.202406032230-r'
22+
implementation 'org.eclipse.jgit:org.eclipse.jgit.http.server:7.0.0.202409031743-r'
2323
implementation 'org.eclipse.jetty:jetty-servlet:9.4.51.v20230217'
2424

2525
implementation 'org.slf4j:slf4j-simple:2.0.10'

pom.xml

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,22 @@
2020
<dependency>
2121
<groupId>org.eclipse.jgit</groupId>
2222
<artifactId>org.eclipse.jgit</artifactId>
23-
<version>6.10.0.202406032230-r</version>
23+
<version>7.0.0.202409031743-r</version>
2424
</dependency>
2525
<dependency>
2626
<groupId>org.eclipse.jgit</groupId>
2727
<artifactId>org.eclipse.jgit.archive</artifactId>
28-
<version>6.10.0.202406032230-r</version>
28+
<version>7.0.0.202409031743-r</version>
2929
</dependency>
3030
<dependency>
3131
<groupId>org.eclipse.jgit</groupId>
3232
<artifactId>org.eclipse.jgit.ssh.jsch</artifactId>
33-
<version>6.10.0.202406032230-r</version>
33+
<version>7.0.0.202409031743-r</version>
3434
</dependency>
3535
<dependency>
3636
<groupId>org.eclipse.jgit</groupId>
3737
<artifactId>org.eclipse.jgit.ssh.apache</artifactId>
38-
<version>6.10.0.202406032230-r</version>
38+
<version>7.0.0.202409031743-r</version>
3939
</dependency>
4040

4141
<dependency>
@@ -59,7 +59,7 @@
5959
<dependency>
6060
<groupId>org.junit.vintage</groupId>
6161
<artifactId>junit-vintage-engine</artifactId>
62-
<version>5.11.0</version>
62+
<version>5.11.3</version>
6363
<scope>test</scope>
6464
</dependency>
6565
</dependencies>

0 commit comments

Comments
 (0)