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

[JENKINS-56321] Scan detached plugins to get proper group id #116

Merged
merged 1 commit into from
Feb 28, 2019

Conversation

raul-arabaolaza
Copy link
Contributor

JENKINS-56321

Detached plugins are added with default group id, this makes jaxb to be added with the wrong group id. Given that detached are always embedded into the war it makes sense to also scan group ids for detached plugins as is done for embedded ones. As a result, any detached plugin with a group id different from org.jenkins-ci.plugins (like 'jaxb) is going to be properly added

Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

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

lgtm

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 []?

@jglick
Copy link
Member

jglick commented Jul 9, 2019

This change seems to have had the perhaps unexpected effect of making it so that if you just pass -war but not -includePlugins, PCT will now be run against detached plugins (which are not included as WEB-INF/plugins/*.hpi), which will likely fail since those versions are so old they can no longer be built with current dependency and tool versions.

@oleg-nenashev
Copy link
Member

@jglick please create a JIRA ticket for it.

We have already fixed some regressions in #140 , but not the one you mentioned (I do not have use-cases for runs without -includePlugins). One of the mitigations we apply is to always have an integration test for new changes.

@jglick
Copy link
Member

jglick commented Jul 9, 2019

I will see. If I stop using CWP as in jenkinsci/custom-war-packager#108 then I think I do not care about this anyway since I could just make the WAR contain exactly what I need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants