{"action":"created","issue":{"url":"https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/issues/65","repository_url":"https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin","labels_url":"https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/issues/65/labels{/name}","comments_url":"https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/issues/65/comments","events_url":"https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/issues/65/events","html_url":"https://github.com/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/issues/65","id":324381709,"number":65,"title":"Problem with workflow-aggregator plugin","user":{"login":"maconic","id":1842239,"avatar_url":"https://avatars0.githubusercontent.com/u/1842239?v=4","gravatar_id":"","url":"https://api.github.com/users/maconic","html_url":"https://github.com/maconic","followers_url":"https://api.github.com/users/maconic/followers","following_url":"https://api.github.com/users/maconic/following{/other_user}","gists_url":"https://api.github.com/users/maconic/gists{/gist_id}","starred_url":"https://api.github.com/users/maconic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maconic/subscriptions","organizations_url":"https://api.github.com/users/maconic/orgs","repos_url":"https://api.github.com/users/maconic/repos","events_url":"https://api.github.com/users/maconic/events{/privacy}","received_events_url":"https://api.github.com/users/maconic/received_events","type":"User","site_admin":false},"labels":[{"id":666379146,"url":"https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/labels/bug","name":"bug","color":"ee0701","default":true},{"id":937367644,"url":"https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/labels/dependency-management","name":"dependency-management","color":"f9d0c4","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-05-18T11:57:20Z","updated_at":"2018-05-18T15:18:13Z","closed_at":null,"author_association":"NONE","body":"Sadly somehow workflow-aggregator plugin can not be found, even if it is on the plugin dependencies list.\r\n\r\n```kotlin\r\npluginDependencies(Action {\r\n        dependency(\"org.jenkins-ci.plugins.workflow\", \"workflow-aggregator\", \"2.5\")\r\n        dependency(\"org.jenkins-ci.plugins\", \"job-dsl\", \"1.69\")\r\n        dependency(\"org.6wind.jenkins\", \"lockable-resources\", \"2.2\")\r\n        dependency(\"org.jenkinsci.plugins\", \"pipeline-model-api\", \"1.2.5\")\r\n        dependency(\"org.jenkinsci.plugins\", \"pipeline-model-declarative-agent\", \"1.1.1\")\r\n        dependency(\"org.jenkinsci.plugins\", \"pipeline-model-definition\", \"1.2.5\")\r\n        dependency(\"org.jenkinsci.plugins\", \"pipeline-model-extensions\", \"1.2.5\")\r\n    })\r\n```\r\n\r\nSpock Test:\r\n\r\n```groovy\r\n given:\r\n            FreeStyleProject freeStyleProject = rule.createFreeStyleProject('project')\r\n            def scripts = new ExecuteDslScripts()\r\nscripts.scriptText = '''\r\npipelineJob(\"testPipeline\") {}\r\n\"\"\".stripIndent())\r\nfreeStyleProject.getBuildersList().add(scripts)\r\n\r\n when:\r\n            QueueTaskFuture<WorkflowRun> futureRun = freeStyleProject.scheduleBuild2(0)\r\n then:\r\n            // JenkinsRule has different assertion capabilities\r\n            WorkflowRun run = rule.assertBuildStatusSuccess(futureRun)\r\n            rule.assertLogContains('''test'''.stripIndent(), run)\r\n\r\n```\r\n\r\nError:\r\n\r\nERROR: (script, line 2) plugin 'workflow-aggregator' needs to be installed\r\n"},"comment":{"url":"https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/issues/comments/390240824","html_url":"https://github.com/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/issues/65#issuecomment-390240824","issue_url":"https://api.github.com/repos/mkobit/jenkins-pipeline-shared-libraries-gradle-plugin/issues/65","id":390240824,"user":{"login":"maconic","id":1842239,"avatar_url":"https://avatars0.githubusercontent.com/u/1842239?v=4","gravatar_id":"","url":"https://api.github.com/users/maconic","html_url":"https://github.com/maconic","followers_url":"https://api.github.com/users/maconic/followers","following_url":"https://api.github.com/users/maconic/following{/other_user}","gists_url":"https://api.github.com/users/maconic/gists{/gist_id}","starred_url":"https://api.github.com/users/maconic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maconic/subscriptions","organizations_url":"https://api.github.com/users/maconic/orgs","repos_url":"https://api.github.com/users/maconic/repos","events_url":"https://api.github.com/users/maconic/events{/privacy}","received_events_url":"https://api.github.com/users/maconic/received_events","type":"User","site_admin":false},"created_at":"2018-05-18T15:18:13Z","updated_at":"2018-05-18T15:18:13Z","author_association":"NONE","body":"An even simpler version with Spock would be:\r\n\r\n\r\n```groovy\r\n    def \"should create pipelineJob\"() {\r\n        given:\r\n            WorkflowJob workflowJob = rule.createProject(WorkflowJob, 'project1')\r\n            FreeStyleProject freeStyleProject = rule.createFreeStyleProject('project')\r\n\r\n        new DslScriptLoader(new JenkinsJobManagement(System.out, [:], new File('.'))).runScript('''\r\n               pipelineJob('myJob') {\r\n         \r\n        }\r\n    '''.stripIndent())\r\n        \r\n        when:\r\n            QueueTaskFuture<FreeStyleBuild> futureRun = freeStyleProject.scheduleBuild2(0)\r\n        then:\r\n            def run = rule.assertBuildStatusSuccess(futureRun)\r\n            rule.assertLogContains('''test'''.stripIndent(), run)\r\n    }\r\n```"}}
{"actor":{"display_login":"maconic"}}