我在Gradle构建中遇到了我的第一个传递依赖冲突,并且不确定在许多记载的方法中哪种方法最适合我的情况。
我有一个根项目,负责在多个子Gradle插件项目上运行功能测试,但是除了测试用例外,没有其他代码。我正在使用Manual Classpath Injection方法在测试类路径中获取子项目。
// Write the plugin's classpath to a file to share with the tests
task pluginUnderTestMetadata {
def outputDir = file("${buildDir}/pluginUnderTestMetadata")
def runtimeClasspath = sourceSets.main.runtimeClasspath
outputs.dir(outputDir)
.withPropertyName("outputDir")
inputs.files(runtimeClasspath)
.withPropertyName("runtimeClasspath")
.withNormalizer(ClasspathNormalizer)
doLast {
outputDir.mkdirs()
file("$outputDir/plugin-classpath.txt").text = runtimeClasspath.join("\n")
}
}
dependencies {
implementation localGroovy(),
gradleApi(),
project(':waweb.site.plugin'),
project(':waweb.site.plugin.js'),
project(':waweb.site.plugin.sass'),
project(':waweb.site.plugin.template'),
project(':waweb.site.plugin.war')
testRuntimeOnly files(pluginUnderTestMetadata)
testImplementation gradleTestKit(),
"junit:junit:${JUNIT_VER}",
"org.assertj:assertj-core:${ASSERTJ_VER}",
"org.hamcrest:hamcrest:${HAMCREST_VER}",
"net.serenity-bdd:serenity-core:${SERENITY_VER}",
"net.serenity-bdd:serenity-junit:${SERENITY_VER}",
"net.serenity-bdd:serenity-cucumber:${SERENITY_CUCUMBER_VER}"
}
在我添加closure-compiler
作为子项目之一的依赖项之前,所有这些工作都很好,这会导致运行时错误:
1) Error injecting constructor, java.lang.NoSuchMethodError: com.google.gson.Gson.<init>(Lcom/google/gson/internal/Excluder;Lcom/google/gson/FieldNamingStrategy;Ljava/util/Map;ZZZZZZZLcom/google/gson/LongSerializationPolicy;Ljava/lang/String;IILjava/util/List;Ljava/util/List;Ljava/util/List;)V
at net.thucydides.core.reports.json.gson.GsonJSONConverter.<init>(GsonJSONConverter.java:38)
while locating net.thucydides.core.reports.json.gson.GsonJSONConverter
at net.thucydides.core.guice.ThucydidesModule.configure(ThucydidesModule.java:56)
while locating net.thucydides.core.reports.json.JSONConverter
at net.serenitybdd.core.history.FileSystemTestOutcomeSummaryRecorder.<init>(FileSystemTestOutcomeSummaryRecorder.java:42)
while locating net.serenitybdd.core.history.FileSystemTestOutcomeSummaryRecorder
at net.thucydides.core.guice.ThucydidesModule.configure(ThucydidesModule.java:72)
while locating net.serenitybdd.core.history.TestOutcomeSummaryRecorder
for the 2nd parameter of net.serenitybdd.core.history.HistoricalFlagProvider.<init>(HistoricalFlagProvider.java:28)
while locating net.serenitybdd.core.history.HistoricalFlagProvider
at net.thucydides.core.guice.ThucydidesModule.configure(ThucydidesModule.java:71)
while locating net.thucydides.core.model.flags.FlagProvider
我相信这是由于如下文的依赖性报告中所示限制了gson版本。如果能以某种方式分离这些类路径,以便它们都可以使用其内部传递依赖关系而没有问题,那将是理想的选择,但是由于我的设置异常,或者如果有可能,我不确定如何进行处理。我是否需要定义一些约束条件,使用平台,将构建解耦或完全其他?
除了有效的解决方案外,您所能提供的任何见解都将不胜感激。
简要相关性报告
runtimeClasspath - Runtime classpath of source set 'main'.
+--- project :waweb.site.plugin
| \--- org.codehaus.groovy:groovy-all:2.5.8
[SNIP GROOVY DEPS...]
+--- project :waweb.site.plugin.js
| +--- org.codehaus.groovy:groovy-all:2.5.8 (*)
| +--- com.google.javascript:closure-compiler:v20191111
| | +--- com.google.javascript:closure-compiler-externs:v20191111
| | +--- args4j:args4j:2.0.26
| | +--- com.google.errorprone:error_prone_annotations:2.3.1
| | +--- com.google.guava:guava:25.1-jre
| | | +--- com.google.code.findbugs:jsr305:3.0.2
| | | +--- org.checkerframework:checker-qual:2.0.0
| | | +--- com.google.errorprone:error_prone_annotations:2.1.3 -> 2.3.1
| | | +--- com.google.j2objc:j2objc-annotations:1.1
| | | \--- org.codehaus.mojo:animal-sniffer-annotations:1.14
| | +--- com.google.protobuf:protobuf-java:3.0.2
| | +--- com.google.code.gson:gson:2.7
| | +--- com.google.code.findbugs:jsr305:3.0.1 -> 3.0.2
| | +--- com.google.jsinterop:jsinterop-annotations:1.0.2
| | +--- com.google.jsinterop:base:1.0.0
| | | \--- com.google.jsinterop:jsinterop-annotations:1.0.2
| | +--- com.google.elemental2:elemental2-core:1.0.0-RC1
| | | +--- com.google.jsinterop:jsinterop-annotations:1.0.2
| | | \--- com.google.jsinterop:base:1.0.0-RC1 -> 1.0.0 (*)
| | \--- com.google.re2j:re2j:1.3
| \--- project :waweb.site.plugin (*)
testCompileClasspath - Compile classpath for source set 'test'.
+--- project :waweb.site.plugin
+--- project :waweb.site.plugin.js
+--- project :waweb.site.plugin.sass
+--- project :waweb.site.plugin.template
+--- project :waweb.site.plugin.war
+--- junit:junit:4.12
| \--- org.hamcrest:hamcrest-core:1.3
+--- org.assertj:assertj-core:3.14.0
+--- org.hamcrest:hamcrest:2.2
+--- net.serenity-bdd:serenity-core:2.0.90
| +--- net.bytebuddy:byte-buddy:1.10.1
| +--- net.bytebuddy:byte-buddy-agent:1.10.1
| +--- com.google.guava:guava:25.0-jre
| | +--- com.google.code.findbugs:jsr305:1.3.9
| | +--- org.checkerframework:checker-compat-qual:2.0.0
| | +--- com.google.errorprone:error_prone_annotations:2.1.3
| | +--- com.google.j2objc:j2objc-annotations:1.1
| | \--- org.codehaus.mojo:animal-sniffer-annotations:1.14
| +--- com.google.inject:guice:4.2.2
| | +--- javax.inject:javax.inject:1
| | \--- aopalliance:aopalliance:1.0
| +--- org.ow2.asm:asm:7.2
| +--- commons-codec:commons-codec:1.10
| +--- org.objenesis:objenesis:3.0.1
| +--- org.slf4j:slf4j-api:1.7.26
| +--- xml-apis:xml-apis:1.4.01
| +--- io.cucumber:cucumber-core:2.4.0
| | +--- info.cukes:cucumber-html:0.2.6
| | +--- io.cucumber:cucumber-jvm-deps:1.0.6
| | +--- io.cucumber:gherkin:5.0.0
| | \--- io.cucumber:tag-expressions:1.1.1
| +--- commons-logging:commons-logging:1.2
| +--- io.vavr:vavr:0.9.0
| | \--- io.vavr:vavr-match:0.9.0
| +--- javax.xml.bind:jaxb-api:2.2.12
| +--- com.sun.xml.bind:jaxb-core:2.3.0.1
| +--- com.sun.xml.bind:jaxb-impl:2.3.0.1
| +--- javax.activation:activation:1.1.1
| +--- org.mockito:mockito-core:3.1.0
| +--- net.serenity-bdd:serenity-report-resources:2.0.90
| | +--- net.bytebuddy:byte-buddy:1.10.1
| | +--- net.bytebuddy:byte-buddy-agent:1.10.1
| | +--- com.google.guava:guava:25.0-jre (*)
| | +--- com.google.inject:guice:4.2.2 (*)
| | +--- org.ow2.asm:asm:7.2
| | +--- commons-codec:commons-codec:1.10
| | +--- org.objenesis:objenesis:3.0.1
| | +--- org.slf4j:slf4j-api:1.7.26
| | +--- xml-apis:xml-apis:1.4.01
| | +--- io.cucumber:cucumber-core:2.4.0 (*)
| | +--- commons-logging:commons-logging:1.2
| | +--- io.vavr:vavr:0.9.0 (*)
| | +--- javax.xml.bind:jaxb-api:2.2.12
| | +--- com.sun.xml.bind:jaxb-core:2.3.0.1
| | +--- com.sun.xml.bind:jaxb-impl:2.3.0.1
| | +--- javax.activation:activation:1.1.1
| | \--- org.mockito:mockito-core:3.1.0
| +--- net.serenity-bdd:serenity-model:2.0.90
| | +--- net.bytebuddy:byte-buddy:1.10.1
| | +--- net.bytebuddy:byte-buddy-agent:1.10.1
| | +--- com.google.guava:guava:25.0-jre (*)
| | +--- com.google.inject:guice:4.2.2 (*)
| | +--- org.ow2.asm:asm:7.2
| | +--- commons-codec:commons-codec:1.10
| | +--- org.objenesis:objenesis:3.0.1
| | +--- org.slf4j:slf4j-api:1.7.26
| | +--- xml-apis:xml-apis:1.4.01
| | +--- io.cucumber:cucumber-core:2.4.0 (*)
| | +--- commons-logging:commons-logging:1.2
| | +--- io.vavr:vavr:0.9.0 (*)
| | +--- javax.xml.bind:jaxb-api:2.2.12
| | +--- com.sun.xml.bind:jaxb-core:2.3.0.1
| | +--- com.sun.xml.bind:jaxb-impl:2.3.0.1
| | +--- javax.activation:activation:1.1.1
| | +--- org.mockito:mockito-core:3.1.0
| | +--- net.serenity-bdd:serenity-report-resources:2.0.90 (*)
| | +--- org.apache.commons:commons-lang3:3.8.1
| | +--- commons-net:commons-net:3.6
| | +--- com.typesafe:config:1.3.1
| | +--- org.jsoup:jsoup:1.10.3
| | +--- joda-time:joda-time:2.7
| | +--- commons-collections:commons-collections:3.2.2
| | +--- commons-io:commons-io:2.6
| | +--- org.apache.commons:commons-text:1.6 -> 1.7
| | +--- commons-beanutils:commons-beanutils-core:1.8.3
| | +--- net.sf.opencsv:opencsv:2.0
| | +--- com.google.code.gson:gson:2.8.4
| | +--- org.imgscalr:imgscalr-lib:4.2
| | +--- com.thoughtworks.xstream:xstream:1.4.9
| | | +--- xmlpull:xmlpull:1.1.3.1
| | | \--- xpp3:xpp3_min:1.1.4c
| | +--- org.codehaus.groovy:groovy:2.5.5
| | +--- net.sourceforge.jexcelapi:jxl:2.6.12
| | +--- org.awaitility:awaitility:4.0.1
| | | \--- org.hamcrest:hamcrest:2.1 -> 2.2
| | +--- org.asciidoctor:asciidoctorj:1.5.6
| | +--- org.freemarker:freemarker:2.3.28
| | +--- com.vladsch.flexmark:flexmark-all:0.34.30
[SNIP FLEXMARK DEPS...]
| | \--- es.nitaur.markdown:txtmark:0.16
| +--- net.serenity-bdd:serenity-reports:2.0.90
| | +--- net.bytebuddy:byte-buddy:1.10.1
| | +--- net.bytebuddy:byte-buddy-agent:1.10.1
| | +--- com.google.guava:guava:25.0-jre (*)
| | +--- com.google.inject:guice:4.2.2 (*)
| | +--- org.ow2.asm:asm:7.2
| | +--- commons-codec:commons-codec:1.10
| | +--- org.objenesis:objenesis:3.0.1
| | +--- org.slf4j:slf4j-api:1.7.26
| | +--- xml-apis:xml-apis:1.4.01
| | +--- io.cucumber:cucumber-core:2.4.0 (*)
| | +--- commons-logging:commons-logging:1.2
| | +--- io.vavr:vavr:0.9.0 (*)
| | +--- javax.xml.bind:jaxb-api:2.2.12
| | +--- com.sun.xml.bind:jaxb-core:2.3.0.1
| | +--- com.sun.xml.bind:jaxb-impl:2.3.0.1
| | +--- javax.activation:activation:1.1.1
| | +--- org.mockito:mockito-core:3.1.0
| | +--- net.serenity-bdd:serenity-model:2.0.90 (*)
| | \--- net.serenity-bdd:serenity-stats:2.0.90
| | +--- net.bytebuddy:byte-buddy:1.10.1
| | +--- net.bytebuddy:byte-buddy-agent:1.10.1
| | +--- com.google.guava:guava:25.0-jre (*)
| | +--- com.google.inject:guice:4.2.2 (*)
| | +--- org.ow2.asm:asm:7.2
| | +--- commons-codec:commons-codec:1.10
| | +--- org.objenesis:objenesis:3.0.1
| | +--- org.slf4j:slf4j-api:1.7.26
| | +--- xml-apis:xml-apis:1.4.01
| | +--- io.cucumber:cucumber-core:2.4.0 (*)
| | +--- commons-logging:commons-logging:1.2
| | +--- io.vavr:vavr:0.9.0 (*)
| | +--- javax.xml.bind:jaxb-api:2.2.12
| | +--- com.sun.xml.bind:jaxb-core:2.3.0.1
| | +--- com.sun.xml.bind:jaxb-impl:2.3.0.1
| | +--- javax.activation:activation:1.1.1
| | +--- org.mockito:mockito-core:3.1.0
| | +--- net.serenity-bdd:serenity-model:2.0.90 (*)
| | \--- org.jetbrains.kotlin:kotlin-stdlib:1.3.31
| | +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.3.31
| | \--- org.jetbrains:annotations:13.0
| +--- com.google.code.gson:gson:2.8.4
| +--- commons-io:commons-io:2.6
| +--- org.seleniumhq.selenium:selenium-server:3.141.59
[SNIP SELENIUM DEPS]
| +--- com.paulhammant:ngwebdriver:1.1.4
| +--- com.codeborne:phantomjsdriver:1.4.4
| +--- org.seleniumhq.selenium:htmlunit-driver:2.36.0
| | \--- net.sourceforge.htmlunit:htmlunit:2.36.0
| | +--- xalan:xalan:2.7.2
| | | \--- xalan:serializer:2.7.2
| | | \--- xml-apis:xml-apis:1.3.04 -> 1.4.01
| | +--- org.apache.commons:commons-text:1.7
| | +--- org.apache.httpcomponents:httpmime:4.5.9
| | | \--- org.apache.httpcomponents:httpclient:4.5.9
| | | +--- org.apache.httpcomponents:httpcore:4.4.11
| | | \--- commons-logging:commons-logging:1.2
| | +--- net.sourceforge.htmlunit:htmlunit-core-js:2.36.0
| | +--- net.sourceforge.htmlunit:neko-htmlunit:2.36.0
| | | \--- xerces:xercesImpl:2.12.0
| | | \--- xml-apis:xml-apis:1.4.01
| | +--- net.sourceforge.htmlunit:htmlunit-cssparser:1.5.0
| | +--- commons-io:commons-io:2.6
| | +--- commons-logging:commons-logging:1.2
| | +--- commons-net:commons-net:3.6
| | +--- org.brotli:dec:0.1.2
| | \--- org.eclipse.jetty.websocket:websocket-client:9.4.20.v20190813
| | +--- org.eclipse.jetty:jetty-client:9.4.20.v20190813
| | | +--- org.eclipse.jetty:jetty-http:9.4.20.v20190813
| | | | +--- org.eclipse.jetty:jetty-util:9.4.20.v20190813
| | | | \--- org.eclipse.jetty:jetty-io:9.4.20.v20190813
| | | | \--- org.eclipse.jetty:jetty-util:9.4.20.v20190813
| | | \--- org.eclipse.jetty:jetty-io:9.4.20.v20190813 (*)
| | +--- org.eclipse.jetty:jetty-xml:9.4.20.v20190813
| | | \--- org.eclipse.jetty:jetty-util:9.4.20.v20190813
| | +--- org.eclipse.jetty:jetty-util:9.4.20.v20190813
| | +--- org.eclipse.jetty:jetty-io:9.4.20.v20190813 (*)
| | \--- org.eclipse.jetty.websocket:websocket-common:9.4.20.v20190813
| | +--- org.eclipse.jetty.websocket:websocket-api:9.4.20.v20190813
| | +--- org.eclipse.jetty:jetty-util:9.4.20.v20190813
| | \--- org.eclipse.jetty:jetty-io:9.4.20.v20190813 (*)
| +--- io.appium:java-client:7.2.0
| | +--- commons-validator:commons-validator:1.6
| | | +--- commons-beanutils:commons-beanutils:1.9.2
| | | | \--- commons-collections:commons-collections:3.2.1 -> 3.2.2
| | | +--- commons-digester:commons-digester:1.8.1
| | | \--- commons-collections:commons-collections:3.2.2
| | +--- org.aspectj:aspectjweaver:1.9.4
| | \--- org.slf4j:slf4j-api:1.7.26
| +--- org.springframework:spring-context-support:5.1.2.RELEASE
| | +--- org.springframework:spring-beans:5.1.2.RELEASE
| | | \--- org.springframework:spring-core:5.1.2.RELEASE
| | | \--- org.springframework:spring-jcl:5.1.2.RELEASE
| | +--- org.springframework:spring-context:5.1.2.RELEASE
| | | +--- org.springframework:spring-aop:5.1.2.RELEASE
| | | | +--- org.springframework:spring-beans:5.1.2.RELEASE (*)
| | | | \--- org.springframework:spring-core:5.1.2.RELEASE (*)
| | | +--- org.springframework:spring-beans:5.1.2.RELEASE (*)
| | | +--- org.springframework:spring-core:5.1.2.RELEASE (*)
| | | \--- org.springframework:spring-expression:5.1.2.RELEASE
| | | \--- org.springframework:spring-core:5.1.2.RELEASE (*)
| | \--- org.springframework:spring-core:5.1.2.RELEASE (*)
| +--- org.codehaus.groovy:groovy:2.5.5
| +--- net.sf.opencsv:opencsv:2.0
| +--- commons-beanutils:commons-beanutils-core:1.8.3
| +--- joda-time:joda-time:2.7
| +--- com.thoughtworks.xstream:xstream:1.4.9 (*)
| +--- org.apache.commons:commons-lang3:3.8.1
| +--- commons-collections:commons-collections:3.2.2
| +--- org.freemarker:freemarker:2.3.28
| +--- net.sourceforge.jexcelapi:jxl:2.6.12
| +--- org.hamcrest:hamcrest-core:1.3
| +--- org.hamcrest:hamcrest-library:1.3
| | \--- org.hamcrest:hamcrest-core:1.3
| +--- net.sourceforge.htmlunit:htmlunit:2.36.0 (*)
| +--- org.apache.httpcomponents:httpclient:4.5.5 -> 4.5.9 (*)
| +--- org.apache.httpcomponents:httpmime:4.5.5 -> 4.5.9 (*)
| +--- org.fluentlenium:fluentlenium-core:0.10.2
| +--- com.jhlabs:filters:2.0.235
| +--- org.asciidoctor:asciidoctorj:1.5.6
| +--- org.imgscalr:imgscalr-lib:4.2
| +--- javax.el:javax.el-api:2.2.4
| +--- org.glassfish.web:javax.el:2.2.4
| | \--- javax.el:javax.el-api:2.2.4
| +--- xalan:xalan:2.7.2 (*)
| +--- xalan:serializer:2.7.2 (*)
| +--- org.awaitility:awaitility:4.0.1 (*)
| +--- com.typesafe:config:1.3.1
| +--- org.jsoup:jsoup:1.10.3
| +--- com.google.jimfs:jimfs:1.1
| \--- com.vladsch.flexmark:flexmark-all:0.34.30 (*)
+--- net.serenity-bdd:serenity-junit:2.0.90
| +--- net.bytebuddy:byte-buddy:1.10.1
| +--- net.bytebuddy:byte-buddy-agent:1.10.1
| +--- com.google.guava:guava:25.0-jre (*)
| +--- com.google.inject:guice:4.2.2 (*)
| +--- org.ow2.asm:asm:7.2
| +--- commons-codec:commons-codec:1.10
| +--- org.objenesis:objenesis:3.0.1
| +--- org.slf4j:slf4j-api:1.7.26
| +--- xml-apis:xml-apis:1.4.01
| +--- io.cucumber:cucumber-core:2.4.0 (*)
| +--- commons-logging:commons-logging:1.2
| +--- io.vavr:vavr:0.9.0 (*)
| +--- javax.xml.bind:jaxb-api:2.2.12
| +--- com.sun.xml.bind:jaxb-core:2.3.0.1
| +--- com.sun.xml.bind:jaxb-impl:2.3.0.1
| +--- javax.activation:activation:1.1.1
| +--- org.mockito:mockito-core:3.1.0
| +--- net.serenity-bdd:serenity-model:2.0.90 (*)
| +--- net.serenity-bdd:serenity-core:2.0.90 (*)
| +--- junit:junit:4.12 (*)
| \--- org.hamcrest:hamcrest-core:1.3
\--- net.serenity-bdd:serenity-cucumber:1.9.49
+--- net.serenity-bdd:serenity-core:2.0.90 (*)
+--- net.serenity-bdd:serenity-screenplay:2.0.90
| +--- net.bytebuddy:byte-buddy:1.10.1
| +--- net.bytebuddy:byte-buddy-agent:1.10.1
| +--- com.google.guava:guava:25.0-jre (*)
| +--- com.google.inject:guice:4.2.2 (*)
| +--- org.ow2.asm:asm:7.2
| +--- commons-codec:commons-codec:1.10
| +--- org.objenesis:objenesis:3.0.1
| +--- org.slf4j:slf4j-api:1.7.26
| +--- xml-apis:xml-apis:1.4.01
| +--- io.cucumber:cucumber-core:2.4.0 (*)
| +--- commons-logging:commons-logging:1.2
| +--- io.vavr:vavr:0.9.0 (*)
| +--- javax.xml.bind:jaxb-api:2.2.12
| +--- com.sun.xml.bind:jaxb-core:2.3.0.1
| +--- com.sun.xml.bind:jaxb-impl:2.3.0.1
| +--- javax.activation:activation:1.1.1
| +--- org.mockito:mockito-core:3.1.0
| \--- net.serenity-bdd:serenity-core:2.0.90 (*)
+--- net.serenity-bdd:serenity-screenplay-webdriver:2.0.90
| +--- net.bytebuddy:byte-buddy:1.10.1
| +--- net.bytebuddy:byte-buddy-agent:1.10.1
| +--- com.google.guava:guava:25.0-jre (*)
| +--- com.google.inject:guice:4.2.2 (*)
| +--- org.ow2.asm:asm:7.2
| +--- commons-codec:commons-codec:1.10
| +--- org.objenesis:objenesis:3.0.1
| +--- org.slf4j:slf4j-api:1.7.26
| +--- xml-apis:xml-apis:1.4.01
| +--- io.cucumber:cucumber-core:2.4.0 (*)
| +--- commons-logging:commons-logging:1.2
| +--- io.vavr:vavr:0.9.0 (*)
| +--- javax.xml.bind:jaxb-api:2.2.12
| +--- com.sun.xml.bind:jaxb-core:2.3.0.1
| +--- com.sun.xml.bind:jaxb-impl:2.3.0.1
| +--- javax.activation:activation:1.1.1
| +--- org.mockito:mockito-core:3.1.0
| +--- net.serenity-bdd:serenity-core:2.0.90 (*)
| \--- net.serenity-bdd:serenity-screenplay:2.0.90 (*)
+--- io.cucumber:cucumber-java:2.4.0
| \--- io.cucumber:cucumber-core:2.4.0 (*)
+--- io.cucumber:cucumber-junit:2.4.0
| \--- io.cucumber:cucumber-core:2.4.0 (*)
+--- commons-logging:commons-logging:1.2
+--- org.apache.commons:commons-csv:1.5
+--- junit:junit:4.12 (*)
\--- com.google.code.gson:gson:2.8.4
答案 0 :(得分:0)
我真的应该等24小时后再发布,因为当我想到其他事情时,答案总是会随机出现在我的脑海中。
解决方案:
configurations {
pluginsUnderTest
}
task pluginUnderTestMetadata {
def outputDir = file("${buildDir}/pluginUnderTestMetadata")
def runtimeClasspath = configurations.pluginsUnderTest
outputs.dir(outputDir)
.withPropertyName("outputDir")
inputs.files(runtimeClasspath)
.withPropertyName("runtimeClasspath")
.withNormalizer(ClasspathNormalizer)
doLast {
outputDir.mkdirs()
file("$outputDir/plugin-classpath.txt").text = runtimeClasspath.join("\n")
}
}
dependencies {
pluginsUnderTest localGroovy(),
gradleApi(),
project(':waweb.site.plugin'),
project(':waweb.site.plugin.js'),
project(':waweb.site.plugin.sass'),
project(':waweb.site.plugin.template'),
project(':waweb.site.plugin.war')
testRuntimeOnly files(pluginUnderTestMetadata)
testImplementation gradleTestKit(),
"junit:junit:${JUNIT_VER}",
"org.assertj:assertj-core:${ASSERTJ_VER}",
"org.hamcrest:hamcrest:${HAMCREST_VER}",
"net.serenity-bdd:serenity-core:${SERENITY_VER}",
"net.serenity-bdd:serenity-junit:${SERENITY_VER}",
"net.serenity-bdd:serenity-cucumber:${SERENITY_CUCUMBER_VER}"
}
希望这对每个人来说至少可以节省一些时间,如果他们希望对各种插件项目配置进行功能测试。