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-69044] Adapt to executable WAR changes in JenkinsRule #461

Merged
merged 1 commit into from
Jul 20, 2022

Conversation

basil
Copy link
Member

@basil basil commented Jul 20, 2022

See JENKINS-69044. WarExploder contains two code paths that do the same thing: a standard code path for Maven, and a fallback code path for IntelliJ. The standard code path for Maven hunts down the WAR file by looking for winstone.jar and a class in the executable package. Prior to jenkinsci/jenkins#6706 this was working as intended with winstone.jar in the root of the WAR file and the class in the executable package being the placeholder executable.Executable, but jenkinsci/jenkins#6706 moved winstone.jar into the executable package and got rid of the placeholder class executable.Executable in favor of the real Main class (previously in the unnamed package but moved to the executable package in jenkinsci/jenkins#6706). This broke the primary Maven code path, but this went unnoticed because we went into the secondary IntelliJ code path. However the secondary IntelliJ code path does not seem to work for Gradle plugins as reported in JENKINS-69044.

This PR corrects the problem by getting adapting the primary Maven code path to work with the changes from jenkinsci/jenkins#6706: looking for winstone.jar in the executable package and looking for the real executable.Main instead of the placeholder executable.Executable if we are running with jenkinsci/jenkins#6706. The old code is left for compatibility but separated into an if statement that will be easy to delete later on when we eventually drop support.

To test this, I stepped through four scenarios in the debugger:

  • Maven, 2.357: Verified that we went into the primary Maven code path before this change and continued to do so after this change.
  • Maven, 2.358: Verified that before this change we erroneously went into the secondary IntelliJ code path, but after this change went into the primary Maven code path as expected.
  • IntelliJ, 2.357: Verified that we went into the secondary IntelliJ code path before and after this change.
  • IntelliJ, 2.358: Verified that we went into the secondary IntelliJ code path before and after this change.

@basil basil added the bug label Jul 20, 2022
@basil basil merged commit 8138d80 into jenkinsci:master Jul 20, 2022
@basil basil deleted the JENKINS-69044 branch July 20, 2022 06:13
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.

None yet

2 participants