Retrieve real plugin jar instead of static resource jar Some plugins, most notably GWT UI plugins, have intermediate artifacts that are called <plugin-name>-static.jar. Usually those artifacts are retrieved on the first position and artifact searching algorithm hasn't filtered them out. This results in annoying troubleshooting sessions because gerrit listing those plugins as installed, but given that those jars are just GWT resources nothing is actually working. The following plugins were affected: * reviewers-static.jar * review-strategy-static.jar * menuextender-static.jar Change-Id: Ic8d597be18f2bbfdd42c2528456ea0188fcba76d
diff --git a/src/main/java/com/googlesource/gerrit/plugins/manager/repository/JenkinsCiPluginsRepository.java b/src/main/java/com/googlesource/gerrit/plugins/manager/repository/JenkinsCiPluginsRepository.java index 6eb29a3..31f77e7 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/manager/repository/JenkinsCiPluginsRepository.java +++ b/src/main/java/com/googlesource/gerrit/plugins/manager/repository/JenkinsCiPluginsRepository.java
@@ -231,7 +231,8 @@ private Optional<SmartJson> findArtifact(JsonArray artifacts, String string) { for (int i = 0; i < artifacts.size(); i++) { SmartJson artifact = SmartJson.of(artifacts.get(i)); - if (artifact.getString("relativePath").endsWith(string)) { + String path = artifact.getString("relativePath"); + if (path.endsWith(string) && !path.endsWith("-static" + string)) { return Optional.of(artifact); } }