Skip to content

Commit

Permalink
Use emtpy user-agent string for javadoc requests
Browse files Browse the repository at this point in the history
fixes #14
  • Loading branch information
larsgrefer committed Oct 2, 2017
1 parent 71f1a77 commit fd3fbb9
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ public void configureJavadocLinks() {
getLogger().warn("Unknown java version {}", javaVersion);
}

boolean usedJavadocIo = false;

for (ResolvedArtifact resolvedArtifact : getConfiguration().getResolvedConfiguration().getResolvedArtifacts()) {
ComponentIdentifier componentIdentifier = resolvedArtifact.getId().getComponentIdentifier();

Expand All @@ -69,9 +71,14 @@ public void configureJavadocLinks() {
getLogger().info("Using javadoc.io link for '{}:{}:{}'", group, artifact, version);
String javadocIoLink = String.format("https://static.javadoc.io/%s/%s/%s/", group, artifact, version);
addLink(javadocIoLink);
usedJavadocIo = true;
}
}
}

if(usedJavadocIo) {
javadoc.getOptions().jFlags("-Dhttp.agent=" + System.currentTimeMillis());
}
}

private String findWellKnownLink(String group, String artifact, String version) {
Expand Down

0 comments on commit fd3fbb9

Please sign in to comment.