Skip to content

Commit

Permalink
Merge pull request #12 from hrmohr/JENKINS-19910
Browse files Browse the repository at this point in the history
Added support for rebuilding
  • Loading branch information
marcrohlfs committed May 31, 2016
2 parents 71ee75c + 955f30b commit 7cda4a6
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 19 deletions.
8 changes: 7 additions & 1 deletion pom.xml
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>1.447</version>
<version>1.481</version>
</parent>

<prerequisites>
Expand Down Expand Up @@ -74,6 +74,12 @@
<artifactId>credentials</artifactId>
<version>1.9.1</version>
</dependency>
<dependency>
<groupId>com.sonyericsson.hudson.plugins.rebuild</groupId>
<artifactId>rebuild</artifactId>
<version>1.25</version>
<optional>true</optional>
</dependency>
</dependencies>

<build>
Expand Down
@@ -0,0 +1,50 @@
/*
* The MIT License
*
* Copyright (c) 2012, AKQA, Georgi "Gesh" Markov
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package eu.markov.jenkins.plugin.mvnmeta;

import com.sonyericsson.rebuild.RebuildParameterPage;
import com.sonyericsson.rebuild.RebuildParameterProvider;
import hudson.Extension;
import hudson.model.ParameterValue;

@Extension(optional = true)
public class MavenMetadataRebuildParameterProvider extends RebuildParameterProvider {

/**
* Provide a view for specified {@link ParameterValue}.
* <p/>
* Return null if cannot handle specified {@link ParameterValue}.
*
* @param value a value to be shown in a rebuild page.
* @return page for the parameter value. null for parameter values cannot be handled.
*/
@Override
public RebuildParameterPage getRebuildPage(ParameterValue value) {
if (!(value instanceof MavenMetadataParameterValue)) {
return null;
}
RebuildParameterPage page = new RebuildParameterPage(MavenMetadataParameterValue.class, "value.jelly");
return page;
}
}
Expand Up @@ -23,22 +23,25 @@
-->

<j:jelly xmlns:j="jelly:core" xmlns:f="/lib/form">
<f:entry title="${it.name}${it.VERSION_SUFFIX}" description="${it.description}">
<f:textbox name="version" value="${it.version}" readonly="true" />
</f:entry>
<f:entry title="${it.name}${it.GROUP_ID_SUFFIX}">
<f:textbox name="groupId" value="${it.groupId}" readonly="true" />
</f:entry>
<f:entry title="${it.name}${it.ARTIFACT_ID_SUFFIX}">
<f:textbox name="artifactId" value="${it.artifactId}" readonly="true" />
</f:entry>
<f:entry title="${it.name}${it.PACKAGING_SUFFIX}">
<f:textbox name="packaging" value="${it.packaging}" readonly="true" />
</f:entry>
<f:entry title="${it.name}${it.CLASSIFIER_SUFFIX}">
<f:textbox name="classifier" value="${it.classifier}" readonly="true" />
</f:entry>
<f:entry title="${it.name}${it.ARTIFACT_URL_SUFFIX}">
<a href="${it.artifactUrl}">${it.artifactUrl}</a>
</f:entry>
<f:section name="parameter">
<input type="hidden" name="name" value="${it.name}" />
<f:entry title="${it.name}${it.VERSION_SUFFIX}" description="${it.description}">
<f:textbox name="version" value="${it.version}" readonly="true" />
</f:entry>
<f:entry title="${it.name}${it.GROUP_ID_SUFFIX}">
<f:textbox name="groupId" value="${it.groupId}" readonly="true" />
</f:entry>
<f:entry title="${it.name}${it.ARTIFACT_ID_SUFFIX}">
<f:textbox name="artifactId" value="${it.artifactId}" readonly="true" />
</f:entry>
<f:entry title="${it.name}${it.PACKAGING_SUFFIX}">
<f:textbox name="packaging" value="${it.packaging}" readonly="true" />
</f:entry>
<f:entry title="${it.name}${it.CLASSIFIER_SUFFIX}">
<f:textbox name="classifier" value="${it.classifier}" readonly="true" />
</f:entry>
<f:entry title="${it.name}${it.ARTIFACT_URL_SUFFIX}">
<a href="${it.artifactUrl}">${it.artifactUrl}</a>
</f:entry>
</f:section>
</j:jelly>

0 comments on commit 7cda4a6

Please sign in to comment.