Ich bin ein neuer Konvertit zu Gradle. Die meisten Aufgaben funktionieren gut. Allerdings sehe ich, dass die Kriegsaufgabe immer übersprungen wird. Wenn ich in den Debug-Modus laufen, sehe ich die folgenden Protokolle -Warum wird die Task "Graples War" übersprungen?
09: 12: 34,889 [LIFECYCLE] [Klasse org.gradle.internal.buildevents.TaskExecutionLogger]: Krieg 09: 12: 34,889 [ DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Start Aufgabe auszuführen ': Krieg' 09: 12: 34,889 [INFO] [org.gradle.api.internal.tasks.execution. SkipOnlyIfTaskExecuter] Überspringt Task ': war' nur als TaskIf ist falsch. 09: 12: 34,889 [DEBUG] [org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter] Ausführung beendet Aufgabe ': Krieg' 09: 12: 34,889 [LIFECYCLE] [Klasse org.gradle.internal. buildevents.TaskExecutionLogger]: war SKIPPED
Ich bin nicht sicher, warum nurIf ist falsch. Ich habe im Internet gesucht. Aber ich habe nichts Ähnliches gefunden.
Hier ist meine gradle Datei -
buildscript {
ext {
springBootVersion = '2.0.0.M2'
}
repositories {
mavenCentral()
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
}
}
// Apply the java-library plugin to add support for Java Library
apply plugin: 'java-library'
apply plugin: 'eclipse'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'war'
apply plugin: 'checkstyle'
apply plugin: 'pmd'
apply plugin: 'findbugs'
apply plugin: 'jacoco'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8
repositories {
jcenter()
mavenCentral()
maven { url "https://repo.spring.io/snapshot" }
maven { url "https://repo.spring.io/milestone" }
}
dependencies {
compile('org.springframework.boot:spring-boot-starter')
compile("org.springframework.boot:spring-boot-starter-web")
compile("org.springframework.retry:spring-retry:1.2.1.RELEASE")
compile("org.springframework.data:spring-data-cassandra:2.0.0.M4")
compile("io.reactivex.rxjava2:rxjava:2.1.1")
//compile("javax.persistence:persistence-api:1.0.2")
//compile("org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.1.Final")
compile("org.springframework.boot:spring-boot-starter-data-jpa")
compile("com.zaxxer:HikariCP:2.6.0")
// Test Dependencies
testCompile("org.springframework.boot:spring-boot-starter-test")
testCompile("org.powermock:powermock-mockito-release-full:1.6.4")
testCompile("org.mockito:mockito-core:2.0.3-beta")
testCompile("org.cassandraunit:cassandra-unit:3.1.3.2")
testCompile("org.cassandraunit:cassandra-unit-spring:2.2.2.1")
testCompile("com.h2database:h2:1.4.196")
// This dependency is exported to consumers, that is to say found on their compile classpath.
api 'org.apache.commons:commons-math3:3.6.1'
// This dependency is used internally, and not exposed to consumers on their own compile classpath.
implementation 'com.google.guava:guava:21.0'
testImplementation 'junit:junit:4.12'
}
Hier ist das Bild meiner Projektstruktur -
Wenn Sie mich mit Erzeugung der WAR-Datei helfen könnte, das wäre toll.
Sie ungültige Projektstruktur aufweisen kann, z.B. web.xml wird nicht dort platziert, wo es sein sollte. – Opal
Ich habe es in die Standard-Projektstruktur geändert - src.main/webapp und dann WEB-INF-Ordner darin. web.xml befindet sich im Ordner WEB-INF. Trotzdem wird die Aufgabe übersprungen! – user3276247