- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在 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
最佳答案
我真的应该等 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}"
}
希望如果任何人希望对插件项目的各种配置进行功能测试,这至少可以节省一些时间。
关于java - 如何解决 Gradle 中的传递依赖冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59400795/
我正在编写一个具有以下签名的 Java 方法。 void Logger(Method method, Object[] args); 如果一个方法(例如 ABC() )调用此方法 Logger,它应该
我是 Java 新手。 我的问题是我的 Java 程序找不到我试图用作的图像文件一个 JButton。 (目前这段代码什么也没做,因为我只是得到了想要的外观第一的)。这是我的主课 代码: packag
好的,今天我在接受采访,我已经编写 Java 代码多年了。采访中说“Java 垃圾收集是一个棘手的问题,我有几个 friend 一直在努力弄清楚。你在这方面做得怎么样?”。她是想骗我吗?还是我的一生都
我的 friend 给了我一个谜语让我解开。它是这样的: There are 100 people. Each one of them, in his turn, does the following
如果我将使用 Java 5 代码的应用程序编译成字节码,生成的 .class 文件是否能够在 Java 1.4 下运行? 如果后者可以工作并且我正在尝试在我的 Java 1.4 应用程序中使用 Jav
有关于why Java doesn't support unsigned types的问题以及一些关于处理无符号类型的问题。我做了一些搜索,似乎 Scala 也不支持无符号数据类型。限制是Java和S
我只是想知道在一个 java 版本中生成的字节码是否可以在其他 java 版本上运行 最佳答案 通常,字节码无需修改即可在 较新 版本的 Java 上运行。它不会在旧版本上运行,除非您使用特殊参数 (
我有一个关于在命令提示符下执行 java 程序的基本问题。 在某些机器上我们需要指定 -cp 。 (类路径)同时执行java程序 (test为java文件名与.class文件存在于同一目录下) jav
我已经阅读 StackOverflow 有一段时间了,现在我才鼓起勇气提出问题。我今年 20 岁,目前在我的家乡(罗马尼亚克卢日-纳波卡)就读 IT 大学。足以介绍:D。 基本上,我有一家提供簿记应用
我有 public JSONObject parseXML(String xml) { JSONObject jsonObject = XML.toJSONObject(xml); r
我已经在 Java 中实现了带有动态类型的简单解释语言。不幸的是我遇到了以下问题。测试时如下代码: def main() { def ks = Map[[1, 2]].keySet()
一直提示输入 1 到 10 的数字 - 结果应将 st、rd、th 和 nd 添加到数字中。编写一个程序,提示用户输入 1 到 10 之间的任意整数,然后以序数形式显示该整数并附加后缀。 public
我有这个 DownloadFile.java 并按预期下载该文件: import java.io.*; import java.net.URL; public class DownloadFile {
我想在 GUI 上添加延迟。我放置了 2 个 for 循环,然后重新绘制了一个标签,但这 2 个 for 循环一个接一个地执行,并且标签被重新绘制到最后一个。 我能做什么? for(int i=0;
我正在对对象 Student 的列表项进行一些测试,但是我更喜欢在 java 类对象中创建硬编码列表,然后从那里提取数据,而不是连接到数据库并在结果集中选择记录。然而,自从我这样做以来已经很长时间了,
我知道对象创建分为三个部分: 声明 实例化 初始化 classA{} classB extends classA{} classA obj = new classB(1,1); 实例化 它必须使用
我有兴趣使用 GPRS 构建车辆跟踪系统。但是,我有一些问题要问以前做过此操作的人: GPRS 是最好的技术吗?人们意识到任何问题吗? 我计划使用 Java/Java EE - 有更好的技术吗? 如果
我可以通过递归方法反转数组,例如:数组={1,2,3,4,5} 数组结果={5,4,3,2,1}但我的结果是相同的数组,我不知道为什么,请帮助我。 public class Recursion { p
有这样的标准方式吗? 包括 Java源代码-测试代码- Ant 或 Maven联合单元持续集成(可能是巡航控制)ClearCase 版本控制工具部署到应用服务器 最后我希望有一个自动构建和集成环境。
我什至不知道这是否可能,我非常怀疑它是否可能,但如果可以,您能告诉我怎么做吗?我只是想知道如何从打印机打印一些文本。 有什么想法吗? 最佳答案 这里有更简单的事情。 import javax.swin
我是一名优秀的程序员,十分优秀!