其他测试框架 [求教] jmeter5.3 源码编译报 autostyleKotlinCheck 错误

小断腿 · 2020年11月24日 · 最后由 ydxiaoshuai 回复于 2023年02月22日 · 5749 次阅读

操作步骤

1、在 jmeter 源码下载源码,解压到本地
2、在解压目录执行命令 gradlew build 报错

环境

操作系统:Windows7,64 位
java 版本:1.8.0_201

报错信息

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':buildSrc:autostyleKotlinGradleCheck'.
> The following files have format violations:
    build.gradle.kts
      @@ -1,77 +1,77 @@
      -/*\n
      - * Licensed to the Apache Software Foundation (ASF) under one or more\n
      - * contributor license agreements.  See the NOTICE file distributed with\n
      - * this work for additional information regarding copyright ownership.\n
      - * The ASF licenses this file to You under the Apache License, Version 2.0\n
      - * (the "License"); you may not use this file except in compliance with\n
      - * the License.  You may obtain a copy of the License at\n
      - *\n
      - *   http://www.apache.org/licenses/LICENSE-2.0\n
      - *\n
      - * Unless required by applicable law or agreed to in writing, software\n
      - * distributed under the License is distributed on an "AS IS" BASIS,\n
      - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n
      - * See the License for the specific language governing permissions and\n
      - * limitations under the License.\n
      - *\n
      - */\n
      -\n
      -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile\n
      -\n
      -plugins {\n
      -    java\n
      -    `kotlin-dsl` apply false\n
      -    id("com.github.autostyle")\n
      -}\n
      -\n
      -repositories {\n
      -    jcenter()\n
      -    gradlePluginPortal()\n
      -}\n
      -\n
      -allprojects {\n
      -    repositories {\n
      -        jcenter()\n
      -        gradlePluginPortal()\n
      -    }\n
      -    applyKotlinProjectConventions()\n
      -}\n
      -\n
      -fun Project.applyKotlinProjectConventions() {\n
      -    apply(plugin = "org.gradle.kotlin.kotlin-dsl")\n
      -\n
      -    plugins.withType<KotlinDslPlugin> {\n
      -        configure<KotlinDslPluginOptions> {\n
      -            experimentalWarning.set(false)\n
      -        }\n
      -    }\n
      -\n
    ... (106 more lines that didn't fit)
  Violations also present in:
    settings.gradle.kts
  You might want to adjust -PmaxCheckMessageLines=50 -PmaxFilesToList=10 -PminLinesPerFile=4 to see more violations
  Run './gradlew autostyleApply' to fix the violations.

* 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.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':buildSrc:batchtest:autostyleKotlinCheck'.
> The following files have format violations:
    subprojects\batchtest\src\main\kotlin\org\apache\jmeter\buildtools\batchtest\BatchTest.kt
      @@ -1,213 +1,213 @@
      -/*\n
      - * Licensed to the Apache Software Foundation (ASF) under one or more\n
      - * contributor license agreements.  See the NOTICE file distributed with\n
      - * this work for additional information regarding copyright ownership.\n
      - * The ASF licenses this file to You under the Apache License, Version 2.0\n
      - * (the "License"); you may not use this file except in compliance with\n
      - * the License.  You may obtain a copy of the License at\n
      - *\n
      - *   http://www.apache.org/licenses/LICENSE-2.0\n
      - *\n
      - * Unless required by applicable law or agreed to in writing, software\n
      - * distributed under the License is distributed on an "AS IS" BASIS,\n
      - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n
      - * See the License for the specific language governing permissions and\n
      - * limitations under the License.\n
      - *\n
      - */\n
      -\n
      -package org.apache.jmeter.buildtools.batchtest\n
      -\n
      -import org.eclipse.jgit.diff.DiffAlgorithm\n
      -import org.eclipse.jgit.diff.DiffFormatter\n
      -import org.eclipse.jgit.diff.RawText\n
      -import org.eclipse.jgit.diff.RawTextComparator\n
      -import org.eclipse.jgit.util.io.AutoCRLFInputStream\n
      -import org.gradle.api.GradleException\n
      -import org.gradle.api.model.ObjectFactory\n
      -import org.gradle.api.tasks.Input\n
      -import org.gradle.api.tasks.InputDirectory\n
      -import org.gradle.api.tasks.InputFile\n
      -import org.gradle.api.tasks.InputFiles\n
      -import org.gradle.api.tasks.Internal\n
      -import org.gradle.api.tasks.JavaExec\n
      -import org.gradle.kotlin.dsl.property\n
      -import java.io.File\n
      -import java.net.InetAddress\n
      -import javax.inject.Inject\n
      -\n
      -open class BatchTest @Inject constructor(objects: ObjectFactory) : JavaExec() {\n
      -    companion object {\n
      -        const val BATCH_TESTS_GROUP_NAME = "Batch test"\n
      -    }\n
      -\n
      -    @Input\n
      -    val ignoreErrorLogs = objects.property<Boolean>().convention(false)\n
      -\n
      -    @Input\n
      -    val testName = objects.property<String>()\n
    ... (378 more lines that didn't fit)
  Violations also present in:
    subprojects\batchtest\src\main\kotlin\org\apache\jmeter\buildtools\batchtest\BatchtestPlugin.kt
    subprojects\batchtest\src\main\kotlin\org\apache\jmeter\buildtools\batchtest\BatchTestServer.kt
    subprojects\batchtest\src\main\kotlin\org\apache\jmeter\buildtools\batchtest\WriterExtensions.kt
  You might want to adjust -PmaxCheckMessageLines=50 -PmaxFilesToList=10 -PminLinesPerFile=4 to see more violations
  Run './gradlew autostyleApply' to fix the violations.

* 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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.3/userguide/command_line_interface.html#sec:command_line_warnings

CONFIGURE FAILED in 3s
共收到 7 条回复 时间 点赞
仅楼主可见

楼主,请问这个问题解决了吗?

楼主,我遇到的这个问题已解决,解决的方式是:开了个 “微 P 恩”,所以怀疑这个问题是没有把需要的依赖下载下来所导致的。
另外,我重新下载了 jmeter5.4 的 zip 包
IDEA 的版本要高于 2018.3.1,并且根据网上步骤设置 IDEA 的 gradle

参考文章链接:https://blog.csdn.net/lzllzllzlzz/article/details/108625992
导入项目等待漫长的下载过后,命令行执行 gradlew runGui
就会出现 jmeter 启动界面了
希望能帮到

ChangeM佚名 回复

用的什么翻墙软件?

ChangeM佚名 回复

大佬 同样的问题 用了你发的办法 还是不行 求助啊。。。


楼主解决了吗?

ChangeM佚名 回复

命令行执行 gradlew runGui 我是这样执行就成功了

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册