Skip to content

Commit 0e60871

Browse files
authored
Merge pull request hub4j#587 from bitwiseman/site-build
Fix site errors
2 parents 739551c + 5f967e6 commit 0e60871

File tree

9 files changed

+98
-11
lines changed

9 files changed

+98
-11
lines changed

.github/workflows/maven-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ jobs:
1919
- name: Maven Download all dependencies
2020
run: mvn -B org.apache.maven.plugins:maven-dependency-plugin:3.1.1:go-offline
2121
- name: Maven Build
22-
run: mvn -B package --file pom.xml
22+
run: mvn -B install site --file pom.xml

pom.xml

Lines changed: 79 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,18 @@
4444
</properties>
4545

4646
<build>
47+
<extensions>
48+
<extension>
49+
<groupId>org.apache.maven.scm</groupId>
50+
<artifactId>maven-scm-provider-gitexe</artifactId>
51+
<version>1.11.2</version>
52+
</extension>
53+
<extension>
54+
<groupId>org.apache.maven.scm</groupId>
55+
<artifactId>maven-scm-manager-plexus</artifactId>
56+
<version>1.11.2</version>
57+
</extension>
58+
</extensions>
4759
<testResources>
4860
<testResource>
4961
<directory>src/test/resources</directory>
@@ -60,9 +72,45 @@
6072
<artifactId>jacoco-maven-plugin</artifactId>
6173
<version>0.8.5</version>
6274
</plugin>
75+
<plugin>
76+
<groupId>org.apache.maven.plugins</groupId>
77+
<artifactId>maven-javadoc-plugin</artifactId>
78+
<version>3.1.1</version>
79+
<configuration>
80+
<source>8</source>
81+
</configuration>
82+
</plugin>
6383
</plugins>
6484
</pluginManagement>
6585
<plugins>
86+
<plugin>
87+
<groupId>org.apache.maven.plugins</groupId>
88+
<artifactId>maven-site-plugin</artifactId>
89+
<version>3.8.2</version>
90+
</plugin>
91+
<plugin>
92+
<groupId>org.apache.maven.plugins</groupId>
93+
<artifactId>maven-release-plugin</artifactId>
94+
<version>2.5.3</version>
95+
<configuration>
96+
<autoVersionSubmodules>true</autoVersionSubmodules>
97+
<useReleaseProfile>false</useReleaseProfile>
98+
<releaseProfiles>release</releaseProfiles>
99+
<goals>deploy</goals>
100+
</configuration>
101+
</plugin>
102+
<plugin>
103+
<groupId>org.apache.maven.plugins</groupId>
104+
<artifactId>maven-project-info-reports-plugin</artifactId>
105+
<version>3.0.0</version>
106+
<dependencies>
107+
<dependency>
108+
<groupId>org.apache.bcel</groupId>
109+
<artifactId>bcel</artifactId>
110+
<version>6.4.1</version>
111+
</dependency>
112+
</dependencies>
113+
</plugin>
66114
<plugin>
67115
<artifactId>maven-compiler-plugin</artifactId>
68116
<version>3.8.1</version>
@@ -292,7 +340,7 @@
292340
<id>jacoco</id>
293341
<activation>
294342
<property>
295-
<name>!jacoco.disabled</name>
343+
<name>enable-jacoco</name>
296344
</property>
297345
</activation>
298346
<build>
@@ -385,13 +433,43 @@
385433
</plugins>
386434
</build>
387435
</profile>
436+
<profile>
437+
<id>release</id>
438+
<build>
439+
<plugins>
440+
<plugin>
441+
<groupId>org.apache.maven.plugins</groupId>
442+
<artifactId>maven-gpg-plugin</artifactId>
443+
<version>1.6</version>
444+
<executions>
445+
<execution>
446+
<id>sign-artifacts</id>
447+
<phase>verify</phase>
448+
<goals>
449+
<goal>sign</goal>
450+
</goals>
451+
</execution>
452+
</executions>
453+
</plugin>
454+
<plugin>
455+
<groupId>org.apache.maven.plugins</groupId>
456+
<artifactId>maven-source-plugin</artifactId>
457+
<version>3.1.0</version>
458+
</plugin>
459+
</plugins>
460+
</build>
461+
</profile>
388462
</profiles>
389463
<reporting>
390464
<plugins>
391465
<plugin>
392466
<groupId>org.apache.maven.plugins</groupId>
393467
<artifactId>maven-javadoc-plugin</artifactId>
394468
</plugin>
469+
<plugin>
470+
<groupId>org.apache.maven.plugins</groupId>
471+
<artifactId>maven-project-info-reports-plugin</artifactId>
472+
</plugin>
395473
</plugins>
396474
</reporting>
397475

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ public abstract class AbuseLimitHandler {
2727
* this exception (or wrap this exception into another exception and throw it).
2828
* @param uc
2929
* Connection that resulted in an error. Useful for accessing other response headers.
30+
* @throws IOException
3031
*/
3132
public abstract void onError(IOException e, HttpURLConnection uc) throws IOException;
3233

@@ -38,7 +39,7 @@ public abstract class AbuseLimitHandler {
3839
public void onError(IOException e, HttpURLConnection uc) throws IOException {
3940
try {
4041
Thread.sleep(parseWaitTime(uc));
41-
} catch (InterruptedException _) {
42+
} catch (InterruptedException ex) {
4243
throw (InterruptedIOException)new InterruptedIOException().initCause(e);
4344
}
4445
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ public void setPermissions(Map<String, String> permissions) {
104104
* You must use a JWT to access this endpoint.
105105
*
106106
* @see <a href="https://developer.github.com/v3/apps/#list-installations">List installations</a>
107+
* @return a list of App installations
107108
*/
108109
@Preview @Deprecated
109110
public PagedIterable<GHAppInstallation> listInstallations() {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
/**
3434
* A GitHub project.
35-
* @see https://developer.github.com/v3/projects/
35+
* @see <a href="https://developer.github.com/v3/projects/">Projects</a>
3636
* @author Martin van Zijl
3737
*/
3838
public class GHProject extends GHObject {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ public GHHook getHook(int id) throws IOException {
866866

867867
/**
868868
* Gets a comparison between 2 points in the repository. This would be similar
869-
* to calling <tt>git log id1...id2</tt> against a local repository.
869+
* to calling <code>git log id1...id2</code> against a local repository.
870870
* @param id1 an identifier for the first point to compare from, this can be a sha1 ID (for a commit, tag etc) or a direct tag name
871871
* @param id2 an identifier for the second point to compare to. Can be the same as the first point.
872872
* @return the comparison output
@@ -928,7 +928,7 @@ public PagedIterable<GHRef> listRefs() throws IOException {
928928

929929
/**
930930
* Retrieves all refs of the given type for the current GitHub repository.
931-
* @param refType the type of reg to search for e.g. <tt>tags</tt> or <tt>commits</tt>
931+
* @param refType the type of reg to search for e.g. <code>tags</code> or <code>commits</code>
932932
* @return an array of all refs matching the request type
933933
* @throws IOException on failure communicating with GitHub, potentially due to an invalid ref type being requested
934934
*/
@@ -939,7 +939,7 @@ public GHRef[] getRefs(String refType) throws IOException {
939939
/**
940940
* Retrieves all refs of the given type for the current GitHub repository.
941941
*
942-
* @param refType the type of reg to search for e.g. <tt>tags</tt> or <tt>commits</tt>
942+
* @param refType the type of reg to search for e.g. <code>tags</code> or <code>commits</code>
943943
* @return paged iterable of all refs of the specified type
944944
* @throws IOException on failure communicating with GitHub, potentially due to an invalid ref type being requested
945945
*/

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public class GitHub {
115115
*
116116
* @param apiUrl
117117
* The URL of GitHub (or GitHub enterprise) API endpoint, such as "https://api.github.com" or
118-
* "http://ghe.acme.com/api/v3". Note that GitHub Enterprise has <tt>/api/v3</tt> in the URL.
118+
* "http://ghe.acme.com/api/v3". Note that GitHub Enterprise has <code>/api/v3</code> in the URL.
119119
* For historical reasons, this parameter still accepts the bare domain name, but that's considered deprecated.
120120
* Password is also considered deprecated as it is no longer required for api usage.
121121
* @param login
@@ -180,7 +180,7 @@ public static GitHub connectToEnterprise(String apiUrl, String oauthAccessToken)
180180
*
181181
* @param apiUrl
182182
* The URL of GitHub (or GitHub Enterprise) API endpoint, such as "https://api.github.com" or
183-
* "http://ghe.acme.com/api/v3". Note that GitHub Enterprise has <tt>/api/v3</tt> in the URL.
183+
* "http://ghe.acme.com/api/v3". Note that GitHub Enterprise has <code>/api/v3</code> in the URL.
184184
* For historical reasons, this parameter still accepts the bare domain name, but that's considered deprecated.
185185
*/
186186
public static GitHub connectToEnterpriseWithOAuth(String apiUrl, String login, String oauthAccessToken) throws IOException {
@@ -551,7 +551,7 @@ public Map<String, GHOrganization> getUserPublicOrganizations(GHUser user) throw
551551
*
552552
* To retrieve full organization details, you need to call {@link #getOrganization(String)}
553553
*
554-
* @param user the user to retrieve public Organization membership information for
554+
* @param login the user to retrieve public Organization membership information for
555555
*
556556
* @return the public Organization memberships for the user
557557
*/

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public static GitHubBuilder fromProperties(Properties props) {
160160
/**
161161
* @param endpoint
162162
* The URL of GitHub (or GitHub enterprise) API endpoint, such as "https://api.github.com" or
163-
* "http://ghe.acme.com/api/v3". Note that GitHub Enterprise has <tt>/api/v3</tt> in the URL.
163+
* "http://ghe.acme.com/api/v3". Note that GitHub Enterprise has <code>/api/v3</code> in the URL.
164164
* For historical reasons, this parameter still accepts the bare domain name, but that's considered deprecated.
165165
*/
166166
public GitHubBuilder withEndpoint(String endpoint) {

src/test/java/org/kohsuke/github/GitHubStaticTest.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ public void timeRoundTrip() throws Exception {
2626
Date instantSeconds = Date.from(instantNow.truncatedTo(ChronoUnit.SECONDS));
2727
Date instantMillis = Date.from(instantNow.truncatedTo(ChronoUnit.MILLIS));
2828

29+
// if we happen to land exactly on zero milliseconds, add 1 milli
30+
if (instantSeconds.equals(instantMillis)) {
31+
instantMillis = Date.from(instantNow.plusMillis(1).truncatedTo(ChronoUnit.MILLIS));
32+
}
33+
2934
// TODO: other formats
3035
String instantFormatSlash = formatDate(instantMillis, "yyyy/MM/dd HH:mm:ss ZZZZ");
3136
String instantFormatDash = formatDate(instantMillis, "yyyy-MM-dd'T'HH:mm:ss'Z'");
@@ -40,6 +45,7 @@ public void timeRoundTrip() throws Exception {
4045
assertThat(instantSeconds,
4146
equalTo(GitHub.parseDate(GitHub.printDate(instantSeconds))));
4247

48+
// printDate will truncate to the nearest second, so it should not be equal
4349
assertThat(instantMillis,
4450
not(equalTo(GitHub.parseDate(GitHub.printDate(instantMillis)))));
4551

@@ -49,6 +55,7 @@ public void timeRoundTrip() throws Exception {
4955
assertThat(instantSeconds,
5056
equalTo(GitHub.parseDate(instantFormatDash)));
5157

58+
// This parser does not truncate to the nearest second, so it will be equal
5259
assertThat(instantMillis,
5360
equalTo(GitHub.parseDate(instantFormatMillis)));
5461

0 commit comments

Comments
 (0)