gpt4 book ai didi

gradle - Allure 报告的 jvmArgs 设置

转载 作者:行者123 更新时间:2023-12-02 13:24:26 26 4
gpt4 key购买 nike

我正在尝试通过使用生成报告

gradlew clean test 

命令。它失败并出现错误:
Error occured during intialization of VM
Error opening zip file or JAR nanifest missing : ${configurations.agent.singleFile}

这是我的 build.gradle文件:
group 'RegisteredUserFlow'
version '1.0-SNAPSHOT'

buildscript {
ext.kotlin_version = '1.1.2-2'

repositories {
jcenter()
}

dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

apply plugin: 'kotlin'

repositories {
jcenter()
}

configurations {
agent
}

dependencies {
agent 'org.aspectj:aspectjweaver:1.8.10'
compile 'org.jetbrains.kotlin:kotlin-stdlib-jre8:1.1.2-2'
testCompile 'com.codeborne:selenide:4.4.3'
testCompile 'org.testng:testng:6.10'
testCompile 'io.qameta.allure:allure-testng:2.0-BETA6'
testCompile 'io.github.bonigarcia:webdrivermanager:1.6.2'
}

test.doFirst {
jvmArgs '-javaagent:${configurations.agent.singleFile}'
}

test {
useTestNG(){
suites'src/test/resources/testng.xml'
}

systemProperty 'allure.results.directory', 'build/allure-results'
systemProperty 'allure.link.issue.pattern', 'https://github.com/allure-framework/allure-docs/issues/{}'
systemProperty 'allure.link.tms.pattern', 'https://github.com/allure-framework/allure-docs/issues/{}'
}

我一直认为问题出在 aspectJ但我不确定。
我错过了 gradle 文件中的某些内容吗?或者它在我的测试文件中的某个地方?或者最新的 Allure 有问题版本?我看到 jvmArgs用灰色突出显示(从未使用过) - 也许有问题?

对于我从未处理过的许多问题感到抱歉 AllureaspectJ .

谢谢你的帮助!

最佳答案

您的问题是您使用了 String你应该在哪里使用 GString .

jvmArgs '-javaagent:${configurations.agent.singleFile}'

这条线是从字面上理解的。应该是
jvmArgs "-javaagent:${configurations.agent.singleFile}"

更换占位符。 (单引号与双引号)。

关于gradle - Allure 报告的 jvmArgs 设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44116777/

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