Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ repositories {
}

dependencies {
ext.jcloudsVersion = '2.5.0'
ext.jcloudsVersion = '2.7.0'
ext.autoValueVersion = '1.11.0'
ext.autoServiceVersion = '1.1.1'
ext.guiceVersion = '5.1.0'
ext.guiceVersion = '7.0.0'

implementation 'javax.xml.bind:jaxb-api:2.4.0-b180830.0359'
implementation 'javax.annotation:javax.annotation-api:1.3.2'
implementation 'jakarta.xml.bind:jakarta.xml.bind-api:4.0.0'
implementation 'jakarta.annotation:jakarta.annotation-api:2.1.1'
implementation ("org.apache.jclouds:jclouds-core:${jcloudsVersion}")
implementation ("com.google.inject:guice:${guiceVersion}")
implementation ("com.google.inject.extensions:guice-assistedinject:${guiceVersion}")
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group = io.github.cdancy
version = 1.0.2
version=2.0.0-jakarta

artifactoryURL = http://127.0.0.1:8080/artifactory
artifactoryUser = admin
Expand Down
9 changes: 4 additions & 5 deletions gradle/additional-artifacts.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ shadowJar {
relocate 'org.objectweb', "${newBasePackage}.shaded.org.objectweb"
relocate 'com.google', "${newBasePackage}.shaded.com.google"
relocate 'net.sf', "${newBasePackage}.shaded.net.sf"
relocate 'javax.inject', "${newBasePackage}.shaded.javax.inject"
relocate 'jakarta.inject', "${newBasePackage}.shaded.jakarta.inject"
relocate 'org.jclouds', "${newBasePackage}.shaded.org.jclouds"
relocate 'javax.inject', "${newBasePackage}.shaded.javax.inject"
relocate 'javax.annotation', "${newBasePackage}.shaded.javax.annotation"
relocate 'javax.ws.rs', "${newBasePackage}.shaded.javax.ws.rs"
relocate 'javax.xml.bind', "${newBasePackage}.shaded.javax.xml.bind"
relocate 'jakarta.annotation', "${newBasePackage}.shaded.jakarta.annotation"
relocate 'jakarta.ws.rs', "${newBasePackage}.shaded.jakarta.ws.rs"
relocate 'jakarta.xml.bind', "${newBasePackage}.shaded.jakarta.xml.bind"
}

task sourcesJar(type: Jar) {
Expand Down
10 changes: 1 addition & 9 deletions src/main/java/com/cdancy/jenkins/rest/JenkinsApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,9 @@

import java.io.Closeable;

import com.cdancy.jenkins.rest.features.*;

Copilot AI Dec 10, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wildcard import (com.cdancy.jenkins.rest.features.*) should be expanded to explicit imports to maintain consistency with the rest of the codebase and improve code clarity.

Suggested change
import com.cdancy.jenkins.rest.features.*;
import com.cdancy.jenkins.rest.features.CrumbIssuerApi;
import com.cdancy.jenkins.rest.features.JobsApi;
import com.cdancy.jenkins.rest.features.PluginManagerApi;
import com.cdancy.jenkins.rest.features.QueueApi;
import com.cdancy.jenkins.rest.features.StatisticsApi;
import com.cdancy.jenkins.rest.features.SystemApi;
import com.cdancy.jenkins.rest.features.ConfigurationAsCodeApi;
import com.cdancy.jenkins.rest.features.UserApi;

Copilot uses AI. Check for mistakes.
import org.jclouds.rest.annotations.Delegate;

import com.cdancy.jenkins.rest.features.ConfigurationAsCodeApi;
import com.cdancy.jenkins.rest.features.CrumbIssuerApi;
import com.cdancy.jenkins.rest.features.JobsApi;
import com.cdancy.jenkins.rest.features.PluginManagerApi;
import com.cdancy.jenkins.rest.features.QueueApi;
import com.cdancy.jenkins.rest.features.StatisticsApi;
import com.cdancy.jenkins.rest.features.SystemApi;
import com.cdancy.jenkins.rest.features.UserApi;

public interface JenkinsApi extends Closeable {

@Delegate
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/com/cdancy/jenkins/rest/JenkinsApiMetadata.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@
import java.net.URI;
import java.util.Properties;

import org.jclouds.apis.ApiMetadata;
import org.jclouds.rest.internal.BaseHttpApiMetadata;

import com.cdancy.jenkins.rest.config.JenkinsHttpApiModule;
import com.google.auto.service.AutoService;
import com.google.common.collect.ImmutableSet;
import com.google.inject.Module;
import org.jclouds.apis.ApiMetadata;
import org.jclouds.rest.internal.BaseHttpApiMetadata;

@AutoService(ApiMetadata.class)
public class JenkinsApiMetadata extends BaseHttpApiMetadata<JenkinsApi> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@

import static com.google.common.io.BaseEncoding.base64;

import com.cdancy.jenkins.rest.auth.AuthenticationType;
import com.cdancy.jenkins.rest.exception.UndetectableIdentityException;

import java.nio.charset.StandardCharsets;
import java.util.Objects;

import com.cdancy.jenkins.rest.auth.AuthenticationType;
import com.cdancy.jenkins.rest.exception.UndetectableIdentityException;
import org.jclouds.domain.Credentials;
import org.jclouds.javax.annotation.Nullable;

Expand Down
9 changes: 4 additions & 5 deletions src/main/java/com/cdancy/jenkins/rest/JenkinsClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,16 @@

package com.cdancy.jenkins.rest;

import com.cdancy.jenkins.rest.auth.AuthenticationType;
import com.cdancy.jenkins.rest.config.JenkinsAuthenticationModule;
import com.google.common.collect.Lists;
import com.google.inject.Module;

import java.io.Closeable;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import java.util.Properties;

import com.cdancy.jenkins.rest.auth.AuthenticationType;
import com.cdancy.jenkins.rest.config.JenkinsAuthenticationModule;
import com.google.common.collect.Lists;
import com.google.inject.Module;
import org.jclouds.ContextBuilder;
import org.jclouds.javax.annotation.Nullable;

Expand Down
26 changes: 4 additions & 22 deletions src/main/java/com/cdancy/jenkins/rest/JenkinsUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,36 +17,18 @@

package com.cdancy.jenkins.rest;

import static com.cdancy.jenkins.rest.JenkinsConstants.JENKINS_REST_PROPERTY_ID;
import static com.cdancy.jenkins.rest.JenkinsConstants.JENKINS_REST_VARIABLE_ID;
import static com.cdancy.jenkins.rest.JenkinsConstants.CREDENTIALS_ENVIRONMENT_VARIABLE;
import static com.cdancy.jenkins.rest.JenkinsConstants.CREDENTIALS_SYSTEM_PROPERTY;
import static com.cdancy.jenkins.rest.JenkinsConstants.DEFAULT_ENDPOINT;
import static com.cdancy.jenkins.rest.JenkinsConstants.ENDPOINT_ENVIRONMENT_VARIABLE;
import static com.cdancy.jenkins.rest.JenkinsConstants.ENDPOINT_SYSTEM_PROPERTY;
import static com.cdancy.jenkins.rest.JenkinsConstants.JCLOUDS_PROPERTY_ID;
import static com.cdancy.jenkins.rest.JenkinsConstants.JCLOUDS_VARIABLE_ID;
import static com.cdancy.jenkins.rest.JenkinsConstants.API_TOKEN_ENVIRONMENT_VARIABLE;
import static com.cdancy.jenkins.rest.JenkinsConstants.API_TOKEN_SYSTEM_PROPERTY;
import static com.cdancy.jenkins.rest.JenkinsConstants.*;

import com.google.common.base.Throwables;

import java.util.List;
import java.util.Map;
import java.lang.reflect.Field;
import java.util.*;

import com.google.common.base.Throwables;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonParser;
import java.lang.reflect.Field;
import java.util.Collection;
import java.util.Collections;
import java.util.Enumeration;
import java.util.Objects;
import java.util.Properties;

import org.jclouds.javax.annotation.Nullable;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@
import java.util.List;
import java.util.Map;

import javax.inject.Singleton;

import com.google.common.collect.Lists;
import jakarta.inject.Singleton;
import org.jclouds.http.HttpRequest;
import org.jclouds.http.HttpRequest.Builder;
import org.jclouds.rest.Binder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@

package com.cdancy.jenkins.rest.config;

import java.util.Objects;

import com.cdancy.jenkins.rest.JenkinsAuthentication;
import com.google.inject.AbstractModule;
import java.util.Objects;

/**
* Configure the provider for JenkinsAuthentication.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,15 @@

package com.cdancy.jenkins.rest.config;

import com.cdancy.jenkins.rest.JenkinsApi;
import com.cdancy.jenkins.rest.handlers.JenkinsErrorHandler;
import org.jclouds.http.HttpErrorHandler;
import org.jclouds.http.annotation.ClientError;
import org.jclouds.http.annotation.Redirection;
import org.jclouds.http.annotation.ServerError;
import org.jclouds.rest.ConfiguresHttpApi;
import org.jclouds.rest.config.HttpApiModule;

import com.cdancy.jenkins.rest.JenkinsApi;
import com.cdancy.jenkins.rest.handlers.JenkinsErrorHandler;

@ConfiguresHttpApi
public class JenkinsHttpApiModule extends HttpApiModule<JenkinsApi> {

Expand Down
15 changes: 7 additions & 8 deletions src/main/java/com/cdancy/jenkins/rest/domain/common/Error.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@

package com.cdancy.jenkins.rest.domain.common;

import com.google.auto.value.AutoValue;
import org.jclouds.javax.annotation.Nullable;
import org.jclouds.json.SerializedNames;

import com.google.auto.value.AutoValue;

@AutoValue
public abstract class Error {

Expand All @@ -32,17 +31,17 @@ public abstract class Error {
public abstract String message();

public abstract String exceptionName();

Error() {
}

@SerializedNames({ "context", "message", "exceptionName" })
public static Error create(final String context,
final String message,
public static Error create(final String context,
final String message,
final String exceptionName) {
return new AutoValue_Error(context,
message,

return new AutoValue_Error(context,
message,
exceptionName);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@

import java.util.List;

import org.jclouds.javax.annotation.Nullable;
import org.jclouds.json.SerializedNames;

import com.cdancy.jenkins.rest.JenkinsUtils;
import com.google.auto.value.AutoValue;
import org.jclouds.javax.annotation.Nullable;
import org.jclouds.json.SerializedNames;

/**
* Long response to be returned when an endpoint returns
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,27 @@

import java.util.List;

import org.jclouds.javax.annotation.Nullable;
import org.jclouds.json.SerializedNames;

import com.cdancy.jenkins.rest.JenkinsUtils;
import com.google.auto.value.AutoValue;
import org.jclouds.javax.annotation.Nullable;
import org.jclouds.json.SerializedNames;

/**
* Generic response to be returned when an endpoint returns
* Generic response to be returned when an endpoint returns
* no content (i.e. 204 response code).
*
* <p>When the response code is valid the `value` parameter will
*
* <p>When the response code is valid the `value` parameter will
* be set to true while a non-valid response has the `value` set to
* false along with any potential `error` objects returned from Jenkins.
*/
@AutoValue
public abstract class RequestStatus implements Value<Boolean>, ErrorsHolder {

@SerializedNames({ "value", "errors" })
public static RequestStatus create(@Nullable final Boolean value,
public static RequestStatus create(@Nullable final Boolean value,
final List<Error> errors) {
return new AutoValue_RequestStatus(value,

return new AutoValue_RequestStatus(value,
JenkinsUtils.nullToEmpty(errors));
}
}
7 changes: 3 additions & 4 deletions src/main/java/com/cdancy/jenkins/rest/domain/crumb/Crumb.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@

import java.util.List;

import org.jclouds.javax.annotation.Nullable;
import org.jclouds.json.SerializedNames;

import com.cdancy.jenkins.rest.JenkinsUtils;
import com.cdancy.jenkins.rest.domain.common.Error;
import com.cdancy.jenkins.rest.domain.common.ErrorsHolder;
import com.cdancy.jenkins.rest.JenkinsUtils;
import com.google.auto.value.AutoValue;
import org.jclouds.javax.annotation.Nullable;
import org.jclouds.json.SerializedNames;

@AutoValue
public abstract class Crumb implements ErrorsHolder {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/cdancy/jenkins/rest/domain/job/Action.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@

package com.cdancy.jenkins.rest.domain.job;

import java.util.List;

import com.google.auto.value.AutoValue;
import com.google.common.collect.ImmutableList;
import org.jclouds.javax.annotation.Nullable;
import org.jclouds.json.SerializedNames;

import java.util.List;

@AutoValue
public abstract class Action {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@

package com.cdancy.jenkins.rest.domain.job;

import com.google.auto.value.AutoValue;
import org.jclouds.javax.annotation.Nullable;
import org.jclouds.json.SerializedNames;

import com.google.auto.value.AutoValue;

@AutoValue
public abstract class Artifact {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@

import java.util.List;

import org.jclouds.javax.annotation.Nullable;
import org.jclouds.json.SerializedNames;

import com.google.auto.value.AutoValue;
import com.google.common.collect.ImmutableList;
import org.jclouds.javax.annotation.Nullable;
import org.jclouds.json.SerializedNames;

@AutoValue
public abstract class BuildInfo {
Expand Down Expand Up @@ -65,7 +64,7 @@ public abstract class BuildInfo {
public abstract String url();

public abstract List<ChangeSetList> changeSets();

@Nullable
public abstract String builtOn();

Expand All @@ -83,7 +82,7 @@ public static BuildInfo create(List<Artifact> artifacts, List<Action> actions, b
artifacts != null ? ImmutableList.copyOf(artifacts) : ImmutableList.<Artifact> of(),
actions != null ? ImmutableList.copyOf(actions) : ImmutableList.<Action> of(),
building, description, displayName, duration, estimatedDuration, fullDisplayName,
id, keepLog, number, queueId, result, timestamp, url,
id, keepLog, number, queueId, result, timestamp, url,
changeSets != null ? ImmutableList.copyOf(changeSets) : ImmutableList.<ChangeSetList> of(),
builtOn,
culprits != null ? ImmutableList.copyOf(culprits) : ImmutableList.<Culprit> of());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@

import java.util.List;

import org.jclouds.javax.annotation.Nullable;
import org.jclouds.json.SerializedNames;

import com.google.auto.value.AutoValue;
import com.google.common.collect.ImmutableList;
import org.jclouds.javax.annotation.Nullable;
import org.jclouds.json.SerializedNames;

@AutoValue
public abstract class ChangeSet {
Expand All @@ -48,7 +47,7 @@ public abstract class ChangeSet {
@SerializedNames({ "affectedPaths", "commitId", "timestamp", "author", "authorEmail", "comment" })
public static ChangeSet create(List<String> affectedPaths, String commitId, long timestamp, Culprit author, String authorEmail, String comment) {
return new AutoValue_ChangeSet(
affectedPaths != null ? ImmutableList.copyOf(affectedPaths) : ImmutableList.<String> of(),
affectedPaths != null ? ImmutableList.copyOf(affectedPaths) : ImmutableList.<String> of(),
commitId, timestamp, author, authorEmail, comment);
}
}
Loading
Loading