This message was deleted.
# dependency-management
s
This message was deleted.
e
how are you setting up the run task? something like
Copy code
tasks.register("runTest", JavaExec::class) {
    // javaLauncher.set(javaToolchains.launcherFor { ... })
    classpath(sourceSets.test.map { files(it.output.dirs, it.runtimeClasspath) })
    mainClass.set("...")
}
should work
j
Ok I’ll give it a try. I noticed after posting this that it’s being run out of the wrong root project. I’m running through IntelliJ by just using the launch icon in the margin. Do you know of a way to change the root project when launching that way in IntelliJ?
e
no, I don't think there's any way to control that. you can set up a custom run configuration in intellij though
j
Ok, it’s weird because if I add the
@SpringBootApplication
annotation to the class it works fine, the classpath is setup correctly, etc. But that ends breaking a few other unit tests because spring detects multiple applications on the classpath, which makes sense but it’s weird that it works.
Resurrecting an old thread, you can cheat and put the test in the base src/test/java and the projects will properly build and resolve with little to no configuration necessary