Skip to content
Merged
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
Expand Up @@ -608,8 +608,9 @@ private UpdateSite.Data scanWAR(File war, Map<String, String> pluginGroupIds) th
top.put("core", new JSONObject().accumulate("name", "core").accumulate("version", m.group(1)).accumulate("url", "https://foobar"));
}

//TODO: should it also scan detached plugins info?
m = Pattern.compile("WEB-INF/(?:optional-)?plugins/([^/.]+)[.][hj]pi").matcher(name);
// We should also scan detached plugins to make sure we get the proper groupId for detached not using the
// default org.jenkins-ci one
m = Pattern.compile("WEB-INF/(?:(optional-|detached-))?plugins/([^/.]+)[.][hj]pi").matcher(name);
Copy link
Member

@v1v v1v Feb 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the - char could be moved as below:

Suggested change
m = Pattern.compile("WEB-INF/(?:(optional-|detached-))?plugins/([^/.]+)[.][hj]pi").matcher(name);
m = Pattern.compile("WEB-INF/(?:(optional|detached)-)?plugins/([^/.]+)[.][hj]pi").matcher(name);

Although, It's not a blocker from my PoV

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, is - character a special character or only when between []?

if (m.matches()) {
JSONObject plugin = new JSONObject().accumulate("url", "");
InputStream is = jf.getInputStream(entry);
Expand Down