Rashid
09/25/2023, 9:15 AMroot@Testing:~/testing# ./gradlew clean -x test buildDockerLatest
Starting a Gradle Daemon (subsequent builds will be faster)
FAILURE: Build failed with an exception.
* Where:
Build file '/root/testing/build.gradle' line: 35
* What went wrong:
A problem occurred evaluating root project 'testing'.
> com.palantir.gradle.docker.DockerExtension_Decorated cannot be cast to java.lang.Class
BUILD FAILED in 2s
here is the files
drwxr-xr-x 2 root root 4096 Sep 20 08:18 bin
-rw-r--r-- 1 root root 3061 Sep 22 10:19 build.gradle
-rw-r--r-- 1 root root 288 Sep 20 08:18 Dockerfile
drwxr-xr-x 3 root root 4096 Sep 20 08:18 gradle
-rwxrwxrwx 1 root root 5296 Sep 20 08:18 gradlew
-rw-r--r-- 1 root root 2176 Sep 20 08:18 gradlew.bat
-rw-r--r-- 1 root root 1188 Sep 20 08:18 package.json
-rw-r--r-- 1 root root 516063 Sep 20 08:18 package-lock.json
-rw-r--r-- 1 root root 116 Sep 20 08:18 README.md
drwxr-xr-x 3 root root 4096 Sep 20 08:18 src
here is build.gradle file
buildscript {
// ext {
// springBootVersion = SPRING_BOOT_VERSION
//}
repositories {
mavenCentral()
maven {
url '<https://repo.spring.io/libs-milestone>'
}
}
dependencies {
// classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
// classpath('se.transmode.gradle:gradle-docker:1.2')
classpath "com.palantir.gradle.docker:gradle-docker:0.34.0"
}
}
apply plugin: 'com.palantir.docker'
//apply plugin: 'docker'
task buildDockerLatest(type: docker) {
push = false
tag = 'abc/demo'
tagVersion = "latest"
dockerfile = file('Dockerfile')
doFirst {
copy {
from '.'
into 'build/docker'
exclude "gradle"
exclude "gradlew"
exclude "gradlew.bat"
exclude "build"
exclude "build.gradle"
exclude "Dockerfile"
}
}
}
task wrapper (type:Wrapper) {
gradleVersion = '4.5' //we want gradle 2.10 to run this project
}
def getNightly() {
new Date().format('yyyy-MM-dd')
}
def getDate() {
new Date().format('yyyy-MM-dd-HHmm')