From 86fb5028a44025d7270f89277d489247aec1c3f2 Mon Sep 17 00:00:00 2001 From: Hammy Date: Sat, 5 Jun 2021 03:08:00 +0100 Subject: [PATCH 1/7] Add Jenkinsfile --- Jenkinsfile | 94 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..f3a8538 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,94 @@ +pipeline { + agent { + docker { + image "maven:3.8.1-adoptopenjdk-11" + args '-v /root/.m2:/root/.m2' + } + } + + environment { + NEXUS_VERSION = "nexus3" + NEXUS_PROTOCOL = "https" + NEXUS_REPOSITORY = "maven-goudham" + NEXUS_URL = credentials('fe3e0c7e-bcb1-4d55-9591-f55f71f42356') + NEXUS_CREDENTIAL_ID = 'e5582b32-3507-4e88-ab7c-d16d701c46e9' + + CODECOV_TOKEN = credentials('44a3c021-5cbb-4a6f-bea2-ae6c51d43038') + } + + stages { + stage("Building") { + steps { + sh "mvn -B -DskipTests clean install" + } + } + stage("Testing") { + steps { + sh "mvn test" + } + } + stage("Deploying To Nexus") { + when { + branch 'release' + } + steps { + script { + pom = readMavenPom file: "pom.xml"; + filesByGlob = findFiles(glob: "target/*.${pom.packaging}"); + + echo "${filesByGlob[0].name} ${filesByGlob[0].path} ${filesByGlob[0].directory} ${filesByGlob[0].length} ${filesByGlob[0].lastModified}" + + artifactPath = filesByGlob[0].path; + artifactExists = fileExists artifactPath; + + if (artifactExists) { + echo "*** File: ${artifactPath}, group: ${pom.groupId}, packaging: ${pom.packaging}, version ${pom.version}"; + + nexusArtifactUploader( + nexusVersion: NEXUS_VERSION, + protocol: NEXUS_PROTOCOL, + nexusUrl: NEXUS_URL, + groupId: pom.groupId, + version: pom.version, + repository: NEXUS_REPOSITORY, + credentialsId: NEXUS_CREDENTIAL_ID, + artifacts: [ + [artifactId: pom.artifactId, + classifier: '', + file: artifactPath, + type: pom.packaging], + + [artifactId: pom.artifactId, + classifier: '', + file: "pom.xml", + type: "pom"] + ] + ) + } else { + error "*** File: ${artifactPath}, could not be found"; + } + } + } + } + } + + post { + success { + echo "I'm Feeling Swag!" + + echo "Generating Test Report..." + publishCoverage adapters: [jacocoAdapter('target/site/jacoco/jacoco.xml')] + + echo "Sending Report to CodeCov..." + sh '''#!/bin/bash + bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN || echo "Codecov did not collect coverage reports" + ''' + } + failure { + echo 'Not Very Swag :(' + } + cleanup { + cleanWs() + } + } +} \ No newline at end of file From 1296aaffa957cb2f88db0d5f8ecdc5da9e340b93 Mon Sep 17 00:00:00 2001 From: Hammy Date: Sat, 5 Jun 2021 03:13:25 +0100 Subject: [PATCH 2/7] Update pom.xml Disable document checks --- pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/pom.xml b/pom.xml index 2766e38..3767ed7 100644 --- a/pom.xml +++ b/pom.xml @@ -13,6 +13,7 @@ UTF-8 11 11 + -Docent:none From 85e21582420371a248a941f9c3c2dad8d5e2cb2b Mon Sep 17 00:00:00 2001 From: Hammy Date: Sat, 5 Jun 2021 03:16:51 +0100 Subject: [PATCH 3/7] Update pom.xml Try to disable document checks on javadocs --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3767ed7..7c96367 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ UTF-8 11 11 - -Docent:none + none From 02d2dcfda331579939d9e35d7c1c330ad24855a7 Mon Sep 17 00:00:00 2001 From: Hammy Date: Sat, 5 Jun 2021 03:24:08 +0100 Subject: [PATCH 4/7] Fix HTML Tags Ensure that the HTML tags included are correctly used --- .../java/org/goudham/me/MyWaifuClient.java | 5 +- .../goudham/me/api/entity/PaginationData.java | 12 ++-- .../org/goudham/me/api/entity/Studio.java | 9 ++- .../me/api/entity/series/FilteredSeries.java | 17 +++--- .../goudham/me/api/entity/series/Series.java | 27 +++++---- .../goudham/me/api/entity/user/TrueLove.java | 10 +++- .../org/goudham/me/api/entity/user/User.java | 19 +++--- .../goudham/me/api/entity/user/UserList.java | 12 ++-- .../me/api/entity/waifu/Appearance.java | 17 +++--- .../me/api/entity/waifu/FilteredWaifu.java | 25 ++++---- .../goudham/me/api/entity/waifu/Waifu.java | 59 ++++++++++--------- .../me/api/entity/waifu/WaifuImage.java | 11 ++-- 12 files changed, 128 insertions(+), 95 deletions(-) diff --git a/src/main/java/org/goudham/me/MyWaifuClient.java b/src/main/java/org/goudham/me/MyWaifuClient.java index e8a407e..2dae6d8 100644 --- a/src/main/java/org/goudham/me/MyWaifuClient.java +++ b/src/main/java/org/goudham/me/MyWaifuClient.java @@ -14,11 +14,8 @@ import java.util.concurrent.Executor; /** * A MyWaifuClient * - *

Main entry point for retrieving information from MyWaifuList.

+ *

Main entry point for retrieving information from MyWaifuList.

*

{@link MyWaifuWrapper} is utilised to make the API requests

- *

Examples of such methods include: - *

  • {@link }
  • - *

    */ public class MyWaifuClient { private final MyWaifuWrapper myWaifuWrapper; diff --git a/src/main/java/org/goudham/me/api/entity/PaginationData.java b/src/main/java/org/goudham/me/api/entity/PaginationData.java index 9883837..6c08c9d 100644 --- a/src/main/java/org/goudham/me/api/entity/PaginationData.java +++ b/src/main/java/org/goudham/me/api/entity/PaginationData.java @@ -12,10 +12,14 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; * {@link PaginationData} *

    Contains standard Pagination data from the API

    * - *
  • {@link Integer currentPage}
  • - *
  • {@link Integer lastPage}
  • - *
  • {@link Integer perPage}
  • - *
  • {@link Integer total}
  • + *

    Fields included are:

    + *
      + *
    • {@link Integer currentPage}
    • + *
    • {@link Integer lastPage}
    • + *
    • {@link Integer perPage}
    • + *
    • {@link Integer total}
    • + *
    + * */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ diff --git a/src/main/java/org/goudham/me/api/entity/Studio.java b/src/main/java/org/goudham/me/api/entity/Studio.java index a52b95c..dbe47fa 100644 --- a/src/main/java/org/goudham/me/api/entity/Studio.java +++ b/src/main/java/org/goudham/me/api/entity/Studio.java @@ -14,9 +14,12 @@ import java.util.Objects; *

    Contains information on a given animation or game development studio

    * *

    Fields included are:

    - *
  • {@link Integer id}
  • - *
  • {@link String name}
  • - *
  • {@link String originalName}
  • + *
      + *
    • {@link Integer id}
    • + *
    • {@link String name}
    • + *
    • {@link String originalName}
    • + *
    + * */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ diff --git a/src/main/java/org/goudham/me/api/entity/series/FilteredSeries.java b/src/main/java/org/goudham/me/api/entity/series/FilteredSeries.java index 4858263..3c30991 100644 --- a/src/main/java/org/goudham/me/api/entity/series/FilteredSeries.java +++ b/src/main/java/org/goudham/me/api/entity/series/FilteredSeries.java @@ -15,13 +15,16 @@ import java.util.Objects; *

    Contains basic series information for most endpoints

    * *

    Fields included are:

    - *
  • {@link String name}
  • - *
  • {@link String originalName}
  • - *
  • {@link String romajiName}
  • - *
  • {@link String slug}
  • - *
  • {@link String description}
  • - *
  • {@link String url}
  • - *
  • {@link Integer id}
  • + *
      + *
    • {@link String name}
    • + *
    • {@link String originalName}
    • + *
    • {@link String romajiName}
    • + *
    • {@link String slug}
    • + *
    • {@link String description}
    • + *
    • {@link String url}
    • + *
    • {@link Integer id}
    • + *
    + * */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ diff --git a/src/main/java/org/goudham/me/api/entity/series/Series.java b/src/main/java/org/goudham/me/api/entity/series/Series.java index b952753..632a182 100644 --- a/src/main/java/org/goudham/me/api/entity/series/Series.java +++ b/src/main/java/org/goudham/me/api/entity/series/Series.java @@ -16,18 +16,21 @@ import java.util.Objects; *

    Represents a grouping of various {@link Waifu}'s. This can be an anime, mobile game, video game, manga, or LN

    * *

    Fields included are:

    - *
  • {@link String name}
  • - *
  • {@link String originalName}
  • - *
  • {@link String romajiName}
  • - *
  • {@link String slug}
  • - *
  • {@link String releaseDate}
  • - *
  • {@link String airingStart}
  • - *
  • {@link String airingEnd}
  • - *
  • {@link Integer episodeCount}
  • - *
  • {@link String image}
  • - *
  • {@link String url}
  • - *
  • {@link Studio}
  • - *
  • {@link Integer id}
  • + *
      + *
    • {@link String name}
    • + *
    • {@link String originalName}
    • + *
    • {@link String romajiName}
    • + *
    • {@link String slug}
    • + *
    • {@link String releaseDate}
    • + *
    • {@link String airingStart}
    • + *
    • {@link String airingEnd}
    • + *
    • {@link Integer episodeCount}
    • + *
    • {@link String image}
    • + *
    • {@link String url}
    • + *
    • {@link Studio}
    • + *
    • {@link Integer id}
    • + *
    + * */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ diff --git a/src/main/java/org/goudham/me/api/entity/user/TrueLove.java b/src/main/java/org/goudham/me/api/entity/user/TrueLove.java index e2ec077..3606c89 100644 --- a/src/main/java/org/goudham/me/api/entity/user/TrueLove.java +++ b/src/main/java/org/goudham/me/api/entity/user/TrueLove.java @@ -14,9 +14,13 @@ import java.util.Objects; * {@link TrueLove} *

    Represents a {@link User}'s True Love

    * - *
  • {@link String name}
  • - *
  • {@link String slug}
  • - *
  • {@link String series}
  • + *

    Fields included are:

    + *
      + *
    • {@link String name}
    • + *
    • {@link String slug}
    • + *
    • {@link String series}
    • + *
    + * */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ diff --git a/src/main/java/org/goudham/me/api/entity/user/User.java b/src/main/java/org/goudham/me/api/entity/user/User.java index 045e35c..71fad46 100644 --- a/src/main/java/org/goudham/me/api/entity/user/User.java +++ b/src/main/java/org/goudham/me/api/entity/user/User.java @@ -16,14 +16,17 @@ import java.util.Objects; *

    Standard user information and counts of waifus created, liked, trashed. Also contains true love

    * *

    Fields included are:

    - *
  • {@link Integer id}
  • - *
  • {@link String name}
  • - *
  • {@link String twitter}
  • - *
  • {@link String joined}
  • - *
  • {@link Integer waifusCreated}
  • - *
  • {@link Integer waifusLiked}
  • - *
  • {@link Integer waifusTrashed}
  • - *
  • {@link TrueLove trueLove}
  • + *
      + *
    • {@link Integer id}
    • + *
    • {@link String name}
    • + *
    • {@link String twitter}
    • + *
    • {@link String joined}
    • + *
    • {@link Integer waifusCreated}
    • + *
    • {@link Integer waifusLiked}
    • + *
    • {@link Integer waifusTrashed}
    • + *
    • {@link TrueLove trueLove}
    • + *
    + * */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ diff --git a/src/main/java/org/goudham/me/api/entity/user/UserList.java b/src/main/java/org/goudham/me/api/entity/user/UserList.java index e933e37..f003a92 100644 --- a/src/main/java/org/goudham/me/api/entity/user/UserList.java +++ b/src/main/java/org/goudham/me/api/entity/user/UserList.java @@ -14,10 +14,14 @@ import org.goudham.me.api.entity.waifu.Waifu; * {@link UserList} *

    Get an array of all user lists on their profile

    * - *
  • {@link Integer id}
  • - *
  • {@link String name}
  • - *
  • {@link String order}
  • - *
  • {@link List< Waifu > waifus}
  • + *

    Fields included are:

    + *
      + *
    • {@link Integer id}
    • + *
    • {@link String name}
    • + *
    • {@link String order}
    • + *
    • {@link List< Waifu > waifus}
    • + *
    + * */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ diff --git a/src/main/java/org/goudham/me/api/entity/waifu/Appearance.java b/src/main/java/org/goudham/me/api/entity/waifu/Appearance.java index 0a4d986..ca7032a 100644 --- a/src/main/java/org/goudham/me/api/entity/waifu/Appearance.java +++ b/src/main/java/org/goudham/me/api/entity/waifu/Appearance.java @@ -13,13 +13,16 @@ import javax.annotation.processing.Generated; *

    Contains basic series information for most endpoints

    * *

    Fields included are:

    - *
  • {@link String name}
  • - *
  • {@link String originalName}
  • - *
  • {@link String romajiName}
  • - *
  • {@link String slug}
  • - *
  • {@link String description}
  • - *
  • {@link String url}
  • - *
  • {@link Integer id}
  • + *
      + *
    • {@link String name}
    • + *
    • {@link String originalName}
    • + *
    • {@link String romajiName}
    • + *
    • {@link String slug}
    • + *
    • {@link String description}
    • + *
    • {@link String url}
    • + *
    • {@link Integer id}
    • + *
    + * */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ diff --git a/src/main/java/org/goudham/me/api/entity/waifu/FilteredWaifu.java b/src/main/java/org/goudham/me/api/entity/waifu/FilteredWaifu.java index 0aa2198..b110777 100644 --- a/src/main/java/org/goudham/me/api/entity/waifu/FilteredWaifu.java +++ b/src/main/java/org/goudham/me/api/entity/waifu/FilteredWaifu.java @@ -15,17 +15,20 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; *

    Contains Waifu data structure for endpoints other than the primary endpoint (/waifu/{slug})

    * *

    Fields included are:

    - *
  • {@link String slug}
  • - *
  • {@link String name}
  • - *
  • {@link String originalName}
  • - *
  • {@link String romajiName}
  • - *
  • {@link String displayPicture}
  • - *
  • {@link Integer likes}
  • - *
  • {@link Integer trash}
  • - *
  • {@link Integer episodeCount}
  • - *
  • {@link String url}
  • - *
  • {@link List appearances}
  • - *
  • {@link Double id}
  • + *
      + *
    • {@link String slug}
    • + *
    • {@link String name}
    • + *
    • {@link String originalName}
    • + *
    • {@link String romajiName}
    • + *
    • {@link String displayPicture}
    • + *
    • {@link Integer likes}
    • + *
    • {@link Integer trash}
    • + *
    • {@link Integer episodeCount}
    • + *
    • {@link String url}
    • + *
    • {@link List appearances}
    • + *
    • {@link Double id}
    • + *
    + * */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ diff --git a/src/main/java/org/goudham/me/api/entity/waifu/Waifu.java b/src/main/java/org/goudham/me/api/entity/waifu/Waifu.java index 6c537cd..4af0f73 100644 --- a/src/main/java/org/goudham/me/api/entity/waifu/Waifu.java +++ b/src/main/java/org/goudham/me/api/entity/waifu/Waifu.java @@ -20,34 +20,37 @@ import org.goudham.me.api.entity.series.Series; *

    Contains most common attributes for {@link Waifu}'s based on various source material

    * *

    Fields included are:

    - *
  • {@link Integer id}
  • - *
  • {@link String slug}
  • - *
  • {@link Integer creatorId}
  • - *
  • {@link String name}
  • - *
  • {@link String originalName}
  • - *
  • {@link String displayPicture}
  • - *
  • {@link String description}
  • - *
  • {@link Double weight}
  • - *
  • {@link Double height}
  • - *
  • {@link Double bust}
  • - *
  • {@link Double hip}
  • - *
  • {@link Double waist}
  • - *
  • {@link Waifu.BloodType bloodType}
  • - *
  • {@link String origin}
  • - *
  • {@link Integer age}
  • - *
  • {@link String birthdayMonth}
  • - *
  • {@link Integer birthdayDay}
  • - *
  • {@link Integer birthdayYear}
  • - *
  • {@link Integer likes}
  • - *
  • {@link Integer trash}
  • - *
  • {@link String url}
  • - *
  • {@link Boolean husbando}
  • - *
  • {@link Boolean nsfw}
  • - *
  • {@link Integer popularityRank}
  • - *
  • {@link Integer likeRank}
  • - *
  • {@link Integer trashRank}
  • - *
  • {@link List appearances}
  • - *
  • {@link Series series}
  • + *
      + *
    • {@link Integer id}
    • + *
    • {@link String slug}
    • + *
    • {@link Integer creatorId}
    • + *
    • {@link String name}
    • + *
    • {@link String originalName}
    • + *
    • {@link String displayPicture}
    • + *
    • {@link String description}
    • + *
    • {@link Double weight}
    • + *
    • {@link Double height}
    • + *
    • {@link Double bust}
    • + *
    • {@link Double hip}
    • + *
    • {@link Double waist}
    • + *
    • {@link Waifu.BloodType bloodType}
    • + *
    • {@link String origin}
    • + *
    • {@link Integer age}
    • + *
    • {@link String birthdayMonth}
    • + *
    • {@link Integer birthdayDay}
    • + *
    • {@link Integer birthdayYear}
    • + *
    • {@link Integer likes}
    • + *
    • {@link Integer trash}
    • + *
    • {@link String url}
    • + *
    • {@link Boolean husbando}
    • + *
    • {@link Boolean nsfw}
    • + *
    • {@link Integer popularityRank}
    • + *
    • {@link Integer likeRank}
    • + *
    • {@link Integer trashRank}
    • + *
    • {@link List appearances}
    • + *
    • {@link Series series}
    • + *
    + * */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ diff --git a/src/main/java/org/goudham/me/api/entity/waifu/WaifuImage.java b/src/main/java/org/goudham/me/api/entity/waifu/WaifuImage.java index 2182a45..06ef5d7 100644 --- a/src/main/java/org/goudham/me/api/entity/waifu/WaifuImage.java +++ b/src/main/java/org/goudham/me/api/entity/waifu/WaifuImage.java @@ -10,12 +10,15 @@ import java.util.Objects; /** * {@link WaifuImage} - *

    Contains a thumbnail & full res image link for an image in a given Waifu’s gallery

    + *

    Contains a thumbnail and full res image link for an image in a given Waifu’s gallery

    * *

    Fields included are:

    - *
  • {@link Integer id}
  • - *
  • {@link String thumbnail}
  • - *
  • {@link String path}
  • + *
      + *
    • {@link Integer id}
    • + *
    • {@link String thumbnail}
    • + *
    • {@link String path}
    • + *
    + * */ @JsonInclude(JsonInclude.Include.NON_NULL) @JsonPropertyOrder({ From 814f5532479ec4f1bc4471b036acb6e451299abc Mon Sep 17 00:00:00 2001 From: Hammy Date: Sat, 5 Jun 2021 03:24:31 +0100 Subject: [PATCH 5/7] Update pom.xml Stop using RELEASE to pull in dependencies for org.jetbrains --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7c96367..787d187 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ org.jetbrains annotations - RELEASE + 21.0.1 compile From 0c673a0186b15815e57284f45fd7d6a3b6c97b2d Mon Sep 17 00:00:00 2001 From: Hammy Date: Sat, 5 Jun 2021 03:26:14 +0100 Subject: [PATCH 6/7] Update pom.xml Enable document checks again for javadocs --- pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/pom.xml b/pom.xml index 787d187..9349c21 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,6 @@ UTF-8 11 11 - none From 3a682084653578bd96896aa0e68ef21d2ee2eeca Mon Sep 17 00:00:00 2001 From: Hammy Date: Sat, 5 Jun 2021 03:31:21 +0100 Subject: [PATCH 7/7] Update JavaDocs Make sure that we are not referencing generics within javadocs --- src/main/java/org/goudham/me/api/entity/user/UserList.java | 2 +- .../java/org/goudham/me/api/entity/waifu/FilteredWaifu.java | 2 +- src/main/java/org/goudham/me/api/entity/waifu/Waifu.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/goudham/me/api/entity/user/UserList.java b/src/main/java/org/goudham/me/api/entity/user/UserList.java index f003a92..a962aaf 100644 --- a/src/main/java/org/goudham/me/api/entity/user/UserList.java +++ b/src/main/java/org/goudham/me/api/entity/user/UserList.java @@ -19,7 +19,7 @@ import org.goudham.me.api.entity.waifu.Waifu; *
  • {@link Integer id}
  • *
  • {@link String name}
  • *
  • {@link String order}
  • - *
  • {@link List< Waifu > waifus}
  • + *
  • {@link List} of {@link Waifu}'s
  • * * */ diff --git a/src/main/java/org/goudham/me/api/entity/waifu/FilteredWaifu.java b/src/main/java/org/goudham/me/api/entity/waifu/FilteredWaifu.java index b110777..ae2a827 100644 --- a/src/main/java/org/goudham/me/api/entity/waifu/FilteredWaifu.java +++ b/src/main/java/org/goudham/me/api/entity/waifu/FilteredWaifu.java @@ -25,7 +25,7 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder; *
  • {@link Integer trash}
  • *
  • {@link Integer episodeCount}
  • *
  • {@link String url}
  • - *
  • {@link List appearances}
  • + *
  • {@link List} of {@link Appearance}'s
  • *
  • {@link Double id}
  • * * diff --git a/src/main/java/org/goudham/me/api/entity/waifu/Waifu.java b/src/main/java/org/goudham/me/api/entity/waifu/Waifu.java index 4af0f73..716fd07 100644 --- a/src/main/java/org/goudham/me/api/entity/waifu/Waifu.java +++ b/src/main/java/org/goudham/me/api/entity/waifu/Waifu.java @@ -47,7 +47,7 @@ import org.goudham.me.api.entity.series.Series; *
  • {@link Integer popularityRank}
  • *
  • {@link Integer likeRank}
  • *
  • {@link Integer trashRank}
  • - *
  • {@link List appearances}
  • + *
  • {@link List} of {@link Appearance}'s
  • *
  • {@link Series series}
  • * *