[JENKINS-69044] Adapt to executable WAR changes in JenkinsRule
#461
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 forwinstone.jar
and a class in theexecutable
package. Prior to jenkinsci/jenkins#6706 this was working as intended withwinstone.jar
in the root of the WAR file and the class in theexecutable
package being the placeholderexecutable.Executable
, but jenkinsci/jenkins#6706 movedwinstone.jar
into theexecutable
package and got rid of the placeholder classexecutable.Executable
in favor of the realMain
class (previously in the unnamed package but moved to theexecutable
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 theexecutable
package and looking for the realexecutable.Main
instead of the placeholderexecutable.Executable
if we are running with jenkinsci/jenkins#6706. The old code is left for compatibility but separated into anif
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: