{"action":"created","issue":{"url":"https://api.github.com/repos/spring-projects/spring-boot/issues/3931","labels_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/3931/labels{/name}","comments_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/3931/comments","events_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/3931/events","html_url":"https://github.com/spring-projects/spring-boot/issues/3931","id":105576799,"number":3931,"title":"bootRepackage depends on EAR plugin task causing circular dependencies between tasks","user":{"login":"clajder","id":6514261,"avatar_url":"https://avatars.githubusercontent.com/u/6514261?v=3","gravatar_id":"","url":"https://api.github.com/users/clajder","html_url":"https://github.com/clajder","followers_url":"https://api.github.com/users/clajder/followers","following_url":"https://api.github.com/users/clajder/following{/other_user}","gists_url":"https://api.github.com/users/clajder/gists{/gist_id}","starred_url":"https://api.github.com/users/clajder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clajder/subscriptions","organizations_url":"https://api.github.com/users/clajder/orgs","repos_url":"https://api.github.com/users/clajder/repos","events_url":"https://api.github.com/users/clajder/events{/privacy}","received_events_url":"https://api.github.com/users/clajder/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2015-09-09T11:20:41Z","updated_at":"2015-09-11T08:00:24Z","closed_at":null,"body":" Build configured to run tasks in the following order war->bootRepackage->ear.\r\n\r\nRelevant gradle build configuration:\r\n\r\n```groovy\r\nwar {\r\n............\r\n}\r\n\r\nbootRepackage {\r\n    withJarTask war\r\n}\r\n\r\ndependencies {\r\n    deploy files(bootRepackage)\r\n}\r\n\r\near {\r\n    deploymentDescriptor {\r\n        displayName = project.name\r\n        webModule(war.archiveName, '/service')\r\n    }\r\n\r\n}\r\n```\r\n\r\nThe issue happens in such configuration due to circular dependencies between bootRepackage and EAR tasks.\r\n\r\nThe next code snippet registers archive task deps as default dependencies:\r\n\r\nhttps://github.com/spring-projects/spring-boot/blob/master/spring-boot-tools/spring-boot-gradle-plugin/src/main/groovy/org/springframework/boot/gradle/repackage/RepackagePluginFeatures.java\r\n\r\n```java\r\nTaskDependency runtimeProjectDependencyJarTasks = runtimeConfiguration\r\n\t\t\t\t.getTaskDependencyFromProjectDependency(true, JavaPlugin.JAR_TASK_NAME);\r\n\t\ttask.dependsOn(\r\n\t\t\t\tproject.getConfigurations().getByName(Dependency.ARCHIVES_CONFIGURATION)\r\n\t\t\t\t\t\t.getAllArtifacts().getBuildDependencies(),\r\n\t\t\t\truntimeProjectDependencyJarTasks);\r\n```\r\n\t\t\t\t\r\nThe above code causes bootRepackage to depend on the next tasks:\r\n\r\n```groovy\r\nbootRepackage task deps [task 'distZip', task ':distTar', task ':ear', task ':war']\r\n```"},"comment":{"url":"https://api.github.com/repos/spring-projects/spring-boot/issues/comments/139478146","html_url":"https://github.com/spring-projects/spring-boot/issues/3931#issuecomment-139478146","issue_url":"https://api.github.com/repos/spring-projects/spring-boot/issues/3931","id":139478146,"user":{"login":"wilkinsona","id":914682,"avatar_url":"https://avatars.githubusercontent.com/u/914682?v=3","gravatar_id":"","url":"https://api.github.com/users/wilkinsona","html_url":"https://github.com/wilkinsona","followers_url":"https://api.github.com/users/wilkinsona/followers","following_url":"https://api.github.com/users/wilkinsona/following{/other_user}","gists_url":"https://api.github.com/users/wilkinsona/gists{/gist_id}","starred_url":"https://api.github.com/users/wilkinsona/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilkinsona/subscriptions","organizations_url":"https://api.github.com/users/wilkinsona/orgs","repos_url":"https://api.github.com/users/wilkinsona/repos","events_url":"https://api.github.com/users/wilkinsona/events{/privacy}","received_events_url":"https://api.github.com/users/wilkinsona/received_events","type":"User","site_admin":false},"created_at":"2015-09-11T08:00:24Z","updated_at":"2015-09-11T08:00:24Z","body":"Ah, yes. That makes sense actually. It doesn't break the cycle, just adds an extra step to it. Ok, sounds like we need to improve the plugin to reduce the tasks that it depends upon. As I said above, there's no need for the plugin to depend on the ear task so we should fix that."}}