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

[2201.8.0-stage] Refactor maven repositories #41268

Closed
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
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[[repository.file-system]]
[[repository.maven]]
id = "repo-push-pull"
url = "file:REPO_PATH"
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,7 @@
public class SettingsBuilder {

public static final String NAME = "name";
public static final String ACCESSTOKEN = "accesstoken";
public static final String NEXUS = "nexus";
public static final String ARTIFACTORY = "artifactory";
public static final String FILE_SYSTEM = "file-system";
public static final String GITHUB = "github";
public static final String MAVEN = "maven";
private TomlDocument settingsToml;
private Settings settings;
private DiagnosticResult diagnostics;
Expand Down Expand Up @@ -142,16 +138,15 @@ private Settings parseAsSettings() {
for (Map.Entry<String, TopLevelNode> entry : repoEntries.entrySet()) {
String repoKey = entry.getKey();
TopLevelNode repoValue = entry.getValue();
if (!NEXUS.equals(repoKey) && !ARTIFACTORY.equals(repoKey) && !FILE_SYSTEM.equals(repoKey) &&
!GITHUB.equals(repoKey)) {
if (!MAVEN.equals(repoKey)) {
continue;
}
List<TomlTableNode> repositoryNodes = ((TomlTableArrayNode) (repoValue)).children();
for (TomlTableNode repositoryNode : repositoryNodes) {
url = getStringOrDefaultFromTomlTableNode(repositoryNode, URL, "");
id = getStringOrDefaultFromTomlTableNode(repositoryNode, ID, "");
repositoryUsername = getStringOrDefaultFromTomlTableNode(repositoryNode, USERNAME, "");
repositoryPassword = getStringOrDefaultFromTomlTableNode(repositoryNode, ACCESSTOKEN, "");
repositoryPassword = getStringOrDefaultFromTomlTableNode(repositoryNode, PASSWORD, "");
repositories.add(Repository.from(id, url, repositoryUsername, repositoryPassword));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"type": "object",
"additionalProperties": true,
"properties": {
"github": {
"maven": {
"type": "array",
"items": {
"type": "object",
Expand All @@ -51,70 +51,7 @@
"username": {
"type": "string"
},
"accesstoken": {
"type": "string"
}
}
}
},
"nexus": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
},
"username": {
"type": "string"
},
"accesstoken": {
"type": "string"
}
}
}
},
"artifactory": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
},
"username": {
"type": "string"
},
"accesstoken": {
"type": "string"
}
}
}
},
"file-system": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"type": "string"
},
"url": {
"type": "string"
},
"username": {
"type": "string"
},
"accesstoken": {
"password": {
"type": "string"
}
}
Expand Down
Loading