Skip to content

Commit d92a24e

Browse files
committed
merge in and resolve one conflict
2 parents 0ee8032 + bed8df5 commit d92a24e

File tree

597 files changed

+7342
-4718
lines changed

Some content is hidden

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

597 files changed

+7342
-4718
lines changed

README.md

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,15 @@
11
# GitLab4J&trade; API (gitlab4j-api)<br />Java Client Library for the GitLab REST API
22

33
[![Maven Central](https://img.shields.io/maven-central/v/org.gitlab4j/gitlab4j-api.svg)](http://mvnrepository.com/artifact/org.gitlab4j/gitlab4j-api)
4-
[![Build Status](https://github.com/gitlab4j/gitlab4j-api/actions/workflows/ci-build.yml/badge.svg?branch=6.x)](https://github.com/gitlab4j/gitlab4j-api/actions/workflows/ci-build.yml)
4+
[![Build Status](https://github.com/gitlab4j/gitlab4j-api/actions/workflows/ci-build.yml/badge.svg?branch=main)](https://github.com/gitlab4j/gitlab4j-api/actions/workflows/ci-build.yml)
55
[![javadoc.io](https://javadoc.io/badge2/org.gitlab4j/gitlab4j-api/javadoc.io.svg)](https://javadoc.io/doc/org.gitlab4j/gitlab4j-api)
66

77
GitLab4J&trade; 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

9-
---
10-
## Table of Contents
11-
* [GitLab Server Version Support](#gitLab-server-version-support)<br/>
12-
* [Using GitLab4J-API](#using-gitlab4j-api)<br/>
13-
* [Java 11 Requirement](#java-11-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-
309
---
3110
## GitLab Server Version Support
3211

33-
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/).
34-
35-
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/).
3613

3714
**NOTICE**:
3815
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.
@@ -49,22 +26,21 @@ Javadocs are available here: [![javadoc.io](https://javadoc.io/badge2/org.gitlab
4926

5027
### **Project Set Up**
5128
To utilize GitLab4J&trade; API in your Java project, simply add the following dependency to your project's build file:<br />
29+
5230
**Gradle: build.gradle**
5331
```java
5432
dependencies {
5533
...
56-
compile group: 'org.gitlab4j', name: 'gitlab4j-api', version: '6.0.0-rc.6'
34+
implementation group: 'org.gitlab4j', name: 'gitlab4j-api', version: '6.0.0-rc.7'
5735
}
5836
```
5937

60-
**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)
61-
6238
**Maven: pom.xml**
6339
```xml
6440
<dependency>
6541
<groupId>org.gitlab4j</groupId>
6642
<artifactId>gitlab4j-api</artifactId>
67-
<version>6.0.0-rc.6</version>
43+
<version>6.0.0-rc.7</version>
6844
</dependency>
6945
```
7046

@@ -75,7 +51,7 @@ dependencies {
7551
Just add this line at the top of your script:
7652

7753
```java
78-
//DEPS org.gitlab4j:gitlab4j-api:6.0.0-rc.6
54+
//DEPS org.gitlab4j:gitlab4j-api:6.0.0-rc.7
7955
```
8056

8157
**Ivy and SBT**<br/>
@@ -96,14 +72,14 @@ repositories {
9672
maven {
9773
url "https://jitpack.io"
9874
content {
99-
includeGroup "com.github.gitlab4j"
75+
includeGroup "com.github.gitlab4j.gitlab4j-api"
10076
}
10177
}
10278
}
10379
10480
dependencies {
10581
// ...
106-
implementation 'com.github.gitlab4j:gitlab4j-api:6.x-SNAPSHOT'
82+
implementation 'com.github.gitlab4j.gitlab4j-api:gitlab4j-api:main-SNAPSHOT'
10783
// ...
10884
}
10985
```
@@ -120,9 +96,9 @@ dependencies {
12096

12197
<dependencies>
12298
<dependency>
123-
<groupId>com.github.gitlab4j</groupId>
99+
<groupId>com.github.gitlab4j.gitlab4j-api</groupId>
124100
<artifactId>gitlab4j-api</artifactId>
125-
<version>6.x-SNAPSHOT</version>
101+
<version>main-SNAPSHOT</version>
126102
</dependency>
127103
<!-- ... -->
128104
</dependencies>
@@ -133,30 +109,54 @@ dependencies {
133109
You just need to declare the dependency like this, instead of using the maven coordinates:
134110

135111
```java
136-
//DEPS https://github.com/gitlab4j/gitlab4j-api/tree/6.x#:SNAPSHOT
112+
//DEPS https://github.com/gitlab4j/gitlab4j-api/tree/main#gitlab4j-api:SNAPSHOT
137113
```
138114

139115
**Using a specific commit**
140116

141-
Version `6.x-SNAPSHOT` indicates that you would like to get the latest of the `main` branch.
117+
Version `main-SNAPSHOT` indicates that you would like to get the latest of the `main` branch.
142118
You can also point to a specific commit:
143119

144120
```gradle
145121
dependencies {
146-
implementation 'com.github.gitlab4j:gitlab4j-api:b6148593a3'
122+
implementation 'com.github.gitlab4j.gitlab4j-api:gitlab4j-api:ab6b84c6b0'
147123
}
148124
```
149125

150126
```xml
151127
<dependency>
152-
<groupId>com.github.gitlab4j</groupId>
128+
<groupId>com.github.gitlab4j.gitlab4j-api</groupId>
153129
<artifactId>gitlab4j-api</artifactId>
154-
<version>b6148593a3</version>
130+
<version>ab6b84c6b0</version>
155131
</dependency>
156132
```
157133

158134
```java
159-
//DEPS https://github.com/gitlab4j/gitlab4j-api/tree/b6148593a3405cc60968bd247cd7910aae9375e2
135+
//DEPS https://github.com/gitlab4j/gitlab4j-api/tree/ab6b84c6b096ea3079d25115a59c272a4ae602aa
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>
160160
```
161161

162162
---

build.gradle

Lines changed: 50 additions & 96 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.25.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:2.1.1'
19-
api 'org.glassfish.jersey.inject:jersey-hk2:3.1.1'
20-
api 'org.glassfish.jersey.core:jersey-client:3.1.1'
21-
api 'org.glassfish.jersey.connectors:jersey-apache-connector:3.1.1'
22-
api 'org.glassfish.jersey.media:jersey-media-multipart:3.1.1'
23-
api 'org.glassfish.jersey.media:jersey-media-json-jackson:3.1.1'
24-
api 'jakarta.servlet:jakarta.servlet-api:6.0.0'
25-
testImplementation 'org.mockito:mockito-core:5.2.0'
26-
testImplementation 'org.mockito:mockito-junit-jupiter:5.2.0'
27-
testImplementation 'org.hamcrest:hamcrest-all:1.3'
28-
testImplementation 'uk.org.webcompere:system-stubs-jupiter:2.0.2'
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(11)
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,51 +68,10 @@ 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 {
125-
requireBranch.set('6.x')
74+
requireBranch.set('main')
12675
}
12776
}
12877

@@ -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)