Process 'command 'C:\Program Files\Temurin\jdk-8.0.302.8-hotspot\bin\java.exe'' finished with non-zero exit value 1 - intellij-idea

I'm trying to add other minecraft mods as dependencies in the mod I've been working on with Intellij Idea, but when I try to launch Minecraft, it always fails and gives an error I don't understand.
Here's the error
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.1.1/userguide/command_line_interface.html#sec:command_line_warnings
10 actionable tasks: 3 executed, 7 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':runClient'.
> Process 'command 'C:\Program Files\Temurin\jdk-8.0.302.8-hotspot\bin\java.exe'' finished with non-zero exit value 1
* 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
BUILD FAILED in 1m 26s
Publishing a build scan to scans.gradle.com requires accepting the Gradle Terms of Service defined at https://gradle.com/terms-of-service. Do you accept these terms? [yes, no]
And here's my build.gradle file
repositories {
maven { url = 'https://files.minecraftforge.net/maven' }
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
}
}
apply plugin: 'net.minecraftforge.gradle'
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
version = '1.16.5-1.0'
group = 'com.pinwheel.singlet' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'singlet'
java.toolchain.languageVersion = JavaLanguageVersion.of(8) // Mojang ships Java 8 to end users, so your mod should target Java 8.
repositories {
maven {
// location of the maven that hosts JEI files
name = "Progwml6 maven"
url = "https://dvs1.progwml6.com/files/maven/"
}
maven {
// location of a maven mirror for JEI files, as a fallback
name = "ModMaven"
url = "https://modmaven.k.4u.nl"
}
}
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
minecraft {
// The mappings can be changed at any time, and must be in the following format.
// Channel: Version:
// snapshot YYYYMMDD Snapshot are built nightly.
// stable # Stables are built at the discretion of the MCP team.
// official MCVersion Official field/method names from Mojang mapping files
//
// You must be aware of the Mojang license when using the 'official' mappings.
// See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
//
// Use non-default mappings at your own risk. they may not always work.
// Simply re-run your setup task after changing the mappings to update your workspace.
mappings channel: 'snapshot', version: '20210309-1.16.5'
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
// accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
// Default run configurations.
// These can be tweaked, removed, or duplicated as needed.
runs {
client {
workingDirectory project.file('run')
// Recommended logging data for a userdev environment
// The markers can be changed as needed.
// "SCAN": For mods scan.
// "REGISTRIES": For firing of registry events.
// "REGISTRYDUMP": For getting the contents of all registries.
property 'forge.logging.markers', 'SCAN, REGISTRIES, REGISTRYDUMP'
// Recommended logging level for the console
// You can set various levels here.
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
property 'forge.logging.console.level', 'debug'
mods {
singlet {
source sourceSets.main
}
}
}
server {
workingDirectory project.file('run')
// Recommended logging data for a userdev environment
// The markers can be changed as needed.
// "SCAN": For mods scan.
// "REGISTRIES": For firing of registry events.
// "REGISTRYDUMP": For getting the contents of all registries.
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
// Recommended logging level for the console
// You can set various levels here.
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
property 'forge.logging.console.level', 'debug'
mods {
singlet {
source sourceSets.main
}
}
}
data {
workingDirectory project.file('run')
// Recommended logging data for a userdev environment
// The markers can be changed as needed.
// "SCAN": For mods scan.
// "REGISTRIES": For firing of registry events.
// "REGISTRYDUMP": For getting the contents of all registries.
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
// Recommended logging level for the console
// You can set various levels here.
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
property 'forge.logging.console.level', 'debug'
property "mixin.env.remapRefMap", "true"
property "mixin.env.refMapRemappingFile", "buildFile.parent/build/createSrgToMcp/output.srg"
// Specify the modid for data generation, where to output the resulting resource, and where to look for existing resources.
args '--mod', 'singlet', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')
mods {
singlet {
source sourceSets.main
}
}
}
}
}
// Include resources generated by data generators.
sourceSets.main.resources { srcDir 'src/generated/resources' }
dependencies {
// Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
// that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
minecraft 'net.minecraftforge:forge:1.16.5-36.2.20'
// compile against the JEI API but do not include it at runtime
compileOnly fg.deobf("mezz.jei:jei-1.16.5:7.7.1.152:api")
// at runtime, use the full JEI jar
runtimeOnly fg.deobf("mezz.jei:jei-1.16.5:7.7.1.152")
implementation fileTree(dir: 'libs', include: ['jei-1.16.5-7.7.1.152.jar'])
runtimeOnly fg.deobf("curse.maven:abnormalscore-382216:3607198")
// You may put jars on which you depend on in ./libs or you may define them like so..
// compile "some.group:artifact:version:classifier"
// compile "some.group:artifact:version"
// Real examples
// compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
// compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
// The 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
// provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
// These dependencies get remapped to your current MCP mappings
// deobf 'com.mod-buildcraft:buildcraft:6.0.8:dev'
// For more info...
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
// http://www.gradle.org/docs/current/userguide/dependency_management.html
}
repositories {
flatDir {
dirs 'lib'
}
maven { url "https://maven.jaackson.me" }
maven { url "https://dvs1.progwml6.com/files/maven/" }
maven { url "https://modmaven.k-4u.nl" }
maven { url "https://www.cursemaven.com"}
}
// Example for how to get properties into the manifest for reading by the runtime..
jar {
manifest {
attributes([
"Specification-Title": "singlet",
"Specification-Vendor": "",
"Specification-Version": "1", // We are version 1 of ourselves
"Implementation-Title": project.name,
"Implementation-Version": "${version}",
"Implementation-Vendor" :"",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
"MixinConfigs": project.name + ".mixins.json"
])
}
}
// Example configuration to allow publishing using the maven-publish task
// This is the preferred method to reobfuscate your jar file
jar.finalizedBy('reobfJar')
// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing
//publish.dependsOn('reobfJar')
publishing {
publications {
mavenJava(MavenPublication) {
artifact jar
}
}
repositories {
maven {
url "file:///${project.projectDir}/mcmodsrepo"
}
}
}
When I build the gradle, it will end up as successful, so I'm not entirely sure what I'm doing wrong. Please be patient with me, as English is not my first language.

Related

building mod does not include mcmod.info (1.12.2)

posting here as 1.12.2 is no longer officially supported by forge,
trying to build my first mod and I'm having troubles getting it to be detected by gradle
build.gradle
buildscript {
repositories {
// These repositories are only for Gradle plugins, put any other repositories in the repository block further below
maven { url = 'https://maven.minecraftforge.net' }
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
}
}
apply plugin: 'net.minecraftforge.gradle'
group = 'AvalonMods'
version = '0.0.1-SNAPSHOT'
java {
archivesBaseName = 'RuneTech'
toolchain.languageVersion = JavaLanguageVersion.of(8)
}
minecraft {
// The mappings can be changed at any time and must be in the following format.
// Channel: Version:
// snapshot YYYYMMDD Snapshot are built nightly.
// stable # Stables are built at the discretion of the MCP team.
// official MCVersion Official field/method names from Mojang mapping files
//
// You must be aware of the Mojang license when using the 'official' mappings.
// See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
//
// Use non-default mappings at your own risk. They may not always work.
// Simply re-run your setup task after changing the mappings to update your workspace.
mappings channel: 'stable', version: '39-1.12'
// accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
// Default run configurations.
// These can be tweaked, removed, or duplicated as needed.
runs {
client {
workingDirectory project.file('run')
// Recommended logging data for a userdev environment
// The markers can be added/removed as needed separated by commas.
// "SCAN": For mods scan.
// "REGISTRIES": For firing of registry events.
// "REGISTRYDUMP": For getting the contents of all registries.
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
// Recommended logging level for the console
// You can set various levels here.
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
property 'forge.logging.console.level', 'debug'
mods {
runetech {
source sourceSets.main
}
}
}
server {
workingDirectory project.file('run')
// Recommended logging data for a userdev environment
// The markers can be added/removed as needed separated by commas.
// "SCAN": For mods scan.
// "REGISTRIES": For firing of registry events.
// "REGISTRYDUMP": For getting the contents of all registries.
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
// Recommended logging level for the console
// You can set various levels here.
// Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
property 'forge.logging.console.level', 'debug'
mods {
runetech {
source sourceSets.main
}
}
}
}
}
// Include resources generated by data generators.
sourceSets.main.resources { srcDir 'src/generated/resources' }
repositories {
// Put repositories for dependencies here
// ForgeGradle automatically adds the Forge maven and Maven Central for you
// If you have mod jar dependencies in ./libs, you can declare them as a repository like so:
// flatDir {
// dir 'libs'
// }
}
dependencies {
// Specify the version of Minecraft to use. If this is any group other than 'net.minecraft' it is assumed
// that the dep is a ForgeGradle 'patcher' dependency, and its patches will be applied.
// The userdev artifact is a special name and will get all sorts of transformations applied to it.
minecraft 'net.minecraftforge:forge:1.12.2-14.23.5.2855'
// Real mod deobf dependency examples - these get remapped to your current mappings
// compileOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}:api") // Adds JEI API as a compile dependency
// runtimeOnly fg.deobf("mezz.jei:jei-${mc_version}:${jei_version}") // Adds the full JEI mod as a runtime dependency
// implementation fg.deobf("com.tterrag.registrate:Registrate:MC${mc_version}-${registrate_version}") // Adds registrate as a dependency
// Examples using mod jars from ./libs
// implementation fg.deobf("blank:coolmod-${mc_version}:${coolmod_version}")
// For more info...
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
// http://www.gradle.org/docs/current/userguide/dependency_management.html
}
// Example for how to get properties into the manifest for reading at runtime.
jar {
manifest {
attributes([
"Specification-Title" : "runetech",
"Specification-Vendor" : "Kital_Stargazer",
"Specification-Version" : "1", // We are version 1 of ourselves
"Implementation-Title" : project.name,
"Implementation-Version" : project.jar.archiveVersion,
"Implementation-Vendor" : "Kital_Stargazer",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
])
}
}
jar.finalizedBy('reobfJar')
mcmod.info
[
{
"modid": "runetech",
"name": "Rune Tech",
"description": "A technological approach to magic",
"version": "${version}",
"mcversion": "${mcversion}",
"url": "",
"updateUrl": "",
"authorList": [
"Kital_Stargazer"
],
"credits": "Inspired by: Thaumcraft (v4.2.3.5), Immersive Engineering, Embers, and more",
"logoFile": "",
"screenshots": [],
"dependencies": []
}
]
it otherwise works it's just the mcmod.info that is being stubborn.
mcmod.info is in src/main/resources, build.gradle is (to my knowledge) correctly formatted as well as mcmod.info
the mod is otherwise very bare bones at the moment so there is little that could be causing an issue
If you use IntelliJ IDEA, then add to the end of the file build.gradle
apply plugin: 'idea'
idea {
module {
inheritOutputDirs = true
}
}
subprojects {
apply plugin: 'idea'
}
task prepareAssets(type: Copy) {
group = 'build'
from project.file('src/main/resources')
into project.file('build/classes/java/main')
}
classes.dependsOn(prepareAssets)
This should help the collector find the resources of your mod.

Setting up gradle and project structure for Kotlin Multiplatform project

I want to build a CLI tool with Kotlin Multiplatform which runs on Linux, Macos and Windows.
But I am struggling with setting up my build.gradle and my project structure. I am using IntelliJ IDEA 2020.1 and created my basic project with File -> New -> Project -> Kotlin / Native | Gradle
Currently I am looking through guides from kotlinlang.org but I am more falling then achieving something.
So far my build.gradle looks as follows:
plugins {
id 'org.jetbrains.kotlin.multiplatform' version '1.3.72'
}
repositories {
mavenCentral()
}
kotlin {
// For ARM, should be changed to iosArm32 or iosArm64
// For Linux, should be changed to e.g. linuxX64
// For MacOS, should be changed to e.g. macosX64
// For Windows, should be changed to e.g. mingwX64
linuxX64("linux") {
}
mingwX64("mingw") {
}
macosX64("macos") {
binaries {
executable {
// Change to specify fully qualified name of your application's entry point:
entryPoint = 'sample.main'
// Specify command-line arguments, if necessary:
runTask?.args('')
}
}
}
sourceSets {
commonMain {
kotlin.srcDir('src/main')
resources.srcDir('src/res')
dependencies {
implementation kotlin('stdlib-common')
implementation "com.github.ajalt:clikt-multiplatform:2.7.0"
}
}
commonTest {
dependencies {
implementation kotlin('test-common')
implementation kotlin('test-annotations-common')
}
}
macosX64().compilations.test.defaultSourceSet {
dependsOn commonMain
}
// Note: To enable common source sets please comment out
'kotlin.import.noCommonSourceSets' property
// in gradle.properties file and re-import your project in IDE.
macosMain {
}
macosTest {
}
}
}
wrapper {
gradleVersion = "6.4.1"
distributionType = "ALL"
}
And my project structure is still basic:
Project structure
Formerly I only worked on Android Projects with Kotlin, and I guess I am spoiled with gradle as Android generates the most basic stuff and everything is working without doing that much.
I understand that I need to create packages like linuxMain and mingwMain, but where to I put common sourcesets? I tried to create a package called commonMain, but it won't even let me create Kotlin files in that package.
When I am finished I want to have (in the best case) one common source set and one entry point for all my targets. Is this even possible?
As far as I can see, you specify your commonMain source set's source locations as /src/main/. By default, it's usually set onto /src/commonMain/kotlin/. So if you will remove those srcDir settings and create a .kt file in your /src/commonMain/kotlin/ folder, everything should work fine. Also, I hope you have removed 'kotlin.import.noCommonSourceSets' property from your gradle.properties as your script recommended.

Runing coroutines in IntelliJ Kotlinx error

I'm trying to run a native Kotlin project using coroutines using IntelliJ IDEA Community 2020.
Here is how my build.gradle looks:
plugins {
id 'org.jetbrains.kotlin.multiplatform' version '1.3.72'
}
repositories {
mavenCentral()
}
kotlin {
// For ARM, should be changed to iosArm32 or iosArm64
// For Linux, should be changed to e.g. linuxX64
// For MacOS, should be changed to e.g. macosX64
// For Windows, should be changed to e.g. mingwX64
mingwX64("mingw") {
binaries {
executable {
// Change to specify fully qualified name of your application's entry point:
entryPoint = 'sample.main'
// Specify command-line arguments, if necessary:
runTask?.args('')
}
}
}
sourceSets {
// Note: To enable common source sets please comment out 'kotlin.import.noCommonSourceSets' property
// in gradle.properties file and re-import your project in IDE.
mingwMain {
}
mingwTest {
}
}
}
// Use the following Gradle tasks to run your application:
// :runReleaseExecutableMingw - without debug symbols
// :runDebugExecutableMingw - with debug symbols
And here is a simple KT file:
package sample
import kotlinx.coroutines.*
fun main() = runBlocking<Unit> {
val deferred = async(Dispatchers.Unconfined, CoroutineStart.LAZY) {
println("Running Async Unconfined: on thread ${Thread.currentThread().name} has run.")
42
}
val result = deferred.await()
println("Async Unconfined Result is ${result}")
}
I installed the maven plugin under Project Structure | Module and screenshot attached.
Nevertheless, I'm getting "Unresolved References..." error. Attached screenshot...
Request if someone can help me to resolve this please?
Thanks
In your Project Structure > Modules > Dependencies tab, you selected Runtime as the scope, which makes the dependency only available at runtime (usually used for transitive dependencies). Try selecting Compile here.

How to run Karate and Gatling with Gradle build system

I'm trying to run a Karate test as a Gatling performance test. My entire setup works perfect when using Maven. I am being forced to use Gradle however. When trying to run under Gradle the below disaster unfolds.
Appreciate any ideas what might be causing KarateAction to crash.
MyAPI.scala
class MyAPI extends Simulation {
val protocol = karateProtocol(
"/myendpoint" -> Nil
)
val action = karateFeature("classpath:org/mycompany/karate/tests/myAPI.feature#test=myTag")
setUp(
scenario("my-api")
.exec(action)
.inject(rampUsersPerSec(1) to (5) during (5 seconds))
.protocols(protocol)
)
}
build.gradle
buildscript {
ext {
karateVersion = '0.9.2'
}
}
apply plugin: 'scala'
configurations {
gatling
}
dependencies {
testCompile("com.intuit.karate:karate-apache:${karateVersion}")
testCompile("com.intuit.karate:karate-mock-servlet:${karateVersion}")
testCompile("com.intuit.karate:karate-junit4:${karateVersion}")
testCompile("com.intuit.karate:karate-gatling:${karateVersion}")
testCompile("net.masterthought:cucumber-reporting:3.8.0")
gatling "org.scala-lang:scala-library:2.12.8"
gatling "io.gatling:gatling-app:3.0.2"
gatling "io.gatling.highcharts:gatling-charts-highcharts:3.0.2"
gatling "com.intuit.karate:karate-gatling:${karateVersion}"
}
sourceSets {
simulations {
scala {
srcDirs = ['src/test/java/org/mycompany/karate/perf']
}
resources {
srcDirs = ['src/test/java/org/mycompany/karate/perf']
}
compileClasspath += configurations.gatling
}
test {
resources {
srcDir file('src/test/java')
exclude '**/*.java'
}
}
}
test {
systemProperty "karate.options", System.properties.getProperty("karate.options")
systemProperty "karate.env", System.properties.getProperty("karate.env")
outputs.upToDateWhen { false }
}
task gatlingRun(type: JavaExec) {
description = 'Run Gatling Tests'
new File("${buildDir}/reports/gatling").mkdirs()
classpath = sourceSets.simulations.runtimeClasspath += configurations.gatling
main = "io.gatling.app.Gatling"
args = [
'-s', 'org.mycompany.karate.perf.MyAPI',
'-sf', 'src/test/java/org/mycompany/karate/perf',
'-rf', "${buildDir}/reports/gatling"
]
systemProperties System.properties
}
command line
gradle gatlingRun
command line output
> Task :compileSimulationsJava NO-SOURCE
> Task :compileSimulationsScala
Pruning sources from previous analysis, due to incompatible CompileSetup.
there were 6 feature warnings; re-run with -feature for details
one warning found
> Task :processSimulationsResources NO-SOURCE
> Task :simulationsClasses
> Task :gatlingRun
16:40:27.238 [main] INFO io.gatling.core.config.GatlingConfiguration$ - Gatling will try to use 'gatling.conf' as custom config file.
16:40:27.598 [GatlingSystem-akka.actor.default-dispatcher-3] INFO akka.event.slf4j.Slf4jLogger - Slf4jLogger started
16:40:28.242 [GatlingSystem-akka.actor.default-dispatcher-3] INFO io.gatling.core.stats.writer.ConsoleDataWriter - Initializing
16:40:28.242 [GatlingSystem-akka.actor.default-dispatcher-4] INFO io.gatling.core.stats.writer.LogFileDataWriter - Initializing
16:40:28.248 [GatlingSystem-akka.actor.default-dispatcher-3] INFO io.gatling.core.stats.writer.ConsoleDataWriter - Initialized
16:40:28.253 [GatlingSystem-akka.actor.default-dispatcher-4] INFO io.gatling.core.stats.writer.LogFileDataWriter - Initialized
Simulation org.mycompany.karate.perf.MyAPI started...
16:40:28.359 [GatlingSystem-akka.actor.default-dispatcher-2] ERROR com.intuit.karate.gatling.KarateAction - 'classpath:org/mycompany/karate/tests/myAPI.feature#test=myTag' crashed on session Session(my-api,1,1558395628341,Map(),0,OK,List(),io.gatling.core.protocol.ProtocolComponentsRegistry$$Lambda$329/1759250827#7cee98de), forwarding to the next one
java.lang.NullPointerException: null
at com.intuit.karate.Resource.<init>(Resource.java:55)
at com.intuit.karate.core.FeatureParser.parse(FeatureParser.java:75)
at com.intuit.karate.FileUtils.parseFeatureAndCallTag(FileUtils.java:155)
at com.intuit.karate.Runner.callAsync(Runner.java:183)
at com.intuit.karate.gatling.KarateAction.execute(KarateAction.scala:77)
at io.gatling.core.action.Action.$bang(Action.scala:38)
at io.gatling.core.action.Action.$bang$(Action.scala:38)
at com.intuit.karate.gatling.KarateAction.io$gatling$core$action$ChainableAction$$super$$bang(KarateAction.scala:37)
at io.gatling.core.action.ChainableAction.$bang(Action.scala:63)
at io.gatling.core.action.ChainableAction.$bang$(Action.scala:61)
at com.intuit.karate.gatling.KarateAction.io$gatling$core$action$ExitableAction$$super$$bang(KarateAction.scala:37)
at io.gatling.core.action.ExitableAction.$bang(BlockExit.scala:138)
at io.gatling.core.action.ExitableAction.$bang$(BlockExit.scala:136)
at com.intuit.karate.gatling.KarateAction.$bang(KarateAction.scala:37)
at io.gatling.core.controller.inject.Workload.startUser(Workload.scala:55)
at io.gatling.core.controller.inject.Workload.injectUser(Workload.scala:64)
at io.gatling.core.controller.inject.open.OpenWorkload.$anonfun$injectBatch$1(OpenWorkload.scala:35)
at io.gatling.core.controller.inject.open.OpenWorkload.$anonfun$injectBatch$1$adapted(OpenWorkload.scala:35)
at io.gatling.core.controller.inject.open.UserStream.withStream(UserStream.scala:58)
at io.gatling.core.controller.inject.open.OpenWorkload.injectBatch(OpenWorkload.scala:35)
at io.gatling.core.controller.inject.Injector.$anonfun$inject$1(Injector.scala:60)
at io.gatling.core.controller.inject.Injector.$anonfun$inject$1$adapted(Injector.scala:59)
at scala.collection.Iterator.foreach(Iterator.scala:941)
at scala.collection.Iterator.foreach$(Iterator.scala:941)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1429)
at scala.collection.MapLike$DefaultValuesIterable.foreach(MapLike.scala:213)
at io.gatling.core.controller.inject.Injector.io$gatling$core$controller$inject$Injector$$inject(Injector.scala:59)
at io.gatling.core.controller.inject.Injector$$anonfun$1.applyOrElse(Injector.scala:92)
at io.gatling.core.controller.inject.Injector$$anonfun$1.applyOrElse(Injector.scala:82)
at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:38)
at akka.actor.FSM.processEvent(FSM.scala:684)
at akka.actor.FSM.processEvent$(FSM.scala:681)
at io.gatling.core.controller.inject.InjectorFSM.processEvent(InjectorFSM.scala:37)
at akka.actor.FSM.akka$actor$FSM$$processMsg(FSM.scala:678)
at akka.actor.FSM$$anonfun$receive$1.applyOrElse(FSM.scala:672)
at akka.actor.Actor.aroundReceive(Actor.scala:517)
at akka.actor.Actor.aroundReceive$(Actor.scala:515)
at io.gatling.core.akka.BaseActor.aroundReceive(BaseActor.scala:24)
at akka.actor.ActorCell.receiveMessage(ActorCell.scala:588)
at akka.actor.ActorCell.invoke(ActorCell.scala:557)
at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:258)
at akka.dispatch.Mailbox.run(Mailbox.scala:225)
at akka.dispatch.Mailbox.exec(Mailbox.scala:235)
at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
16:40:28.359 [GatlingSystem-akka.actor.default-dispatcher-2] DEBUG io.gatling.core.action.Exit - End user #1
16:40:28.360 [GatlingSystem-akka.actor.default-dispatcher-2] DEBUG io.gatling.core.controller.inject.open.OpenWorkload - Start user #1
16:40:28.363 [GatlingSystem-akka.actor.default-dispatcher-2] DEBUG io.gatling.core.controller.inject.open.OpenWorkload - Injecting 4 users in scenario my-api, continue=true
16:40:28.364 [GatlingSystem-akka.actor.default-dispatcher-2] DEBUG io.gatling.core.controller.inject.Injector - End user #1
16:40:29.347 [GatlingSystem-akka.actor.default-dispatcher-2] DEBUG io.gatling.core.controller.inject.open.OpenWorkload - Injecting 0 users in scenario my-api, continue=true
16:40:29.373 [GatlingSystem-akka.actor.default-dispatcher-2] ERROR com.intuit.karate.gatling.KarateAction - 'classpath:org/mycompany/karate/tests/myAPI.feature#test=myTag' crashed on session Session(my-api,2,1558395629372,Map(),0,OK,List(),io.gatling.core.protocol.ProtocolComponentsRegistry$$Lambda$329/1759250827#7cee98de), forwarding to the next one
I have a gradle project with scala and java, and had to create a gradle task to move resources to the right folder, in order to make them available.
task copyResources(type: Copy) {
from ("src/test/java/") {
include "/**/*.feature"
include "karate-config*.js"
include "logback*.xml"
include "/**/*.csv"
include "/**/*.json"
}
into "$buildDir/classes/java/test/"
}
This is just a guess.
Your build.gradle defines src/test/java as resource folder:
test {
resources {
srcDir file('src/test/java')
exclude '**/*.java'
}
}
The karate gatling demo defines src/test/scala as resource folder.
This is necessary, because otherwise the *.feature files next to your scala/java source files are not treated as part of the resulting artifact.
Furthermore, you are using the classpath of the simulation source set when running gatling test. Make sure, that your *.feature are included in that classpath.
As an alternative, you can put your *.feature files under src/test/resources/com/your/package, but this increases "the distance" between your feature and source code files.
Debugging Hint:
Print the file tree of your build/resources folder in order to check whether or not the feature files are included in the resulting build artifact and that the path matches the path you are referencing in your runner.
Let me know if this was useful!

GRADLE - You must specify at least one directory for a flat directory repository

I'm trying to build a gradle 2.11 project in Intellij and I keep getting this error kicked back to me. I'm setting a flatDir in the build.gradle file but this error is still coming up when I run gradle idea.
buildscript {
repositories {
flatDir {
dirs "$rootProject.rootDir/lib/gradle-plugins"
}
}
dependencies {
classpath "gradle.plugins:prompt-version-plugin:1.0.0"
classpath "gradle.plugins:properties-plugin:1.0.0"
}
}
idea {
module {
/*
* If you omit [ ] around, it fails with: Cannot change configuration ':provided' after it has been resolved
* This is due Gradle 2.x using Groovy 2.3 that does not allow += for single elements addition.
* More: https://discuss.gradle.org/t/custom-provided-configuration-not-working-with-gradle-2-0-rc2-in-multi-project-mode/2459
*/
scopes.PROVIDED.plus += [configurations.provided]
downloadJavadoc = true
downloadSources = true
}
}
Error
* What went wrong:
Execution failed for task ':ideaModule'.
> You must specify at least one directory for a flat directory repository.
Is there another place to set the flat directory?