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

Fix mvn compile in multimodule projects #235

Merged

Conversation

Vlatombe
Copy link
Member

When running mvn compile on a multimodule project containing multiple jenkins plugins depending on each other, build is failing with Unable to retrieve manifest.

This is because the current validation requires that a manifest is available and expects a packaged file (required mvn package at least).
This is skipping the validation in this particular case, issuing a warning.

  • Make sure you are opening from a topic/feature/bugfix branch (right side) and not your main branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or Jira
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Ensure you have provided tests - that demonstrates feature works or fixes the issue

@batmat batmat requested review from jglick, amuniz, jtnord and olamy October 5, 2021 09:08
} else {
getLog().warn("Skipping jenkins-core validation for " + artifact + " since we rely on sources and don't have a manifest. Use 'package' goal to get validation");
// Assume the version is the same
return new VersionNumber(findJenkinsVersion());
Copy link
Member

Choose a reason for hiding this comment

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

IIRC this could be missing the core version check, as it is not really returning the dependency version but the current project core version. IMO, this should throw an exception pointing the user to run mvn package instead of mvn compile (or any goal before package in the maven lifecycle).

Proper validation runs on mvn deploy so releases are safe, but still... getting mvn test to not catch a Jenkins core version mismatch does not sound good.

Copy link
Member Author

Choose a reason for hiding this comment

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

mvn test checks it through InjectedTest, see #191

src/it/compile-multimodule-it/pom.xml Outdated Show resolved Hide resolved
@jglick jglick added the bug label Oct 5, 2021
@jglick jglick merged commit e4fdf1d into jenkinsci:master Oct 5, 2021
@Vlatombe Vlatombe deleted the fix-validate-hpi-for-compile-phase branch October 5, 2021 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants