Hi Stephen,

thank your for this hint. Here is the complete example for the Jenkins file:

#!groovy
pipeline {
  agent any
  stages {
    stage('Build') {
       steps {
         script {
                properties([pipelineTriggers([snapshotDependencies()])])
         }
         withMaven(
            mavenLocalRepo: '.repository'
         ) {
                bat "clean deploy"
            }
        }
    }
}








Am Dienstag, 9. Januar 2018 14:54:00 UTC+1 schrieb Stephen Connolly:
>
> Snippet generator gives:
>
> [image: Inline images 1]
>
> So I'd guess you just add snapshotDependencies() to your triggers as you 
> are using declarative syntax.
>
> On 9 January 2018 at 06:54, 'Richard Hierlmeier' via Jenkins Users <
> jenkins...@googlegroups.com <javascript:>> wrote:
>
>>
>> Hi Stephen,
>>
>> do you have an example for me how to define such a trigger?
>>
>>
>> Thank you 
>>
>>    Richard
>>
>>
>>
>> Am Dienstag, 9. Januar 2018 08:16:06 UTC+1 schrieb Richard Hierlmeier:
>>>
>>>
>>> I tried to setup a bunch of maven jobs as "Bitbucket Team/Project". In 
>>> the section "Scan Organization Folder Triggers" I selected the option 
>>> "Build whenever a SNAPSHOT dependency is built".
>>> In the Bitbucket project I have two GIT repos. One for module A and one 
>>> for module B.
>>> Module B has a Maven snapshot dependency to module A.
>>> Bot repos have the following Jenkins file:
>>>
>>> pipeline {
>>>   agent {
>>>     node {
>>>         label 'maven'
>>>     }
>>>   }
>>>   triggers {
>>>       upstream(upstreamProjects: 'Nightly Build Trigger',
>>>                threshold: hudson.model.Result.SUCCESS)
>>>   }
>>>   stages {
>>>     stage('Build') {
>>>        steps {
>>>          withMaven(
>>>             mavenLocalRepo: '.repository'
>>>          ) {
>>>                 bat "mvn clean deploy"
>>>             }
>>>         }
>>>     }
>>>   }
>>> }
>>>
>>> However it seems that the "Build whenever a SNAPSHOT dependency is 
>>> built" option has no effect. 
>>> If module A is built the built for module B is not triggered.
>>> If in "View configuration" of the build job of a branch the option 
>>> "Build whenever a SNAPSHOT dependency is built" is not selected.
>>>
>>> Is this options siliently ingored by "Bitbucket Team/Project"?
>>>
>>> Environment:
>>>
>>> Jenkins 2.73.2
>>> Jenkins Maven Plugin 3.0.7
>>>
>>>
>>> Richard
>>>
>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Jenkins Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to jenkinsci-use...@googlegroups.com <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/32982e93-e480-4d8c-9e20-5c5f3b8d9eda%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/32982e93-e480-4d8c-9e20-5c5f3b8d9eda%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/9efce421-d691-46a1-a33c-abd05b8ca6ba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to