{"action":"opened","issue":{"url":"https://api.github.com/repos/diffplug/spotless/issues/159","repository_url":"https://api.github.com/repos/diffplug/spotless","labels_url":"https://api.github.com/repos/diffplug/spotless/issues/159/labels{/name}","comments_url":"https://api.github.com/repos/diffplug/spotless/issues/159/comments","events_url":"https://api.github.com/repos/diffplug/spotless/issues/159/events","html_url":"https://github.com/diffplug/spotless/issues/159","id":268483271,"number":159,"title":"Error from spotless after running a clean before linting","user":{"login":"JLLeitschuh","id":1323708,"avatar_url":"https://avatars2.githubusercontent.com/u/1323708?v=4","gravatar_id":"","url":"https://api.github.com/users/JLLeitschuh","html_url":"https://github.com/JLLeitschuh","followers_url":"https://api.github.com/users/JLLeitschuh/followers","following_url":"https://api.github.com/users/JLLeitschuh/following{/other_user}","gists_url":"https://api.github.com/users/JLLeitschuh/gists{/gist_id}","starred_url":"https://api.github.com/users/JLLeitschuh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JLLeitschuh/subscriptions","organizations_url":"https://api.github.com/users/JLLeitschuh/orgs","repos_url":"https://api.github.com/users/JLLeitschuh/repos","events_url":"https://api.github.com/users/JLLeitschuh/events{/privacy}","received_events_url":"https://api.github.com/users/JLLeitschuh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-10-25T17:29:27Z","updated_at":"2017-10-25T17:29:27Z","closed_at":null,"author_association":"COLLABORATOR","body":"Running a `./gradlew clean spotlessCheck` or `./gradlew clean spotlessApply` sometimes results in an error like this:\r\n\r\n```\r\nStep 'ktlint' found problem in 'src/main/kotlin/com/plexxi/fitting/api/ComputationalInterfaces.kt':\r\nnull\r\njava.lang.reflect.InvocationTargetException\r\n        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n        at java.lang.reflect.Method.invoke(Method.java:498)\r\n        at com.diffplug.spotless.kotlin.KtLintStep$State.createFormat(KtLintStep.java:85)\r\n        at com.diffplug.spotless.FormatterStepImpl$Standard.format(FormatterStepImpl.java:76)\r\n        at com.diffplug.spotless.FormatterStep$Strict.format(FormatterStep.java:76)\r\n        at com.diffplug.spotless.Formatter.compute(Formatter.java:230)\r\n        at com.diffplug.spotless.Formatter.isClean(Formatter.java:167)\r\n        at com.diffplug.gradle.spotless.SpotlessTask.check(SpotlessTask.java:216)\r\n        at com.diffplug.gradle.spotless.SpotlessTask.performAction(SpotlessTask.java:172)\r\n        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n        at java.lang.reflect.Method.invoke(Method.java:498)\r\n        at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)\r\n        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$IncrementalTaskAction.doExecute(DefaultTaskClassInfoStore.java:179)\r\n        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:135)\r\n        at org.gradle.api.internal.project.taskfactory.DefaultTaskClassInfoStore$StandardTaskAction.execute(DefaultTaskClassInfoStore.java:122)\r\n        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:121)\r\n        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)\r\n        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)\r\n        at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)\r\n        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)\r\n        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:110)\r\n        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)\r\n        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)\r\n        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)\r\n        at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)\r\n        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)\r\n        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)\r\n        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87)\r\n        at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)\r\n        at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)\r\n        at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)\r\n        at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)\r\n        at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)\r\n        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)\r\n        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)\r\n        at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)\r\n        at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)\r\n        at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)\r\n        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)\r\n        at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)\r\n        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)\r\n        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)\r\n        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)\r\n        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)\r\n        at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:625)\r\n        at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:580)\r\n        at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)\r\n        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)\r\n        at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)\r\n        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)\r\n        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)\r\n        at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)\r\n        at java.lang.Thread.run(Thread.java:745)\r\nCaused by: java.lang.NoClassDefFoundError: com/github/shyiko/ktlint/core/Rule\r\n        at com.github.shyiko.ktlint.ruleset.standard.StandardRuleSetProvider.get(StandardRuleSetProvider.kt:8)\r\n        ... 57 more\r\nCaused by: java.lang.ClassNotFoundException: com.github.shyiko.ktlint.core.Rule\r\n        at java.net.URLClassLoader.findClass(URLClassLoader.java:381)\r\n        at java.lang.ClassLoader.loadClass(ClassLoader.java:424)\r\n        at java.lang.ClassLoader.loadClass(ClassLoader.java:357)\r\n        ... 58 more\r\n```\r\n\r\nI opened this [issue with ktlint](https://github.com/shyiko/ktlint/issues/95) to which I got the response:\r\n> `java.lang.ClassNotFoundException: com.github.shyiko.ktlint.core.Rule` indicates that `com.github.shyiko.ktlint:ktlint-core` (transitive dependency of `com.github.shyiko:ktlint`) isn't available on the classpath. Looks like artifact resolution / class loading / misconfiguration issue (most definitely not a `ktlint` problem).\r\n\r\nI'm not sure why this happens only immediately after running a `clean`.\r\n\r\n## Version Info\r\n```\r\n------------------------------------------------------------\r\nGradle 4.2\r\n------------------------------------------------------------\r\n\r\nBuild time:   2017-09-20 14:48:23 UTC\r\nRevision:     5ba503cc17748671c83ce35d7da1cffd6e24dfbd\r\n\r\nGroovy:       2.4.11\r\nAnt:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015\r\nJVM:          1.8.0_92 (Oracle Corporation 25.92-b14)\r\nOS:           Mac OS X 10.12.6 x86_64\r\n```\r\n\r\nSpotless Version: `3.5.1`\r\nKtlint Version: `0.9.2`\r\n"}}
{"actor":{"display_login":"JLLeitschuh"}}