Skip to content

Commit

Permalink
#316: Add new default link replacements (#317)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaklakariada authored Jun 1, 2022
1 parent 61b09a2 commit 1dd9c53
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
3 changes: 0 additions & 3 deletions .project-keeper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,3 @@ sources:
relativePath: "../parent-pom/pom.xml"
version:
fromSource: project-keeper/pom.xml
linkReplacements:
- "https://www.mojohaus.org/flatten-maven-plugin/flatten-maven-plugin|https://www.mojohaus.org/flatten-maven-plugin/"
- "https://awhitford.github.com/lombok.maven/lombok-maven-plugin/|https://anthonywhitford.com/lombok.maven/lombok-maven-plugin/"
1 change: 1 addition & 0 deletions doc/changes/changes_2.4.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Code name: Bugfixes for Golang projects
## Bugfixes

* #279: Fixed getting license for Golang test dependencies
* #316: Added new builtin replacements to BrokenLinkReplacer
* #313: Fixed labelling of of dependency change type

## Dependency Updates
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
public class BrokenLinkReplacer {
private static final String JACOCO_HOMEPAGE = "https://www.eclemma.org/jacoco/index.html";
private static final Map<String, String> BUILTIN_REPLACEMENTS = Map.of(//
private static final Map<String, String> BUILTIN_REPLACEMENTS_1 = Map.of(//
"http://org.jacoco.agent", JACOCO_HOMEPAGE, //
"http://org.jacoco.core", JACOCO_HOMEPAGE, //
"http://jacoco-maven-plugin", JACOCO_HOMEPAGE, //
Expand All @@ -24,10 +24,26 @@ public class BrokenLinkReplacer {
"https://www.eclipse.org/jgit//org.eclipse.jgit", "https://www.eclipse.org/jgit/", //
"http://maven.apache.org/maven-project", "http://maven.apache.org/",
"https://sonatype.github.io/ossindex-maven/ossindex-maven-plugin/",
"https://sonatype.github.io/ossindex-maven/maven-plugin/", "https://github.com/javaee/jaxb-spec/jaxb-api",
"https://github.com/eclipse-ee4j/jaxb-api", "https://github.com/exasol/error-code-crawler-maven-plugint",
"https://sonatype.github.io/ossindex-maven/maven-plugin/", //
"https://github.com/javaee/jaxb-spec/jaxb-api", "https://github.com/eclipse-ee4j/jaxb-api",
"https://github.com/exasol/error-code-crawler-maven-plugint",
"https://github.com/exasol/error-code-crawler-maven-plugin");
private final Map<String, String> replacements = new HashMap<>(BUILTIN_REPLACEMENTS);

private static final Map<String, String> BUILTIN_REPLACEMENTS_2 = Map.of(
"https://www.mojohaus.org/flatten-maven-plugin/flatten-maven-plugin",
"https://www.mojohaus.org/flatten-maven-plugin/", //
"https://awhitford.github.com/lombok.maven/lombok-maven-plugin/",
"https://anthonywhitford.com/lombok.maven/lombok-maven-plugin/" //
);
private final Map<String, String> replacements = new HashMap<>(getBuiltinReplacements());

private static Map<String, String> getBuiltinReplacements() {
// The Map.of() function only supports 5 key-value pairs, so we have to split the definition.
final Map<String, String> builtinReplacements = new HashMap<>();
builtinReplacements.putAll(BUILTIN_REPLACEMENTS_1);
builtinReplacements.putAll(BUILTIN_REPLACEMENTS_2);
return builtinReplacements;
}

/**
* Create a new instance of {@link BrokenLinkReplacer}.
Expand Down

0 comments on commit 1dd9c53

Please sign in to comment.