Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for file:// protocol in plugin URI #365 #531

Closed
wants to merge 10 commits into from
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
package io.jenkins.tools.pluginmanager.cli;

import edu.umd.cs.findbugs.annotations.CheckForNull;
import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
Expand Down Expand Up @@ -73,7 +72,7 @@ class CliOptions {
handler = BooleanOptionHandler.class)
private boolean showAvailableUpdates;

@Option(name = "--output", usage = "Output format for available updates", aliases = "-o")
@Option(name = "--output", usage = "Output format for available updates", aliases = "-o")
private OutputFormat outputFormat = OutputFormat.STDOUT;

@Option(name = "--view-security-warnings",
Expand Down Expand Up @@ -146,6 +145,8 @@ class CliOptions {
handler = MultiCredentialsOptionHandler.class)
private List<Credentials> credentials;



/**
* Creates a configuration class with configurations specified from the CLI and/or environment variables.
*
Expand Down Expand Up @@ -408,10 +409,10 @@ private URL getIncrementalsMirror() {
try {
jenkinsIncrementalsRepo = new URL(System.getenv("JENKINS_INCREMENTALS_REPO_MIRROR"));
} catch (MalformedURLException e) {
/* Spotbugs 4.7.0 warns when throwing a runtime exception,
* but the program cannot do anything with a malformed URL.
* Spotbugs warning is ignored.
*/
/* Spotbugs 4.7.0 warns when throwing a runtime exception,
* but the program cannot do anything with a malformed URL.
* Spotbugs warning is ignored.
*/
throw new RuntimeException(e);
}

Expand Down Expand Up @@ -490,6 +491,13 @@ public boolean isShowHelp() {
return showHelp;
}

/**
* Shows if the version was made by mukund
*/
public boolean isVersionMadeBy() {
return true;
}

/**
* Returns the boolean corresponding to if user wants dependencies of plugins with latest version specified to also
* be the latest version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public static void main(String[] args) throws IOException {
return;
}


Config cfg = options.setup();
try (PluginManager pm = new PluginManager(cfg)) {
if (options.isShowAvailableUpdates()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import java.util.Collections;
import java.util.List;
import java.util.Objects;

import io.jenkins.tools.pluginmanager.config.LogOutput;
import org.apache.commons.lang3.StringUtils;

public class Plugin {
Expand Down Expand Up @@ -34,6 +36,7 @@ public Plugin(String name, String version, String url, String groupId) {
}
this.version = new VersionNumber(version);
this.url = url;

this.dependencies = new ArrayList<>();
this.parent = this;
this.groupId = groupId;
Expand Down
Loading