Gradle Deaktivieren Sie die Bootbuildimage -AufgabeJava

Java-Forum
Anonymous
 Gradle Deaktivieren Sie die Bootbuildimage -Aufgabe

Post by Anonymous »

Ich arbeite mit dem folgenden Gradle.build Datei:

Code: Select all

buildscript {
configurations.classpath {
exclude module: 'spring-boot-buildpack-platform'
}
configurations.all {
resolutionStrategy {
eachDependency { details ->
if (details.requested.group == 'org.springframework' &&
details.requested.name == 'spring-core') {
details.useVersion('6.1.0-M5')
}
}
}
}
}

plugins {
id 'java'
id 'org.springframework.boot' version '3.2.0-M3'
}

group = 'com.demo'
version = '1.0.0-SNAPSHOT'

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

repositories {
maven {
credentials {
}
metadataSources {
mavenPom()
artifact()
}
}
maven {
credentials {
}
metadataSources {
mavenPom()
artifact()
}
}
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter:3.2.0-M3'
implementation 'org.springframework.boot:spring-boot-starter-web:3.2.0-M3'
implementation 'org.springframework.boot:spring-boot-starter-jdbc:3.2.0-M3'

testImplementation 'org.junit.jupiter:junit-jupiter:5.9.3'
testImplementation 'org.assertj:assertj-core:3.22.0'
testImplementation 'org.mockito:mockito-core:5.4.0'
testImplementation 'org.hamcrest:hamcrest:2.2'
testImplementation 'org.springframework.boot:spring-boot-test:3.1.5'
testImplementation 'org.springframework.boot:spring-boot-test-autoconfigure:3.1.5'
testImplementation 'org.springframework:spring-test:6.0.13'

runtimeOnly 'mysql:mysql-connector-java:8.0.30'
}

tasks.named('bootJar') {
enabled = true // Ensure bootJar is enabled to create a runnable jar
}

bootRun {
sourceResources sourceSets.main
}
(Einige Elemente, die aus proprietärem Grund entfernt wurden).
Der Befehl. Aber wenn wir ausführen.FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\E40095342\RTN\code\satsim\aces-satellite-database-server\build.gradle' line: 101

* What went wrong:
Could not create task ':bootBuildImage'.
> Could not create task of type 'BootBuildImage'.
> Could not generate a decorated class for type BootBuildImage.
> org/springframework/boot/buildpack/platform/io/TarArchive

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
< /code>
Bisher zeigt alle meine Forschungspunkte auf den Versuch, einen Docker -Build mit Gradle auszuführen. Aber wir machen nichts mit Docker. < /P>
Wie kann ich diese Aufgabe nicht ausführen? Ich habe die folgende < /p>
ausprobiertgradle.taskGraph.whenReady { taskGraph ->
if (taskGraph.hasTask(bootBuildImage)) {
task.enabled = false
}
}
< /code>
Aber die Aufgabe wird immer noch ausgeführt. Was fehlt mir? < /P>
Wir verwenden Gradle 8.8. Dies ist eine Frühlings -Java -Anwendung, die auf einer Workstation ausgeführt wird. Nein Android. Kein Docker.

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post