Skip to content

Commit 0df48c3

Browse files
authored
Merge branch 'master' into issue_500_create_tag_method
2 parents ff397df + ec31e94 commit 0df48c3

157 files changed

Lines changed: 36795 additions & 193 deletions

File tree

Some content is hidden

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

.github/workflows/maven-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
matrix:
1212
java: [ '1.8.0', '11.0.x', '13.0.x' ]
1313
steps:
14-
- uses: actions/checkout@v1
14+
- uses: actions/checkout@v2
1515
- name: Set up JDK
1616
uses: actions/setup-java@v1
1717
with:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ target
77
.project
88
.settings/
99
.DS_Store
10+
11+
dependency-reduced-pom.xml

pom.xml

Lines changed: 147 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
22
<modelVersion>4.0.0</modelVersion>
3-
<parent>
4-
<groupId>org.kohsuke</groupId>
5-
<artifactId>pom</artifactId>
6-
<version>21</version>
7-
<relativePath />
8-
</parent>
9-
3+
<groupId>org.kohsuke</groupId>
104
<artifactId>github-api</artifactId>
115
<version>1.102-SNAPSHOT</version>
126
<name>GitHub API for Java</name>
@@ -21,6 +15,16 @@
2115
</scm>
2216

2317
<distributionManagement>
18+
<snapshotRepository>
19+
<id>sonatype-nexus-snapshots</id>
20+
<name>Sonatype Nexus Snapshots</name>
21+
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
22+
</snapshotRepository>
23+
<repository>
24+
<id>sonatype-nexus-staging</id>
25+
<name>Nexus Release Repository</name>
26+
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
27+
</repository>
2428
<site>
2529
<id>github-pages</id>
2630
<url>gitsite:git@github.com/github-api/${project.artifactId}.git</url>
@@ -56,6 +60,14 @@
5660
<artifactId>maven-scm-manager-plexus</artifactId>
5761
<version>1.11.2</version>
5862
</extension>
63+
<!-- Doing site publishing manually for now -->
64+
<!--
65+
<extension>
66+
<groupId>org.kohsuke</groupId>
67+
<artifactId>wagon-gitsite</artifactId>
68+
<version>0.3.5</version>
69+
</extension>
70+
-->
5971
</extensions>
6072
<testResources>
6173
<testResource>
@@ -67,7 +79,16 @@
6779
</testResources>
6880
<pluginManagement>
6981
<plugins>
70-
<!-- adds jacoco coverage -->
82+
<plugin>
83+
<groupId>org.apache.maven.plugins</groupId>
84+
<artifactId>maven-source-plugin</artifactId>
85+
<version>3.2.1</version>
86+
</plugin>
87+
<plugin>
88+
<groupId>org.apache.maven.plugins</groupId>
89+
<artifactId>maven-gpg-plugin</artifactId>
90+
<version>1.6</version>
91+
</plugin>
7192
<plugin>
7293
<groupId>org.jacoco</groupId>
7394
<artifactId>jacoco-maven-plugin</artifactId>
@@ -80,6 +101,18 @@
80101
<configuration>
81102
<source>8</source>
82103
<failOnWarnings>true</failOnWarnings>
104+
<doclint>all</doclint>
105+
</configuration>
106+
</plugin>
107+
<plugin>
108+
<groupId>org.sonatype.plugins</groupId>
109+
<artifactId>nexus-staging-maven-plugin</artifactId>
110+
<version>1.6.8</version>
111+
<extensions>true</extensions>
112+
<configuration>
113+
<serverId>sonatype-nexus-staging</serverId>
114+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
115+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
83116
</configuration>
84117
</plugin>
85118
</plugins>
@@ -101,6 +134,10 @@
101134
<goals>deploy</goals>
102135
</configuration>
103136
</plugin>
137+
<plugin>
138+
<groupId>org.sonatype.plugins</groupId>
139+
<artifactId>nexus-staging-maven-plugin</artifactId>
140+
</plugin>
104141
<plugin>
105142
<groupId>org.apache.maven.plugins</groupId>
106143
<artifactId>maven-project-info-reports-plugin</artifactId>
@@ -224,17 +261,6 @@
224261
</dependency>
225262
</dependencies>
226263
</plugin>
227-
<!-- Do not use gmaven plugin -->
228-
<plugin>
229-
<groupId>org.codehaus.gmaven</groupId>
230-
<artifactId>gmaven-plugin</artifactId>
231-
<executions>
232-
<execution>
233-
<goals>
234-
</goals>
235-
</execution>
236-
</executions>
237-
</plugin>
238264
</plugins>
239265
</build>
240266

@@ -272,7 +298,7 @@
272298
<dependency>
273299
<groupId>com.fasterxml.jackson.core</groupId>
274300
<artifactId>jackson-databind</artifactId>
275-
<version>2.10.1</version>
301+
<version>2.10.2</version>
276302
</dependency>
277303
<dependency>
278304
<groupId>commons-io</groupId>
@@ -285,6 +311,27 @@
285311
<version>1.18</version>
286312
<optional>true</optional>
287313
</dependency>
314+
<!-- for stapler-jetty -->
315+
<dependency>
316+
<groupId>commons-fileupload</groupId>
317+
<artifactId>commons-fileupload</artifactId>
318+
<version>1.4</version>
319+
<scope>test</scope>
320+
</dependency>
321+
<!-- for stapler-jetty -->
322+
<dependency>
323+
<groupId>commons-discovery</groupId>
324+
<artifactId>commons-discovery</artifactId>
325+
<version>0.5</version>
326+
<scope>test</scope>
327+
</dependency>
328+
<!-- for stapler-jetty -->
329+
<dependency>
330+
<groupId>org.kohsuke.stapler</groupId>
331+
<artifactId>stapler</artifactId>
332+
<version>1.258</version>
333+
<scope>test</scope>
334+
</dependency>
288335
<dependency>
289336
<groupId>org.kohsuke.stapler</groupId>
290337
<artifactId>stapler-jetty</artifactId>
@@ -367,12 +414,60 @@
367414
</pluginRepository>
368415
</pluginRepositories>
369416
<profiles>
417+
<profile>
418+
<id>enable-shade</id>
419+
<activation>
420+
<property>
421+
<name>enable-shade</name>
422+
</property>
423+
</activation>
424+
<build>
425+
<plugins>
426+
<plugin>
427+
<groupId>org.apache.maven.plugins</groupId>
428+
<artifactId>maven-shade-plugin</artifactId>
429+
<executions>
430+
<execution>
431+
<phase>package</phase>
432+
<goals>
433+
<goal>shade</goal>
434+
</goals>
435+
<configuration>
436+
<artifactSet>
437+
<excludes>
438+
<exclude>com.infradna.tool:bridge-method-annotation</exclude>
439+
<exclude>org.jenkins-ci:annotation-indexer</exclude>
440+
<exclude>com.squareup.*:*</exclude>
441+
<exclude>org.jetbrains*:*</exclude>
442+
<exclude>com.github.spotbugs:*</exclude>
443+
<exclude>com.google.code.findbugs:*</exclude>
444+
</excludes>
445+
</artifactSet>
446+
<filters>
447+
<filter>
448+
<artifact>*:*</artifact>
449+
<excludes>
450+
<exclude>module-info.class</exclude>
451+
<exclude>META-INF/*.SF</exclude>
452+
<exclude>META-INF/*.DSA</exclude>
453+
<exclude>META-INF/*.RSA</exclude>
454+
</excludes>
455+
</filter>
456+
</filters>
457+
</configuration>
458+
</execution>
459+
</executions>
460+
</plugin>
461+
</plugins>
462+
</build>
463+
</profile>
370464
<profile>
371465
<id>ci</id>
372466
<properties>
373467
<formatter-maven-plugin.goal>validate</formatter-maven-plugin.goal>
374468
<impsort-maven-plugin.goal>check</impsort-maven-plugin.goal>
375469
<enable-jacoco>true</enable-jacoco>
470+
<enable-shade>true</enable-shade>
376471
<jacoco.haltOnFailure>true</jacoco.haltOnFailure>
377472
</properties>
378473
<build>
@@ -390,7 +485,6 @@
390485
<plugin>
391486
<groupId>org.jacoco</groupId>
392487
<artifactId>jacoco-maven-plugin</artifactId>
393-
<version>0.8.5</version>
394488
<executions>
395489
<execution>
396490
<goals>
@@ -512,12 +606,14 @@
512606
</profile>
513607
<profile>
514608
<id>release</id>
609+
<properties>
610+
<enable-shade>true</enable-shade>
611+
</properties>
515612
<build>
516613
<plugins>
517614
<plugin>
518615
<groupId>org.apache.maven.plugins</groupId>
519616
<artifactId>maven-gpg-plugin</artifactId>
520-
<version>1.6</version>
521617
<executions>
522618
<execution>
523619
<id>sign-artifacts</id>
@@ -537,7 +633,26 @@
537633
<plugin>
538634
<groupId>org.apache.maven.plugins</groupId>
539635
<artifactId>maven-source-plugin</artifactId>
540-
<version>3.2.1</version>
636+
<executions>
637+
<execution>
638+
<id>attach-sources</id>
639+
<goals>
640+
<goal>jar-no-fork</goal>
641+
</goals>
642+
</execution>
643+
</executions>
644+
</plugin>
645+
<plugin>
646+
<groupId>org.apache.maven.plugins</groupId>
647+
<artifactId>maven-javadoc-plugin</artifactId>
648+
<executions>
649+
<execution>
650+
<id>attach-javadocs</id>
651+
<goals>
652+
<goal>jar</goal>
653+
</goals>
654+
</execution>
655+
</executions>
541656
</plugin>
542657
</plugins>
543658
</build>
@@ -571,4 +686,13 @@
571686
<archive>https://groups.google.com/forum/#!forum/github-api</archive>
572687
</mailingList>
573688
</mailingLists>
689+
690+
<developers>
691+
<developer>
692+
<name>Kohsuke Kawaguchi</name>
693+
<id>kohsuke</id>
694+
<email>kk@kohsuke.org</email>
695+
</developer>
696+
</developers>
697+
574698
</project>

src/main/java/org/kohsuke/github/GHApp.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ GHApp wrapUp(GitHub root) {
180180
public PagedIterable<GHAppInstallation> listInstallations() {
181181
return root.createRequest()
182182
.withPreview(MACHINE_MAN)
183-
.asPagedIterable("/app/installations", GHAppInstallation[].class, item -> item.wrapUp(root));
183+
.withUrlPath("/app/installations")
184+
.toIterable(GHAppInstallation[].class, item -> item.wrapUp(root));
184185
}
185186

186187
/**

src/main/java/org/kohsuke/github/GHCommit.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -442,10 +442,9 @@ private GHUser resolveUser(User author) throws IOException {
442442
*/
443443
public PagedIterable<GHCommitComment> listComments() {
444444
return owner.root.createRequest()
445-
.asPagedIterable(
446-
String.format("/repos/%s/%s/commits/%s/comments", owner.getOwnerName(), owner.getName(), sha),
447-
GHCommitComment[].class,
448-
item -> item.wrap(owner));
445+
.withUrlPath(
446+
String.format("/repos/%s/%s/commits/%s/comments", owner.getOwnerName(), owner.getName(), sha))
447+
.toIterable(GHCommitComment[].class, item -> item.wrap(owner));
449448
}
450449

451450
/**

src/main/java/org/kohsuke/github/GHCommitComment.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ public GHReaction createReaction(ReactionContent content) throws IOException {
138138
public PagedIterable<GHReaction> listReactions() {
139139
return owner.root.createRequest()
140140
.withPreview(SQUIRREL_GIRL)
141-
.asPagedIterable(getApiTail() + "/reactions", GHReaction[].class, item -> item.wrap(owner.root));
141+
.withUrlPath(getApiTail() + "/reactions")
142+
.toIterable(GHReaction[].class, item -> item.wrap(owner.root));
142143
}
143144

144145
/**

src/main/java/org/kohsuke/github/GHCommitQueryBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,6 @@ public GHCommitQueryBuilder until(long timestamp) {
127127
* @return the paged iterable
128128
*/
129129
public PagedIterable<GHCommit> list() {
130-
return req.asPagedIterable(repo.getApiTailUrl("commits"), GHCommit[].class, item -> item.wrapUp(repo));
130+
return req.withUrlPath(repo.getApiTailUrl("commits")).toIterable(GHCommit[].class, item -> item.wrapUp(repo));
131131
}
132132
}

src/main/java/org/kohsuke/github/GHContent.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,7 @@ public PagedIterable<GHContent> listDirectoryContent() throws IOException {
237237
if (!isDirectory())
238238
throw new IllegalStateException(path + " is not a directory");
239239

240-
return root.createRequest()
241-
.setRawUrlPath(url)
242-
.asPagedIterable(GHContent[].class, item -> item.wrap(repository));
240+
return root.createRequest().setRawUrlPath(url).toIterable(GHContent[].class, item -> item.wrap(repository));
243241
}
244242

245243
/**

src/main/java/org/kohsuke/github/GHDeployment.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,9 @@ public GHDeploymentStatusBuilder createStatus(GHDeploymentState state) {
131131
* @return the paged iterable
132132
*/
133133
public PagedIterable<GHDeploymentStatus> listStatuses() {
134-
return root.createRequest().asPagedIterable(statuses_url, GHDeploymentStatus[].class, item -> item.wrap(owner));
134+
return root.createRequest()
135+
.withUrlPath(statuses_url)
136+
.toIterable(GHDeploymentStatus[].class, item -> item.wrap(owner));
135137
}
136138

137139
}

src/main/java/org/kohsuke/github/GHGist.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,9 @@ public GHGist fork() throws IOException {
223223
* @return the paged iterable
224224
*/
225225
public PagedIterable<GHGist> listForks() {
226-
return root.createRequest().asPagedIterable(getApiTailUrl("forks"), GHGist[].class, item -> item.wrapUp(root));
226+
return root.createRequest()
227+
.withUrlPath(getApiTailUrl("forks"))
228+
.toIterable(GHGist[].class, item -> item.wrapUp(root));
227229
}
228230

229231
/**

0 commit comments

Comments
 (0)