Skip to content

Commit

Permalink
Merge pull request #6 from Hillelmed/feature/updatetojava17
Browse files Browse the repository at this point in the history
Feature/updatetojava17
  • Loading branch information
Hillelmed authored Apr 6, 2024
2 parents 0ff24c4 + 3473201 commit 1b906f2
Show file tree
Hide file tree
Showing 86 changed files with 427 additions and 528 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ assertTrue(systemInfo.getUrl().equals("http://localhost:8080/"));
Can be found in maven like so:
```
<dependency>
<groupId>io.github.hmedioni</groupId>
<groupId>io.github.hillelmed</groupId>
<artifactId>jenkins-client-java</artifactId>
<version>X.Y.Z</version>
<classifier>sources|tests|javadoc|all</classifier> (Optional)
Expand All @@ -33,7 +33,7 @@ Can be found in maven like so:

## Documentation

* javadocs can be found via [github pages here](http://hmedioni.github.io/jenkins-client-java/docs/javadoc/)
* javadocs can be found via [github pages here](http://hillelmed.github.io/jenkins-client-java/docs/javadoc/)
* the [jenkins-rest wiki](https://github.com/cdancy/jenkins-rest/wiki)

## Property based setup
Expand Down Expand Up @@ -90,9 +90,9 @@ For more details, see

## Understanding Error objects

When something pops server-side `Jenkins` will hand us back a list of [JenkinsError](https://github.com/Hillelmed/jenkins-client-java/blob/main/src/main/java/io/github/hmedioni/jenkins/client/exception/JenkinsError.java) objects. we're throwing an exception at runtime we attach this List of `Error` objects
The throwing object is Jenkins [JenkinsAppException.java](https://github.com/Hillelmed/jenkins-client-java/blob/main/src/main/java/io/github/hmedioni/jenkins/client/exception/BitbucketAppException.java)
to most [domain](https://github.com/Hillelmed/jenkins-client-java/tree/main/src/main/java/io/github/hmedioni/jenkins/client/domain) objects. Thus, it is up to the user to check the handed back domain object to see if the attached List is empty, and if not, iterate over the `Error` objects to see if it's something
When something pops server-side `Jenkins` will hand us back a list of [JenkinsError](https://github.com/Hillelmed/jenkins-client-java/blob/main/src/main/java/io/github/hillelmed/jenkins/client/exception/JenkinsError.java) objects. we're throwing an exception at runtime we attach this List of `Error` objects
The throwing object is Jenkins [JenkinsAppException.java](https://github.com/Hillelmed/jenkins-client-java/blob/main/src/main/java/io/github/hillelmed/jenkins/client/exception/BitbucketAppException.java)
to most [domain](https://github.com/Hillelmed/jenkins-client-java/tree/main/src/main/java/io/github/hillelmed/jenkins/client/domain) objects. Thus, it is up to the user to check the handed back domain object to see if the attached List is empty, and if not, iterate over the `Error` objects to see if it's something
truly warranting an exception. List of `Error` objects itself will always be non-null but in most cases empty (unless something has failed).

An example on how one might proceed:
Expand Down
2 changes: 1 addition & 1 deletion RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### Version 2.0.0 (April 1, 2024)
### Version 1.0.0 start from beginning (April 1, 2024) With hillelmed
* Update to java 17 and change to use Http interface with webClient with Spring

### Version 1.0.2 (September 29, 2022)
Expand Down
48 changes: 42 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
plugins {
id 'java'
id 'jacoco'
// id 'maven-publish'
// id 'com.github.johnrengelman.shadow' version '7.1.1'
// id "io.github.gradle-nexus.publish-plugin" version "1.3.0"
id 'maven-publish'
id 'com.github.johnrengelman.shadow' version '7.1.1'
}

//apply from: "$rootDir/gradle/additional-artifacts.gradle"
//apply from: "$rootDir/gradle/dependencies.gradle"
//apply from: "$rootDir/gradle/publishing.gradle"
//apply from: "$rootDir/gradle/release.gradle"

repositories {
mavenCentral()
Expand Down Expand Up @@ -109,3 +105,43 @@ javadoc {
addStringOption('source', compatibilityVersion.toString().replaceAll(/.*\./, ""))
}
}

group = 'io.github.hillelmed'
version = '1.0.0'
description = 'Java client for working with Jenkins REST API'

publishing {
publications {
maven(MavenPublication) {
group = 'io.github.hillelmed'
version = '1.0.0'
description = 'Java client for working with Jenkins REST API'

from components.java
pom {
name = 'Jenkins rest client in java'
description = 'Java client for working with Jenkins REST API'
url = 'https://github.com/Hillelmed/jenkins-client-java'
packaging 'jar'
licenses {
license {
name = 'The MIT License (MIT)'
url = 'http://opensource.org/licenses/MIT'
}
}
developers {
developer {
id = 'HillelMed'
name = 'Hillel medioni'
email = 'hillel95med@gmail.com'
}
}
scm {
connection = 'scm:https://github.com/Hillelmed/jenkins-client-java.git'
developerConnection = 'scm:git://github.com/Hillelmed/jenkins-client-java.git'
url = 'https://github.com/Hillelmed/jenkins-client-java/'
}
}
}
}
}
20 changes: 10 additions & 10 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
group=io.github.hmedioni
version=2.0.0
group=io.github.hillelmed
version=1.0.0

myProjectLicense=MIT 2.0

artifactoryURL=http://127.0.0.1:8080/artifactory
artifactoryUser=admin
artifactoryPassword=password
Expand All @@ -12,11 +15,8 @@ systemProp.system.test.jenkins.password=admin
# Use it if you want to provide your own account with a pre-existing API Token,
# instead of letting the test generate its own API Token.
#testJenkinsUsernameApiToken = "admin:fixme"
githubUsername=fixme
githubPassword=fixme
signing.keyId=fixme
signing.password=fixme
signing.secretKeyRingFile=fixme
sonatypeUsername=fixme
sonatypePassword=fixme
sonatypeURL=https://s01.oss.sonatype.org

signing.keyId=YourKeyId
signing.password=YourPublicKeyPassword
signing.secretKeyRingFile=PathToYourKeyRingFile

35 changes: 0 additions & 35 deletions gradle/additional-artifacts.gradle

This file was deleted.

2 changes: 0 additions & 2 deletions gradle/dependencies.gradle

This file was deleted.

128 changes: 74 additions & 54 deletions gradle/publishing.gradle
Original file line number Diff line number Diff line change
@@ -1,54 +1,74 @@
apply plugin: 'maven-publish'
apply plugin: 'signing'

nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("$sonatypeURL/service/local/"))
snapshotRepositoryUrl.set(uri("$sonatypeURL/content/repositories/snapshots/"))
}
}
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact testsJar
artifact docsJar

pom.withXml {
def root = asNode()
root.appendNode('name', 'Jenkins Rest')
root.appendNode('description', 'Java client for working with Jenkins REST API.')
root.appendNode('url', 'https://github.com/cdancy/jenkins-rest')
root.appendNode('inceptionYear', '2016')

def scm = root.appendNode('scm')
scm.appendNode('url', 'https://github.com/cdancy/jenkins-rest')
scm.appendNode('connection', 'scm:https://cdancy@github.com/cdancy/jenkins-rest.git')
scm.appendNode('developerConnection', 'scm:git://github.com/cdancy/jenkins-rest.git')

def license = root.appendNode('licenses').appendNode('license')
license.appendNode('name', 'The Apache Software License, Version 2.0')
license.appendNode('url', 'http://www.apache.org/licenses/LICENSE-2.0.txt')
license.appendNode('distribution', 'repo')

def developers = root.appendNode('developers')
def cdancy = developers.appendNode('developer')
cdancy.appendNode('id', 'cdancy')
cdancy.appendNode('name', 'Christopher Dancy')
cdancy.appendNode('email', 'christoforever@gmail.com')
def martinda = developers.appendNode('developer')
martinda.appendNode('id', 'martinda')
martinda.appendNode('name', "Martin d'Anjou")
martinda.appendNode('email', 'martin.danjou14@gmail.com')
}
}
}
}

signing {
sign publishing.publications.mavenJava
}
//apply plugin: 'maven-upload'
//apply plugin: 'signing'
//
//group = 'io.github.hillelmed'
//version = '1.0.0'
//archivesBaseName = "jenkins-client-java"
//
//java {
// withJavadocJar()
// withSourcesJar()
//}
//uploadArchives {
// repositories {
// mavenDeployer {
//
// repository(url: "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") {
// authentication(userName: ossrhUsername, password: ossrhPassword)
// }
//
// snapshotRepository(url: "https://s01.oss.sonatype.org/content/repositories/snapshots/") {
// authentication(userName: ossrhUsername, password: ossrhPassword)
// }
//
// pom.project {
// name = 'Jenkins rest client in java'
// description = 'Java client for working with Jenkins REST API'
// url = 'https://github.com/Hillelmed/jenkins-client-java'
// packaging 'jar'
// licenses {
// license {
// name = 'The MIT License (MIT)'
// url = 'http://opensource.org/licenses/MIT'
// }
// }
// developers {
// developer {
// id = 'HillelMed'
// name = 'Hillel medioni'
// email = 'hillel95med@gmail.com'
// }
// }
// scm {
// connection = 'scm:https://github.com/Hillelmed/jenkins-client-java.git'
// developerConnection = 'scm:git://github.com/Hillelmed/jenkins-client-java.git'
// url = 'https://github.com/Hillelmed/jenkins-client-java/'
// }
// }
// }
// }
//}
//
//
//signing {
// sign configurations.archives
//}
//artifacts {
// archives javadocJar, sourcesJar
//}
//tasks.register('javadocJar', Jar) {
// classifier = 'javadoc'
// from javadoc
//}
//
//tasks.register('sourcesJar', Jar) {
// classifier = 'sources'
// from sourceSets.main.allSource
//}
//
//
//javadoc {
// if (JavaVersion.current().isJava9Compatible()) {
// options.addBooleanOption('html5', true)
// }
//}
61 changes: 0 additions & 61 deletions gradle/release.gradle

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.github.hmedioni.jenkins.client;
package io.github.hillelmed.jenkins.client;

import io.github.hmedioni.jenkins.client.features.*;
import io.github.hillelmed.jenkins.client.features.*;

import java.io.*;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package io.github.hmedioni.jenkins.client;
package io.github.hillelmed.jenkins.client;

import io.github.hmedioni.jenkins.client.config.*;
import io.github.hmedioni.jenkins.client.features.*;
import io.github.hmedioni.jenkins.client.filters.*;
import io.github.hmedioni.jenkins.client.handlers.*;
import io.github.hillelmed.jenkins.client.config.*;
import io.github.hillelmed.jenkins.client.features.*;
import io.github.hillelmed.jenkins.client.filters.*;
import io.github.hillelmed.jenkins.client.handlers.*;
import org.springframework.web.reactive.function.client.*;
import org.springframework.web.reactive.function.client.support.*;
import org.springframework.web.service.invoker.*;
Expand Down Expand Up @@ -45,11 +45,6 @@ private static HttpServiceProxyFactory buildHttpServiceProxyFactory(JenkinsPrope
.build();
}


private synchronized <T> T getSingleton(Class<T> klass, Object o) {
return klass.cast(singletons.computeIfAbsent(klass, aClass -> o));
}

private synchronized <T> T getSingleton(Class<T> klass) {
return klass.cast(singletons.computeIfAbsent(klass, httpServiceProxyFactory::createClient));
}
Expand Down
Loading

0 comments on commit 1b906f2

Please sign in to comment.