Skip to content

Commit 347114c

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents 07e3a69 + e71f22b commit 347114c

File tree

602 files changed

+7842
-5906
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

602 files changed

+7842
-5906
lines changed

.github/workflows/ci-build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ jobs:
1616
- uses: actions/checkout@v4
1717
with:
1818
fetch-depth: 0
19-
- name: Setup JDK 8
19+
- name: Setup JDK 11
2020
uses: actions/setup-java@v3
2121
with:
2222
distribution: temurin
23-
java-version: 8
23+
java-version: 11
2424
- name: Setup Gradle
2525
uses: gradle/actions/setup-gradle@v3
2626
- name: GitLab4j verify

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*.pydevproject
1717
.project
1818
.metadata
19-
/bin
19+
bin/
2020
tmp/
2121
*.tmp
2222
*.bak

README.md

Lines changed: 35 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -7,69 +7,40 @@
77
GitLab4J™ API (gitlab4j-api) provides a full featured and easy to consume Java library for working with GitLab repositories via the GitLab REST API. Additionally, full support for working with GitLab webhooks and system hooks is also provided.
88

99
---
10-
## Table of Contents
11-
* [GitLab Server Version Support](#gitLab-server-version-support)<br/>
12-
* [Using GitLab4J-API](#using-gitlab4j-api)<br/>
13-
* [Java 8 Requirement](#java-8-requirement)<br/>
14-
* [Javadocs](#javadocs)<br/>
15-
* [Project Set Up](#project-set-up)<br/>
16-
* [Usage Examples](#usage-examples)<br/>
17-
* [Setting Request Timeouts](#setting-request-timeouts)<br/>
18-
* [Connecting Through a Proxy Server](#connecting-through-a-proxy-server)<br/>
19-
* [GitLab API V3 and V4 Support](#gitLab-api-v3-and-v4-support)<br/>
20-
* [Logging of API Requests and Responses](#logging-of-api-requests-and-responses)<br/>
21-
* [Results Paging](#results-paging)<br/>
22-
* [Java 8 Stream Support](#java-8-stream-support)<br/>
23-
* [Eager evaluation example usage](#eager-evaluation-example-usage)<br/>
24-
* [Lazy evaluation example usage](#lazy%20evaluation-example-usage)<br/>
25-
* [Java 8 Optional&lt;T&gt; Support](#java-8-optional-support)<br/>
26-
* [Issue Time Estimates](#issue-time-estimates)<br/>
27-
* [Making API Calls](#making-api-calls)<br/>
28-
* [Available Sub APIs](#available-sub-apis)
29-
30-
---
31-
32-
> **Warning**
33-
> If you are looking for our next major version `6.x.x` which is requiring **Java 11** as mimimal version and which is using Jakarta EE components using the `jakarta.*` packages instead of `javax.*` check the [`6.x` branch](https://github.com/gitlab4j/gitlab4j-api/tree/6.x).
34-
> The `6.x.x` version is the one you need if you are using Spring Boot 3 and Spring Framework 6.0, .
35-
3610
## GitLab Server Version Support
3711

38-
GitLab4J-API supports version 11.0+ of GitLab Community Edition [(gitlab-ce)](https://gitlab.com/gitlab-org/gitlab-ce/) and GitLab Enterprise Edition [(gitlab-ee)](https://gitlab.com/gitlab-org/gitlab-ee/).
39-
40-
GitLab released GitLab Version 11.0 in June of 2018 which included many major changes to GitLab. If you are using GitLab server earlier than version 11.0, it is highly recommended that you either update your GitLab install or use a version of this library that was released around the same time as the version of GitLab you are using.
12+
GitLab4J-API supports both GitLab Community Edition [(gitlab-ce)](https://gitlab.com/gitlab-org/gitlab-ce/) and GitLab Enterprise Edition [(gitlab-ee)](https://gitlab.com/gitlab-org/gitlab-ee/).
4113

4214
**NOTICE**:
4315
As of GitLab 11.0 support for the GitLab API v3 has been removed from the GitLab server (see https://about.gitlab.com/2018/06/01/api-v3-removal-impending/). Support for GitLab API v3 will be removed from this library sometime in 2019. If you are utilizing the v3 support, please update your code to use GitLab API v4.
4416

4517
---
4618
## Using GitLab4J-API
4719

48-
### **Java 8 Requirement**
49-
As of GitLab4J-API 4.8.0, Java 8+ is now required to use GitLab4J-API.
20+
### **Java 11 Requirement**
21+
As of GitLab4J-API 6.0.0, Java 11+ is now required to use GitLab4J-API.
5022

5123
### **Javadocs**
5224
Javadocs are available here: [![javadoc.io](https://javadoc.io/badge2/org.gitlab4j/gitlab4j-api/javadoc.io.svg)](https://javadoc.io/doc/org.gitlab4j/gitlab4j-api)
5325

5426

5527
### **Project Set Up**
5628
To utilize GitLab4J&trade; API in your Java project, simply add the following dependency to your project's build file:<br />
29+
5730
**Gradle: build.gradle**
5831
```java
5932
dependencies {
6033
...
61-
compile group: 'org.gitlab4j', name: 'gitlab4j-api', version: '5.7.0'
34+
implementation group: 'org.gitlab4j', name: 'gitlab4j-api', version: '6.0.0-rc.7'
6235
}
6336
```
6437

65-
**NOTE:** Pulling dependencies may fail when using Gradle prior to 4.5. See [Gradle issue 3065](https://github.com/gradle/gradle/issues/3065#issuecomment-364092456)
66-
6738
**Maven: pom.xml**
6839
```xml
6940
<dependency>
7041
<groupId>org.gitlab4j</groupId>
7142
<artifactId>gitlab4j-api</artifactId>
72-
<version>5.7.0</version>
43+
<version>6.0.0-rc.7</version>
7344
</dependency>
7445
```
7546

@@ -80,7 +51,7 @@ dependencies {
8051
Just add this line at the top of your script:
8152

8253
```java
83-
//DEPS org.gitlab4j:gitlab4j-api:5.7.0
54+
//DEPS org.gitlab4j:gitlab4j-api:6.0.0-rc.7
8455
```
8556

8657
**Ivy and SBT**<br/>
@@ -148,20 +119,44 @@ You can also point to a specific commit:
148119

149120
```gradle
150121
dependencies {
151-
implementation 'com.github.gitlab4j:gitlab4j-api:6561c93aaf'
122+
implementation 'com.github.gitlab4j:gitlab4j-api:7dfec10189'
152123
}
153124
```
154125

155126
```xml
156127
<dependency>
157128
<groupId>com.github.gitlab4j</groupId>
158129
<artifactId>gitlab4j-api</artifactId>
159-
<version>6561c93aaf</version>
130+
<version>7dfec10189</version>
160131
</dependency>
161132
```
162133

163134
```java
164-
//DEPS https://github.com/gitlab4j/gitlab4j-api/tree/6561c93aafa6bf35cb9bad0617127a0c249a8f9f
135+
//DEPS https://github.com/gitlab4j/gitlab4j-api/tree/7dfec10189cdcb11e34fc9ead984abcd6316194a
136+
```
137+
138+
---
139+
140+
### **Models jar**
141+
142+
For some usages, the HTTP layer based on Jersey can't be used.
143+
Those projects might want to use the Jackson-based model classes, and implement the REST call themself.
144+
145+
**Gradle: build.gradle**
146+
```java
147+
dependencies {
148+
...
149+
implementation 'org.gitlab4j:gitlab4j-models:6.0.0-rc.7'
150+
}
151+
```
152+
153+
**Maven: pom.xml**
154+
```xml
155+
<dependency>
156+
<groupId>org.gitlab4j</groupId>
157+
<artifactId>gitlab4j-models</artifactId>
158+
<version>6.0.0-rc.7</version>
159+
</dependency>
165160
```
166161

167162
---
@@ -641,7 +636,7 @@ List<Runner> runners = gitLabApi.getRunnersApi().getAllRunners();
641636
#### SearchApi
642637
```java
643638
// Do a global search for Projects
644-
List<?> projects = gitLabApi.getSearchApi().globalSearch(SearchScope.PROJECTS, "text-to-search-for");
639+
List<Project> projects = gitLabApi.getSearchApi().globalSearch(SearchScope.PROJECTS, "text-to-search-for");
645640
```
646641

647642
#### ServicesApi

build.gradle

Lines changed: 49 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
21
plugins {
3-
id 'java-library'
4-
id 'com.diffplug.spotless' version '6.2.0'
5-
id 'signing'
6-
id 'maven-publish'
2+
id 'com.diffplug.spotless' version '6.25.0' apply false
73
id 'io.github.gradle-nexus.publish-plugin' version '1.3.0'
84
id 'net.researchgate.release' version '3.0.2'
95
}
@@ -12,58 +8,52 @@ wrapper {
128
gradleVersion = '7.6.2'
139
}
1410

15-
group = 'org.gitlab4j'
16-
17-
dependencies {
18-
api 'jakarta.activation:jakarta.activation-api:1.2.2'
19-
api 'org.glassfish.jersey.inject:jersey-hk2:2.39.1'
20-
api 'org.glassfish.jersey.core:jersey-client:2.39.1'
21-
api 'org.glassfish.jersey.connectors:jersey-apache-connector:2.39.1'
22-
api 'org.glassfish.jersey.media:jersey-media-multipart:2.39.1'
23-
api 'org.glassfish.jersey.media:jersey-media-json-jackson:2.39.1'
24-
api 'jakarta.servlet:jakarta.servlet-api:4.0.4'
25-
testImplementation 'org.mockito:mockito-core:4.4.0'
26-
testImplementation 'org.mockito:mockito-junit-jupiter:4.4.0'
27-
testImplementation 'org.hamcrest:hamcrest-all:1.3'
28-
testImplementation 'uk.org.webcompere:system-stubs-jupiter:1.2.0'
29-
testImplementation "org.junit.jupiter:junit-jupiter-api:5.10.4"
30-
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.10.4"
31-
}
11+
String groupId = 'org.gitlab4j'
3212

33-
signing {
34-
useGpgCmd()
35-
sign(publishing.publications)
36-
}
13+
subprojects {
14+
apply plugin: 'java-library'
15+
apply plugin: 'signing'
16+
apply plugin: 'com.diffplug.spotless'
17+
apply plugin: 'maven-publish'
3718

38-
tasks.withType(Sign) {
39-
onlyIf {
40-
project.hasProperty('signing.gnupg.keyName')
19+
group = groupId
20+
21+
signing {
22+
useGpgCmd()
23+
sign(publishing.publications)
24+
}
25+
26+
tasks.withType(Sign) {
27+
onlyIf {
28+
project.hasProperty('signing.gnupg.keyName')
29+
}
4130
}
42-
}
4331

44-
java {
45-
withJavadocJar()
46-
withSourcesJar()
32+
java {
33+
withJavadocJar()
34+
withSourcesJar()
4735

48-
compileJava.options.encoding = "UTF-8"
49-
toolchain {
50-
languageVersion = JavaLanguageVersion.of(8)
36+
compileJava.options.encoding = "UTF-8"
37+
toolchain {
38+
languageVersion = JavaLanguageVersion.of(11)
39+
}
5140
}
52-
}
5341

54-
tasks.named('test') {
55-
useJUnitPlatform()
56-
}
42+
spotless {
43+
java {
44+
palantirJavaFormat()
45+
importOrder 'java', 'javax', 'jakarta', 'org', 'com', ''
46+
removeUnusedImports()
47+
}
48+
}
5749

58-
repositories {
59-
mavenCentral()
60-
}
50+
repositories {
51+
// mavenLocal()
52+
mavenCentral()
53+
}
6154

62-
spotless {
63-
java {
64-
palantirJavaFormat()
65-
importOrder 'java', 'javax', 'jakarta', 'org', 'com', ''
66-
removeUnusedImports()
55+
tasks.named('test') {
56+
useJUnitPlatform()
6757
}
6858
}
6959

@@ -78,47 +68,6 @@ nexusPublishing {
7868
}
7969
}
8070

81-
publishing {
82-
publications {
83-
mavenJava(MavenPublication) {
84-
pom {
85-
name = 'GitLab4J-API - GitLab API Java Client'
86-
description = 'GitLab4J-API (gitlab4j-api) provides a full featured Java client library for working with GitLab repositories and servers via the GitLab REST API.'
87-
packaging = 'jar'
88-
url = 'https://' + "$githubRepositoryOwner" + '.github.io/' + "$githubRepositoryName" + '/'
89-
licenses {
90-
license {
91-
name = 'The MIT License (MIT)'
92-
url = 'http://opensource.org/licenses/MIT'
93-
distribution = 'repo'
94-
}
95-
}
96-
developers {
97-
developer {
98-
id = 'gmessner'
99-
name = 'Greg Messner'
100-
email = 'greg@messners.com'
101-
}
102-
developer {
103-
id = 'gdesaintmartinlacaze'
104-
name = 'Gautier de Saint Martin Lacaze'
105-
email = 'gautier@jabby-techs.fr'
106-
}
107-
developer {
108-
url = 'https://github.com/orgs/' + "$githubRepositoryOwner" + '/people'
109-
}
110-
}
111-
scm {
112-
connection = 'scm:git:https://github.com/' + "$githubRepositoryOwner" + '/' + "$githubRepositoryName" + '.git'
113-
developerConnection = 'scm:git:https://github.com/' + "$githubRepositoryOwner" + '/' + "$githubRepositoryName" + '.git'
114-
url = 'https://github.com/' + "$githubRepositoryOwner" + '/' + "$githubRepositoryName" + '/'
115-
}
116-
}
117-
from components.java
118-
}
119-
}
120-
}
121-
12271
release {
12372
buildTasks = ['doRelease']
12473
git {
@@ -144,16 +93,21 @@ def updateLastVersionValueTask = tasks.register('updateLastVersionValue') {
14493
def newVersion = project.findProperty('release.releaseVersion') ?: version.replace('-SNAPSHOT', '')
14594
content = content.replaceAll("lastVersion=[0-9a-z\\.\\-]+", "lastVersion=" + newVersion)
14695
propertiesFile.text = content
96+
97+
def readmeFile = file('README.md')
98+
def readme = readmeFile.text
99+
readme = readme.replace(lastVersion, newVersion)
100+
readmeFile.text = readme
147101
}
148102
}
149103

150-
tasks.register('doRelease') {
104+
task doRelease {
151105
dependsOn(
152-
checkLastVersionValueTask,
153-
'initializeSonatypeStagingRepository',
154-
'clean',
155-
'build',
156-
project.getTasksByName('publishToSonatype', true)
106+
checkLastVersionValueTask,
107+
'initializeSonatypeStagingRepository',
108+
'clean',
109+
'build',
110+
project.getTasksByName('publishToSonatype', true)
157111
)
158112
}
159113

0 commit comments

Comments
 (0)