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-64357 Fix plugin on Jenkins >2.263 #126

Merged
merged 3 commits into from
Jan 4, 2021
Merged
Show file tree
Hide file tree
Changes from 2 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
46 changes: 32 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>3.51</version>
<version>4.14</version>
</parent>

<artifactId>vsphere-cloud</artifactId>
Expand All @@ -18,7 +18,7 @@
<licenses>
<license>
<name>Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
<comments>A business-friendly OSS license</comments>
</license>
Expand Down Expand Up @@ -61,27 +61,50 @@
<revision>2.25</revision>
<changelist>-SNAPSHOT</changelist>
<java.level>8</java.level>
<jenkins.version>2.60.3</jenkins.version>
<jenkins.version>2.235.5</jenkins.version>
Copy link
Member

Choose a reason for hiding this comment

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

Same issue as PR 125

<spotbugs.skip>true</spotbugs.skip>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.jenkins.tools.bom</groupId>
<artifactId>bom-2.235.x</artifactId>
<version>19</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>credentials</artifactId>
<version>2.1.2</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>cloudbees-folder</artifactId>
<version>5.2.2</version>
</dependency>

<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>command-launcher</artifactId>
</dependency>
<dependency>
<groupId>com.toastcoders</groupId>
<artifactId>yavijava</artifactId>
<version>6.0.05</version>
<exclusions>
<exclusion>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</exclusion>
<!-- https://github.com/yavijava/yavijava/issues/272 and https://github.com/yavijava/yavijava/issues/234 -->
<exclusion>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
Expand All @@ -91,24 +114,19 @@
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>ssh-slaves</artifactId>
<version>1.15</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins.workflow</groupId>
<artifactId>workflow-basic-steps</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>io.jenkins</groupId>
<artifactId>configuration-as-code</artifactId>
<version>1.32</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.jenkins</groupId>
<artifactId>configuration-as-code</artifactId>
<version>1.32</version>
<classifier>tests</classifier>
<groupId>io.jenkins.configuration-as-code</groupId>
<artifactId>test-harness</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
16 changes: 16 additions & 0 deletions src/main/resources/lib/vsphere/blockWrapper.jelly
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:d="jelly:define">
<!-- TODO remove and switch to div after baseline is 2.264 or newer -->
<j:choose>
<j:when test="${divBasedFormLayout}">
<div>
<d:invokeBody/>
</div>
</j:when>
<j:otherwise>
<table style="width:100%">
<d:invokeBody/>
</table>
</j:otherwise>
</j:choose>
</j:jelly>
pjdarton marked this conversation as resolved.
Show resolved Hide resolved
Empty file.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:f="/lib/form">
<table width="100%">
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:v="/lib/vsphere">
<v:blockWrapper>
<st:include page="config.jelly" class="${descriptor.clazz}"/>
</table>
</v:blockWrapper>
</j:jelly>
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,7 @@
<j:set var="descriptor" value="${d}"/>
<j:set var="instance"
value="${it.delegateLauncher.descriptor==d ? it.delegateLauncher : null}"/>
<tr>
<td>
<input type="hidden" name="stapler-class" value="${d.clazz.name}"/>
</td>
</tr>
<f:invisibleEntry><input type="hidden" name="stapler-class" value="${d.clazz.name}"/></f:invisibleEntry>
<st:include from="${d}" page="${d.configPage}" optional="true"/>
</f:dropdownListBlock>
</j:forEach>
Expand All @@ -86,11 +82,7 @@
<j:set var="descriptor" value="${d}"/>
<j:set var="instance"
value="${it.retentionStrategy.descriptor==d ? it.retentionStrategy : null}"/>
<tr>
<td>
<input type="hidden" name="stapler-class" value="${d.clazz.name}"/>
</td>
</tr>
<f:invisibleEntry><input type="hidden" name="stapler-class" value="${d.clazz.name}"/></f:invisibleEntry>
<st:include from="${d}" page="${d.configPage}" optional="true"/>
</f:dropdownListBlock>
</j:if>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
<table width="100%">
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:f="/lib/form" xmlns:v="/lib/vsphere">
<v:blockWrapper>
<f:entry title="${%Clone Name Prefix}" field="cloneNamePrefix">
<f:textbox/>
</f:entry>
Expand Down Expand Up @@ -133,5 +133,5 @@
</div>
</f:entry>

</table>
</v:blockWrapper>
</j:jelly>
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form" xmlns:c="/lib/credentials">
<table width="100%">
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form" xmlns:v="/lib/vsphere">
<v:blockWrapper>
<f:entry title="${%Property Name}" field="name">
<f:textbox/>
</f:entry>

<f:entry title="${%Property Value}" field="value">
<f:textbox/>
</f:entry>
</table>
</v:blockWrapper>
</j:jelly>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ limitations under the License.
-->
<?jelly escape-by-default='true'?>

<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form">
<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form" xmlns:v="/lib/vsphere">
<f:entry title="${%Action to Perform}" field="deviceAction">
<f:enum>
${it.getLabel()}
Expand All @@ -31,18 +31,18 @@ limitations under the License.
</f:entry>

<f:block>
<table>
<v:blockWrapper>
<f:optionalBlock name="standardSwitch" title="Configure VMWare Standard Switch"
inline="true" checked="${instance.standardSwitch}">
<f:entry title="${%Network Port Group}" field="portGroup">
<f:textbox />
</f:entry>
</f:optionalBlock>
</table>
</v:blockWrapper>
</f:block>

<f:block>
<table>
<v:blockWrapper>
<f:optionalBlock name="distributedSwitch" title="Configure VMWare Distributed Switch"
inline="true" checked="${instance.distributedSwitch}">
<f:entry title="${%Distributed Port Group}" field="distributedPortGroup">
Expand All @@ -52,6 +52,6 @@ limitations under the License.
<f:textbox />
</f:entry>
</f:optionalBlock>
</table>
</v:blockWrapper>
</f:block>
</j:jelly>
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,7 @@
<j:set var="descriptor" value="${d}"/>
<j:set var="instance"
value="${it.delegateLauncher.descriptor==d ? it.delegateLauncher : null}"/>
<tr>
<td>
<input type="hidden" name="stapler-class" value="${d.clazz.name}"/>
</td>
</tr>
<f:invisibleEntry><input type="hidden" name="stapler-class" value="${d.clazz.name}"/></f:invisibleEntry>
<st:include from="${d}" page="${d.configPage}" optional="true"/>
</f:dropdownListBlock>
</j:forEach>
Expand All @@ -86,11 +82,7 @@
<j:set var="descriptor" value="${d}"/>
<j:set var="instance"
value="${it.retentionStrategy.descriptor==d ? it.retentionStrategy : null}"/>
<tr>
<td>
<input type="hidden" name="stapler-class" value="${d.clazz.name}"/>
</td>
</tr>
<f:invisibleEntry><input type="hidden" name="stapler-class" value="${d.clazz.name}"/></f:invisibleEntry>
<st:include from="${d}" page="${d.configPage}" optional="true"/>
</f:dropdownListBlock>
</j:if>
Expand Down