0

想要将 reportPortal 集成到我的 Espresso 自动化中。reportPortal 给出了以下 gradle 配置以添加到项目的 main build.gradle 中。问题是,只要 gradle 是基于 java 的,而我的项目是基于 android 的。

apply plugin: 'java'
sourceCompatibility = 1.8
targetCompatibility = 1.8

description = 'ReportPortal JUnit 4 example'

repositories {
    mavenLocal()
    mavenCentral()
    jcenter()
    maven { url 'https://jitpack.io' }
    maven { url "http://dl.bintray.com/epam/reportportal" }
}

dependencies {
    compile 'com.epam.reportportal:logger-java-log4j:4.0.1'
    compile 'com.epam.reportportal:agent-java-junit:4.1.10'
}

ext {
    junitFoundation = configurations.compile.resolvedConfiguration.resolvedArtifacts.find { it.name == 'junit-foundation' }
}

test.doFirst {
    jvmArgs "-javaagent:${junitFoundation.file}"
}

test {
//  debug true
    testLogging.showStandardStreams = true
}

我已经尝试过以下事情。

  • 我在下面删除了,因为它要求提供 android 插件。
apply plugin: 'java'
sourceCompatibility = 1.8
targetCompatibility = 1.8
  • 我已将依赖项升级到
androidTestImplementation group: 'com.epam.reportportal', name: 'logger-java-log4j', version: '5.0.0-BETA-2'
androidTestImplementation group: 'com.epam.reportportal', name: 'agent-java-junit', version: '5.0.0-BETA-3'
  • 我转换testtestOptions.

但它不起作用。需要帮助来修复它。

4

1 回答 1

0

请尝试此解决方案

项目级 build.gradle

利用

maven { url "https://www.jitpack.io" }

代替

maven { url "https://jitpack.io" }
于 2019-11-01T07:37:57.813 回答