Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-6753

Use of mavenLocal in gradle may cause build to fail with missing tests dependencies

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: build
    • Labels:
      None

      Description

      This reproduces easily for me with:

      $ ./gradlew build -x test -x javadoc -x pmdMain
      

      I'm not sure why this doesn't reproduce consistently for everyone, but it seems to be caused by working on multiple software projects that use both gradle and maven. If I delete my .m2 directory or remove the mavenLocal line from geode/build.gradle then the build completes without failure.

      If I then use maven to build any project that depends on jetty-http or log4j-core, then my .m2 directory is recreated and the problem reproduces until I remove mavenLocal or delete my .m2 directory.

      In my case, it seems to be specific to tests dependencies: jetty-http:tests and log4j-core:tests.

      Based on feedback from gradle developers regarding this type of problem, I believe we should remove mavenLocal use from Geode's gradle build: https://discuss.gradle.org/t/gradle-fails-to-download-dependencies-if-not-present-in-mavenlocal/2532/16

      1: Task failed with an exception.
      -----------
      * What went wrong:
      Execution failed for task ':extensions:geode-modules-session:compileIntegrationTestJava'.
      > Could not resolve all files for configuration ':extensions:geode-modules-session:integrationTestCompileClasspath'.
         > Could not find jetty-http-tests.jar (org.eclipse.jetty:jetty-http:9.4.12.v20180830).
           Searched in the following locations:
               file:/Users/klund/.m2/repository/org/eclipse/jetty/jetty-http/9.4.12.v20180830/jetty-http-9.4.12.v20180830-tests.jar
      
      * 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 ':geode-assembly:compileDistributedTestJava'.
      > Could not resolve all files for configuration ':geode-assembly:distributedTestCompileClasspath'.
         > Could not find log4j-core-tests.jar (org.apache.logging.log4j:log4j-core:2.11.1).
           Searched in the following locations:
               file:/Users/klund/.m2/repository/org/apache/logging/log4j/log4j-core/2.11.1/log4j-core-2.11.1-tests.jar
         > Could not find log4j-core-test-sources.jar (org.apache.logging.log4j:log4j-core:2.11.1).
           Searched in the following locations:
               file:/Users/klund/.m2/repository/org/apache/logging/log4j/log4j-core/2.11.1/log4j-core-2.11.1-test-sources.jar
      
      * 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.
      ==============================================================================
      
      3: Task failed with an exception.
      -----------
      * What went wrong:
      Execution failed for task ':geode-core:compileIntegrationTestJava'.
      > Could not resolve all files for configuration ':geode-core:integrationTestCompileClasspath'.
         > Could not find log4j-core-tests.jar (org.apache.logging.log4j:log4j-core:2.11.1).
           Searched in the following locations:
               file:/Users/klund/.m2/repository/org/apache/logging/log4j/log4j-core/2.11.1/log4j-core-2.11.1-tests.jar
         > Could not find log4j-core-test-sources.jar (org.apache.logging.log4j:log4j-core:2.11.1).
           Searched in the following locations:
               file:/Users/klund/.m2/repository/org/apache/logging/log4j/log4j-core/2.11.1/log4j-core-2.11.1-test-sources.jar
      
      * 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.
      ==============================================================================
      

        Attachments

          Activity

            People

            • Assignee:
              prhomberg Patrick Rhomberg
              Reporter:
              klund Kirk Lund
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: