Question: In the following pipeline, I am trying to check out only develop branch to build the given project. How do I make sure that the pipeline only run develop, master and release branches?
Should I add separate stages for master branch and another for release branch. Instead I am trying to let this pipeline build only when there are changes in develop or master or release branches and ignore building for any other branches.

In Jenkins > Freestyle project > Source code management > Git > User can enter specific branches in Branch specifier. How can I implement similar one using pipeline?

```
pipeline {
agent any
tools {
    maven "${mvnHome}"
    jdk  'jdk8'
}
stages {
stage('Checkout project') {
    steps {
        git branch: 'develop',
            credentialsId: 'someid',
            url: 'https://project.git'
    }
}

    stage('build') {
        steps {
            sh '''
             mvn clean deploy
            '''
            }
        }
    }
}

```

Answer: 
In the service you have `person` as a behavior subject. You'd update it there not in your component.

component

```
this.incomeService.updatePerson('something');

```

service

```
constructor() {
    this.person.subscribe(person => {
        console.log(person);
    });
}

updatePerson(arg:string){
    console.log('is this happening?', arg);
    this.person.next(arg);
}

```
The problem was in a function that was generating an error and that is executed before calling `next`. Unfortunately I missed it because errors in my Google Chrome console were hidden.

So as a reminder for anyone else having a similar problem; check that your methods are running error free before panicking.