{"action":"created","issue":{"url":"https://api.github.com/repos/johnrengelman/grails-spring-batch/issues/29","labels_url":"https://api.github.com/repos/johnrengelman/grails-spring-batch/issues/29/labels{/name}","comments_url":"https://api.github.com/repos/johnrengelman/grails-spring-batch/issues/29/comments","events_url":"https://api.github.com/repos/johnrengelman/grails-spring-batch/issues/29/events","html_url":"https://github.com/johnrengelman/grails-spring-batch/issues/29","id":59770257,"number":29,"title":"Plugin unusable if deployed within plugin","user":{"login":"john-london","id":6952657,"avatar_url":"https://avatars.githubusercontent.com/u/6952657?v=3","gravatar_id":"","url":"https://api.github.com/users/john-london","html_url":"https://github.com/john-london","followers_url":"https://api.github.com/users/john-london/followers","following_url":"https://api.github.com/users/john-london/following{/other_user}","gists_url":"https://api.github.com/users/john-london/gists{/gist_id}","starred_url":"https://api.github.com/users/john-london/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/john-london/subscriptions","organizations_url":"https://api.github.com/users/john-london/orgs","repos_url":"https://api.github.com/users/john-london/repos","events_url":"https://api.github.com/users/john-london/events{/privacy}","received_events_url":"https://api.github.com/users/john-london/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2015-03-04T09:18:43Z","updated_at":"2015-03-05T18:51:17Z","closed_at":null,"body":"The plugin works by copying BatchConfig.groovy files to target/classes/batch as a result of the CompileStart event (https://github.com/johnrengelman/grails-spring-batch/blob/master/scripts/_Events.groovy).  These files are then compiled and used as beans.\r\n\r\nHowever, other plugins delete the target/classes directory when they are installed.  As a result, depending on the order in which plugins are installed, these other plugins may delete the BatchConfig job files that have just been copied.  The approach that the plugin follows only seems to work when the BatchConfig files are defined within the main application, not within a plugin that a main application imports.\r\n\r\nUse case:  a plugin that will parse files of a particular type and process them, and which uses this plugin as a dependency.  The parsing plugin should be capable of being used within multiple other applications.\r\n\r\nHow to demonstrate:  create a plugin that uses grails-spring-batch to execute a job defined in a BatchConfig.groovy file.  Create an application that uses this new plugin and that uses a plugin that wipes the target/classes directory (e.g. tomcat).\r\n\r\nThis bug renders this plugin unusable if deployed within a plugin that is imported into a main application (I haven't yet discovered a viable workaround)."},"comment":{"url":"https://api.github.com/repos/johnrengelman/grails-spring-batch/issues/comments/77425314","html_url":"https://github.com/johnrengelman/grails-spring-batch/issues/29#issuecomment-77425314","issue_url":"https://api.github.com/repos/johnrengelman/grails-spring-batch/issues/29","id":77425314,"user":{"login":"john-london","id":6952657,"avatar_url":"https://avatars.githubusercontent.com/u/6952657?v=3","gravatar_id":"","url":"https://api.github.com/users/john-london","html_url":"https://github.com/john-london","followers_url":"https://api.github.com/users/john-london/followers","following_url":"https://api.github.com/users/john-london/following{/other_user}","gists_url":"https://api.github.com/users/john-london/gists{/gist_id}","starred_url":"https://api.github.com/users/john-london/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/john-london/subscriptions","organizations_url":"https://api.github.com/users/john-london/orgs","repos_url":"https://api.github.com/users/john-london/repos","events_url":"https://api.github.com/users/john-london/events{/privacy}","received_events_url":"https://api.github.com/users/john-london/received_events","type":"User","site_admin":false},"created_at":"2015-03-05T18:51:17Z","updated_at":"2015-03-05T18:51:17Z","body":"I'm afraid the project isn't available, but the plugins I was using are here (spring-batch plugin not shown):\r\n\r\n    dependencies {\r\n        test \"org.grails:grails-datastore-test-support:1.0-grails-2.4\"\r\n\t\tcompile \"cglib:cglib:2.2\"\r\n\t\truntime 'org.postgresql:postgresql:9.3-1102-jdbc41'\r\n    }\r\n\r\n    plugins {\r\n        build(\":release:3.0.1\",\r\n              \":rest-client-builder:1.0.3\") {\r\n            export = false\r\n        }\r\n\t\ttest(\"org.grails.plugins:code-coverage:2.0.3-2\") {\r\n\t\t\texcludes 'xercesImpl', 'xml-apis'\r\n\t\t}\r\n\t\tcompile \":scaffolding:2.1.2\"\r\n\t\truntime \":hibernate4:4.3.5.5\"\r\n\t\truntime \":database-migration:1.4.0\"\r\n\r\n                // 3 proprietary plugins, just implementing a series of business logic services (no spring-batch)\r\n\r\n\t\truntime \":jquery:1.11.1\"\r\n\t\tcompile \":jquery-ui:1.10.4\"\r\n\t\truntime \":twitter-bootstrap:3.2.0.2\"\r\n\t\truntime \":font-awesome-resources:4.2.0.0\"\r\n\t\truntime \":modernizr:2.7.1.1\"\r\n\t\t\t\t\t\t\r\n\t\tbuild \":tomcat:7.0.55\"\r\n\t\tcompile \":platform-core:1.0.0\"\r\n\t\t\r\n\t\tcompile \":asset-pipeline:1.9.6\"\r\n\t\truntime \":jquery:1.11.1\"\r\n\t\truntime \":twitter-bootstrap:3.2.0.2\"\r\n\t\truntime \":font-awesome-resources:4.2.0.0\"\r\n\t\truntime \":modernizr:2.7.1.1\"\r\n\t\t\r\n\t\truntime \":console:1.5.2\"\r\n\t\t\r\n\t\tcompile(\":grails-melody:1.55.0\") {\r\n\t\t\texport = false\r\n\t\t}\r\n\r\n\t}"}}