-
Notifications
You must be signed in to change notification settings - Fork 486
Closed
Labels
Description
Recently I have upgraded to spotless 3.4.0. Gradle 3.5 and Java 1.8
My spotless config
buildscript {
repositories {
mavenCentral()
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath 'com.diffplug.spotless:spotless-plugin-gradle:3.4.0'
classpath 'com.google.googlejavaformat:google-java-format:1.3'
}
}
apply plugin: com.diffplug.gradle.spotless.SpotlessPlugin
spotless {
java {
googleJavaFormat('1.3')
custom 'Lambda fix', { it.replace('} )', '})').replace('} ,', '},') }
importOrder(['java', 'javax', 'org', 'com'])
trimTrailingWhitespace()
removeUnusedImports()
}
format 'misc', {
target '**/.gitignore', '**/*.gradle', '**/*.md', '**/*.sh'
indentWithSpaces(2)
trimTrailingWhitespace()
endWithNewline()
}
}
I am getting following error.
:spotlessJava
You probably need to add a repository containing the '[com.google.googlejavaformat:google-java-format:1.3]' artifact, e.g.: 'buildscript { repositories { mavenCentral() }}'
org.gradle.api.artifacts.ResolveException: Could not resolve all dependencies for configuration ':detachedConfiguration1'.
at org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration.rethrowFailure(DefaultLenientConfiguration.java:192)
at
(tons more)
If I downgrade to 3.0.0 its just working fine for the same config.
EDIT by @nedtwigg: this is a long thread, but the resolution was that the buildscript
block above must appear in build.gradle
, it's not enough for it to be appear in a separate file, such as spotless.gradle
, which gets include
d.