Skip to content
Permalink
Browse files
[JENKINS-50777] Export the SCMSource(s) from a MultiBranchProject.
  • Loading branch information
jglick committed Apr 20, 2018
1 parent e53a2a9 commit 7f6accc3a946f468da2919cfcf3435520c537ad1
Showing with 7 additions and 1 deletion.
  1. +1 −1 pom.xml
  2. +4 −0 src/main/java/jenkins/branch/BranchSource.java
  3. +2 −0 src/main/java/jenkins/branch/MultiBranchProject.java
@@ -66,7 +66,7 @@

<properties>
<jenkins.version>1.642.3</jenkins.version>
<scm-api.version>2.2.6</scm-api.version>
<scm-api.version>2.2.7-20180420.001519-1</scm-api.version> <!-- TODO https://github.com/jenkinsci/scm-api-plugin/pull/53 -->
<git-plugin.version>3.3.0</git-plugin.version>
</properties>

@@ -36,13 +36,16 @@

import java.util.List;
import org.kohsuke.stapler.DataBoundSetter;
import org.kohsuke.stapler.export.Exported;
import org.kohsuke.stapler.export.ExportedBean;

/**
* A source of branches, which consists of a source and a strategy for creating properties of the branches from this
* source.
*
* @author Stephen Connolly
*/
@ExportedBean
public class BranchSource extends AbstractDescribableImpl<BranchSource> {
/**
* The source.
@@ -87,6 +90,7 @@ private Object readResolve() {
*
* @return the source.
*/
@Exported
@NonNull
public SCMSource getSource() {
return source;
@@ -114,6 +114,7 @@
import org.kohsuke.accmod.restrictions.NoExternalUse;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.export.Exported;

/**
* Abstract base class for multiple-branch based projects.
@@ -365,6 +366,7 @@ public synchronized void setProjectFactory(BranchProjectFactory<P, R> projectFac
*
* @return the sources of branches.
*/
@Exported
@NonNull
public List<BranchSource> getSources() {
if (sources != null) {

0 comments on commit 7f6accc

Please sign in to comment.