mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-04-30 20:24:32 +02:00
removed nexus auth test code
Former-commit-id: 9b5f8cbceb5a6a273dfd7ba85bf16510dab3ddb5
This commit is contained in:
@@ -74,23 +74,9 @@ public class NexusSearch {
|
||||
&& Settings.getBoolean(Settings.KEYS.ANALYZER_NEXUS_PROXY)) {
|
||||
useProxy = true;
|
||||
LOGGER.fine("Using proxy");
|
||||
if (Settings.getString(Settings.KEYS.ANALYZER_NEXUS_USER) != null) {
|
||||
LOGGER.fine("Unable to use nexus authentication while using a proxy. Consider disabling the use of a proxy with Nexus.");
|
||||
}
|
||||
} else {
|
||||
useProxy = false;
|
||||
LOGGER.fine("Not using proxy");
|
||||
userName = Settings.getString(Settings.KEYS.ANALYZER_NEXUS_USER);
|
||||
String tmp = Settings.getString(Settings.KEYS.ANALYZER_NEXUS_PASSWORD);
|
||||
if (tmp != null) {
|
||||
password = tmp.toCharArray();
|
||||
} else {
|
||||
if (userName != null) {
|
||||
userName = null;
|
||||
LOGGER.fine("Nexus password is not set yet user name was configured. Disabling the use of authentication for Nexus.");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} catch (InvalidSettingException ise) {
|
||||
useProxy = false;
|
||||
@@ -120,12 +106,7 @@ public class NexusSearch {
|
||||
// 2) Otherwise, don't use the proxy (either the proxy isn't configured,
|
||||
// or proxy is specifically set to false
|
||||
HttpURLConnection conn;
|
||||
if (useProxy && userName == null) {
|
||||
conn = URLConnectionFactory.createHttpURLConnection(url, useProxy);
|
||||
} else {
|
||||
conn = URLConnectionFactory.createHttpURLConnection(url, userName, password);
|
||||
}
|
||||
|
||||
conn = URLConnectionFactory.createHttpURLConnection(url, useProxy);
|
||||
conn.setDoOutput(true);
|
||||
|
||||
// JSON would be more elegant, but there's not currently a dependency
|
||||
@@ -190,11 +171,7 @@ public class NexusSearch {
|
||||
HttpURLConnection conn;
|
||||
try {
|
||||
URL url = new URL(rootURL, "status");
|
||||
if (useProxy && userName == null) {
|
||||
conn = URLConnectionFactory.createHttpURLConnection(url, useProxy);
|
||||
} else {
|
||||
conn = URLConnectionFactory.createHttpURLConnection(url, userName, password);
|
||||
}
|
||||
conn = URLConnectionFactory.createHttpURLConnection(url, useProxy);
|
||||
conn.addRequestProperty("Accept", "application/xml");
|
||||
conn.connect();
|
||||
if (conn.getResponseCode() != 200) {
|
||||
|
||||
Reference in New Issue
Block a user