geode-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kirk Lund <kl...@apache.org>
Subject Need gradle help
Date Fri, 14 Sep 2018 23:10:21 GMT
Log4j2 publishes a test jar for log4j-core. The jar includes useful things
like LoggerContextRule.

This blog post shows how to add the dependency for testing to maven:
https://relentlesscoding.com/2018/04/21/unit-test-log4j2-log-output/

This results look like this:

<dependency>
    <groupId>org.apache.logging.log4j</groupId>
    <artifactId>log4j-core</artifactId>
    <version>2.11.0</version>
    <type>test-jar</type>
</dependency>

And these various stackoverflow questions talk about using Gradle's "
classifier" instead of "type":
*
https://stackoverflow.com/questions/20224260/how-do-i-pull-maven-test-jars-using-gradle
*
https://stackoverflow.com/questions/13188438/how-to-specify-a-classifier-in-a-gradle-dependencys-dependency

This gradle man page discusses the "classifier" further:
*
https://docs.gradle.org/current/userguide/declaring_dependencies.html#sub:resolve_specific_artifacts_from_dependency

I've tried adding:

+  compile 'org.apache.logging.log4j:log4j-core:' + project.'log4j.version'
+ 'test-jar'

+  testCompile 'org.apache.logging.log4j:log4j-core:' +
project.'log4j.version' + 'test-jar'

+  integrationTestCompile 'org.apache.logging.log4j:log4j-core:' +
project.'log4j.version' + 'test-jar'

...too geode-core/build.gradle. The result builds but if I then try to use
any classes from the test jar I have no luck. If I check Project Structure
in IntelliJ after making sure that my project re synced from gradle, sure
enough the test jar is still missing from the dependencies.

According to Gradle and SO, this should work. Is the problem our gradle
mess? Does anyone know how to get this working in the Geode gradle build?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message