{"action":"closed","issue":{"url":"https://api.github.com/repos/TomDmitriev/gradle-bundle-plugin/issues/50","repository_url":"https://api.github.com/repos/TomDmitriev/gradle-bundle-plugin","labels_url":"https://api.github.com/repos/TomDmitriev/gradle-bundle-plugin/issues/50/labels{/name}","comments_url":"https://api.github.com/repos/TomDmitriev/gradle-bundle-plugin/issues/50/comments","events_url":"https://api.github.com/repos/TomDmitriev/gradle-bundle-plugin/issues/50/events","html_url":"https://github.com/TomDmitriev/gradle-bundle-plugin/issues/50","id":136488295,"number":50,"title":"Using ${tstamp} variable in bundle instruction causes Gradle daemon to fail to compile due to corrupt jar","user":{"login":"gamerson","id":595221,"avatar_url":"https://avatars.githubusercontent.com/u/595221?v=3","gravatar_id":"","url":"https://api.github.com/users/gamerson","html_url":"https://github.com/gamerson","followers_url":"https://api.github.com/users/gamerson/followers","following_url":"https://api.github.com/users/gamerson/following{/other_user}","gists_url":"https://api.github.com/users/gamerson/gists{/gist_id}","starred_url":"https://api.github.com/users/gamerson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gamerson/subscriptions","organizations_url":"https://api.github.com/users/gamerson/orgs","repos_url":"https://api.github.com/users/gamerson/repos","events_url":"https://api.github.com/users/gamerson/events{/privacy}","received_events_url":"https://api.github.com/users/gamerson/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-02-25T19:36:57Z","updated_at":"2016-02-29T15:50:08Z","closed_at":"2016-02-29T15:50:08Z","body":"Take this sample project uploaded here: https://github.com/gamerson/daemon-compiler-failure\r\n\r\nThis project has 2 simple bundles built using DM plugin.  And \"api\" and \"impl\".  When rebuilding the impl jar using \"gradlew --daemon jar\"  you can see eventual failures in the gradle compileJava task just by re-running the same command with no change to the source files.  Here is the error that is shown:\r\n\r\n```\r\n~/dev/my repos/daemon-compiler-failure/impl ../gradlew --daemon jar\r\n:api:compileJava UP-TO-DATE\r\n:api:processResources UP-TO-DATE\r\n:api:classes UP-TO-DATE\r\n:api:jar UP-TO-DATE\r\n:impl:compileJava UP-TO-DATE\r\n:impl:processResources UP-TO-DATE\r\n:impl:classes UP-TO-DATE\r\n:impl:jar UP-TO-DATE\r\n\r\nBUILD SUCCESSFUL\r\n\r\nTotal time: 0.718 secs\r\n~/dev/my repos/daemon-compiler-failure/impl ../gradlew --daemon jar\r\n:api:compileJava UP-TO-DATE\r\n:api:processResources UP-TO-DATE\r\n:api:classes UP-TO-DATE\r\n:api:jar\r\n:impl:compileJava\r\n/Users/greg/dev/my repos/daemon-compiler-failure/impl/src/main/java/org/gradle/impl/PersonImpl.java:3: error: cannot access Person\r\nimport org.gradle.api.Person;\r\n                     ^\r\n  bad class file: /Users/greg/dev/my repos/daemon-compiler-failure/api/build/libs/api-1.0.0.jar(org/gradle/api/Person.class)\r\n    unable to access file: corrupted zip file\r\n    Please remove or make sure it appears in the correct subdirectory of the classpath.\r\n:impl:compileJava FAILED\r\n\r\nFAILURE: Build failed with an exception.\r\n\r\n* What went wrong:\r\nExecution failed for task ':impl:compileJava'.\r\n> Compilation failed; see the compiler error output for details.\r\n\r\n* Try:\r\nRun with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.\r\n\r\nBUILD FAILED\r\n```\r\n\r\nIn the repo I linked to I have the full reproduce steps.  The way to fix the error is to simply drop off the \"${tstamp}\" variable in the bundle instruction.  I suppose that ${tstamp} variable expansion by bndlib is throwing off the manifest 'out-of-date' calculation someway.  But of course the worst case scenario is that gradle just reruns the \"api:jar\" task when it doesn't need to.  It should not be throwing the compilerJava task exception.    \r\n\r\nThis never happens if you are not invoking with the daemon.  It appears to be a daemon/caching problem that is triggered by the changing manifest hash inside of DM plugin.\r\n\r\nThoughts?"}}