gpt4 book ai didi

scala - gradle scalatest留在 “Discovery starting.”

转载 作者:行者123 更新时间:2023-12-03 04:45:40 27 4
gpt4 key购买 nike

我有使用gradlescalascalatestgradle-scalatest-plugin的项目。

我有几个测试,它们已被编译。但是,当执行它们的运行部分时,gradle将停留在“发现开始”上。无限地。

所以我用gradle --debug test看看发生了什么。但是,除了有关jvm的内存和锁获取的状态信息外,没有任何信息说明其卡住的原因。
build.gradle文件:

buildscript {
ext.scala_version = "2.12"
ext.akka_version = "2.5"
ext.monocle_version = "1.5.0"
ext.circe_version = "0.8+"

repositories {
mavenCentral()
jcenter()

maven {
url "https://plugins.gradle.org/m2/"
}
}

dependencies {
classpath "com.diffplug.gradle:goomph:3.9.0"
}
}

plugins {
id "java"
id "scala"
id "com.github.maiflai.scalatest" version "0.19"
id "com.athaydes.osgi-run" version "1.5.4"
id "org.dm.bundle" version "0.10.0"

// For interoperability with Other Company Eclipse P2 Repository
id "com.diffplug.gradle.p2.asmaven" version "3.9.0"
}

group "project.scalatest"
version 0.1

repositories {
mavenCentral()
jcenter()
}

sourceSets {
test {
java {
srcDirs = ['test/main/java']
}

scala {
srcDirs = ['test/main/scala']
}
}
}

runOsgi {
bundles += project
}

bundle {
instruction '-dsannotations', '*'
}

test {
}

// Adding the Other Company Eclipse P2 project Core Repo as dependency
p2AsMaven {
group 'project', {
repo 'https://other-company.de/p2/'
iu 'de.other-company.project.core'
}
}

dependencies {
//compile fileTree(dir: 'libs', include: ['*.jar', '*.java'])
compile "org.osgi:org.osgi.core:6.0+"
compile "org.osgi:org.osgi.service.log:1.3+"
compile "org.osgi:org.osgi.service.component:1.3+"
compile "org.osgi:org.osgi.service.component.annotations:1.3+"

compile "project:de.other-company.project.core:+"
// Include the program repository code as dependency
//compile fileTree(dir: "../repository")

compile "org.scala-lang:scala-library:$scala_version+"
compile "com.typesafe.akka:akka-osgi_$scala_version:$akka_version+"

compile "io.circe:circe-core_$scala_version:$circe_version"
compile "io.circe:circe-generic_$scala_version:$circe_version"
compile "io.circe:circe-parser_$scala_version:$circe_version"
compile "io.circe:circe-optics_$scala_version:$circe_version"
compile "com.github.julien-truffaut:monocle-core_$scala_version:$monocle_version"
compile "com.github.julien-truffaut:monocle-macro_$scala_version:$monocle_version"

compile "org.slf4j:slf4j-api:1.7.+"
compile "org.slf4j:slf4j-simple:1.7.+"
compile "org.slf4j:osgi-over-slf4j:1.7.+"

testCompile "com.typesafe.akka:akka-testkit_$scala_version:$akka_version+"
testCompile "org.scalatest:scalatest_$scala_version:3.2+"
testCompile "org.scalactic:scalactic_$scala_version:3.2+"
testCompile "org.scalacheck:scalacheck_$scala_version:1.13+"
testCompile "org.mockito:mockito-core:2.+"
testRuntime "org.pegdown:pegdown:1.4+"

osgiRuntime "org.apache.felix:org.apache.felix.configadmin:1.8+"
osgiRuntime "org.apache.felix:org.apache.felix.scr:2.0+"
osgiRuntime "org.apache.felix:org.apache.felix.log:1.0+"
}

最佳答案

所以我自己找到了解决方案:)

我做了一些糟糕的解决方案来在测试中查找和使用文件。
在研究了如何正确使用getClass.getResource("...")后,问题消失了。

关于scala - gradle scalatest留在 “Discovery starting.”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49319472/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com