-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could not create task ':spotlessJavaCheck'. #976
Comments
I'm currently taking a look at implementing the formatJavadoc option for the Palantir formatter for spotless and came across the same issue while writing a test for that option. It gives an error with Palantir version 2.36.0-2.38.0, but starting with version 2.39.0 it seems to be fixed:
|
a new error got
|
Don't add |
remove
|
build.gradle plugins {
id 'java-library'
id "com.palantir.java-format" version '2.39.0'
id 'com.diffplug.spotless' version '6.23.3'
}
repositories {
mavenCentral()
}
group = "lost.java"
version = "0.0.1"
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.3'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
tasks.withType(JavaCompile).configureEach {
it.options.compilerArgs += ["--enable-preview"]
}
tasks.withType(JavaExec).configureEach {
it.jvmArgs += ["--enable-preview"]
}
tasks.withType(Test).configureEach {
useJUnitPlatform()
it.jvmArgs += ["--enable-preview"]
}
spotless {
java {
target 'src/main/java/**/*.java', 'src/test/java/**/*.java'
removeUnusedImports()
trimTrailingWhitespace()
// palantirJavaFormat('2.39.0')
}
groovyGradle {
greclipse()
}
}
|
Duplicate of #957 |
This is also filed at diffplug/spotless#1944, and could be closed for now. You just need to bump your Spotless to 6.24.0 |
still failed
plugins {
id 'java-library'
id "com.palantir.java-format" version '2.39.0'
id "com.diffplug.spotless" version "6.24.0"
}
repositories {
mavenCentral()
}
group = "lost.java"
version = "0.0.1"
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.3'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
java {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
tasks.withType(JavaCompile).configureEach {
it.options.compilerArgs += ["--enable-preview"]
}
tasks.withType(JavaExec).configureEach {
it.jvmArgs += ["--enable-preview"]
}
tasks.withType(Test).configureEach {
useJUnitPlatform()
it.jvmArgs += ["--enable-preview"]
}
spotless {
java {
target 'src/main/java/**/*.java', 'src/test/java/**/*.java'
removeUnusedImports()
trimTrailingWhitespace()
// palantirJavaFormat('2.39.0')
}
groovyGradle {
greclipse()
}
}
|
Try plugins {
id 'java-library'
id "com.diffplug.spotless" version "6.24.0"
}
repositories {
mavenCentral()
}
...
spotless {
java {
target 'src/main/java/**/*.java', 'src/test/java/**/*.java'
removeUnusedImports()
trimTrailingWhitespace()
palantirJavaFormat()
}
groovyGradle {
greclipse()
}
} |
it works nice now, thanks ;-) Is this because the string-template is not supported? |
You were applying both Spotless and PJF plugins, not very sure of the root cause, but it should be enough to apply one of them. |
This should be another issue. #966 Thanks for your help ;-) |
ensure that
repositories { mavenCentral() }
have been addedThe text was updated successfully, but these errors were encountered: