我有一个带有Thorntail的多模块Gradle项目。我的主要build.gradle
看起来像这样:
buildscript {
String thorntailVersion = System.getProperty('thorntailVersion') ?: VERSION_THORNTAIL
repositories {
mavenLocal()
mavenCentral()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots/"
}
}
dependencies {
classpath "io.thorntail:thorntail-gradle-plugin:$thorntailVersion"
}
}
// Project details
allprojects {
group = 'ch.example.auth'
version = '0.0.2'
}
subprojects {
apply plugin: 'java'
apply plugin: 'java-library'
// Configure the repositories for all projects.
repositories {
mavenLocal()
mavenCentral()
maven {
name 'Gradle Tooling'
url 'https://repo.gradle.org/gradle/libs-releases/'
}
maven {
url "https://oss.sonatype.org/content/repositories/snapshots/"
}
maven {
url "http://repository.jboss.org/nexus/content/groups/public/"
}
}
dependencies {
implementation 'javax:javaee-api:8.0.1'
}
}
我的子项目模块具有以下build.gradle
:
apply plugin: 'thorntail'
apply plugin: 'war'
dependencies {
implementation "com.h2database:h2:1.4.187"
implementation 'io.thorntail:jpa:2.5.0.Final'
implementation 'io.thorntail:jaxrs:2.5.0.Final'
}
thorntail {
properties {
swarm.http.port = 8081
}
bundleDependencies = true
fractions = ['io.thorntail:jpa', 'io.thorntail:jaxrs']
}
当我运行./gradlew thorntail-run
时,它将引发错误..
2019-11-22 16:21:16,745 ERROR [stderr] (main) Caused by: java.nio.file.NoSuchFileException: /home/robin/Workspace/users-api/build/libs/users-api-0.0.2.war
..对我。如果我运行./gradlew thorntail-package thorntail-run
,它将正常工作。
我在文档中进行了搜索,但是不确定thorntail-run
是否应该构建模块?