diff --git a/Jenkinsfile b/Jenkinsfile index f3a8538..94692d0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -37,12 +37,17 @@ pipeline { filesByGlob = findFiles(glob: "target/*.${pom.packaging}"); echo "${filesByGlob[0].name} ${filesByGlob[0].path} ${filesByGlob[0].directory} ${filesByGlob[0].length} ${filesByGlob[0].lastModified}" + echo "${filesByGlob[1].name} ${filesByGlob[1].path} ${filesByGlob[1].directory} ${filesByGlob[1].length} ${filesByGlob[1].lastModified}" + echo "${filesByGlob[2].name} ${filesByGlob[2].path} ${filesByGlob[2].directory} ${filesByGlob[2].length} ${filesByGlob[2].lastModified}" - artifactPath = filesByGlob[0].path; - artifactExists = fileExists artifactPath; + javadocsArtifact = filesByGlob[0].path; + jarWithSourcesArtifact = filesByGlob[1].path; + jarArtifact = filesByGlob[2].path; - if (artifactExists) { - echo "*** File: ${artifactPath}, group: ${pom.groupId}, packaging: ${pom.packaging}, version ${pom.version}"; + if (fileExists(javadocsArtifact) && fileExists(jarWithSourcesArtifact) && fileExists(jarArtifact)) { + echo "*** File: ${javadocsArtifact}, group: ${pom.groupId}, packaging: ${pom.packaging}, version ${pom.version}"; + echo "*** File: ${jarWithSourcesArtifact}, group: ${pom.groupId}, packaging: ${pom.packaging}, version ${pom.version}"; + echo "*** File: ${jarArtifact}, group: ${pom.groupId}, packaging: ${pom.packaging}, version ${pom.version}"; nexusArtifactUploader( nexusVersion: NEXUS_VERSION, @@ -53,19 +58,14 @@ pipeline { 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"] + [artifactId: pom.artifactId, classifier: 'core', file: jarArtifact, type: pom.packaging], + [artifactId: pom.artifactId, classifier: 'javadocs', file: javadocsArtifact, type: pom.packaging], + [artifactId: pom.artifactId, classifier: 'sources', file: jarWithSourcesArtifact, type: pom.packaging], + [artifactId: pom.artifactId, classifier: '', file: "pom.xml", type: "pom"] ] ) } else { - error "*** File: ${artifactPath}, could not be found"; + error "*** Files could not be found"; } } } diff --git a/src/main/java/org/goudham/me/MyWaifuClient.java b/src/main/java/org/goudham/me/MyWaifuClient.java index 2dae6d8..bc174e3 100644 --- a/src/main/java/org/goudham/me/MyWaifuClient.java +++ b/src/main/java/org/goudham/me/MyWaifuClient.java @@ -1,6 +1,5 @@ package org.goudham.me; -import org.goudham.me.api.MyWaifuWrapper; import org.jetbrains.annotations.NotNull; import javax.net.ssl.SSLParameters; @@ -27,7 +26,7 @@ public class MyWaifuClient { *
See MyWaifuList for obtaining an API Key
* @param apiKey API Key to authorise API request */ - MyWaifuClient(@NotNull String apiKey) { + public MyWaifuClient(@NotNull String apiKey) { myWaifuWrapper = new MyWaifuWrapper(apiKey); } diff --git a/src/main/java/org/goudham/me/api/MyWaifuWrapper.java b/src/main/java/org/goudham/me/MyWaifuWrapper.java similarity index 74% rename from src/main/java/org/goudham/me/api/MyWaifuWrapper.java rename to src/main/java/org/goudham/me/MyWaifuWrapper.java index 58b8494..f116755 100644 --- a/src/main/java/org/goudham/me/api/MyWaifuWrapper.java +++ b/src/main/java/org/goudham/me/MyWaifuWrapper.java @@ -1,11 +1,9 @@ -package org.goudham.me.api; - -import org.goudham.me.MyWaifuClient; +package org.goudham.me; /** * Returns API information to {@link MyWaifuClient} */ -public class MyWaifuWrapper { +class MyWaifuWrapper { private final String version = "1.0"; private final String host = "https://mywaifulist.moe/api/v1/"; private final String apiKey; @@ -14,7 +12,7 @@ public class MyWaifuWrapper { * Instantiates an instance of {@link MyWaifuWrapper} to retrieve API Information * @param apiKey API Key to authorise API request */ - public MyWaifuWrapper(String apiKey) { + MyWaifuWrapper(String apiKey) { this.apiKey = apiKey; } }