[ https://issues.apache.org/jira/browse/BEAM-9542?focusedWorklogId=406557&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-406557 ]
ASF GitHub Bot logged work on BEAM-9542: ---------------------------------------- Author: ASF GitHub Bot Created on: 19/Mar/20 20:34 Start Date: 19/Mar/20 20:34 Worklog Time Spent: 10m Work Description: lukecwik commented on pull request #11168: [BEAM-9542] Limit and clarify the effect of "force" in Java build URL: https://github.com/apache/beam/pull/11168#discussion_r395302802 ########## File path: buildSrc/src/main/groovy/org/apache/beam/gradle/BeamModulePlugin.groovy ########## @@ -1258,23 +1258,20 @@ class BeamModulePlugin implements Plugin<Project> { exclude group: "org.hamcrest", module: "hamcrest-all" } - // Force usage of the libraries defined within our common set found in the root + // For tests, force usage of the libraries defined within our common set found in the root // build.gradle instead of using Gradles default dependency resolution mechanism // which chooses the latest version available. // // TODO: Figure out whether we should force all dependency conflict resolution - // to occur in the "shadow" and "shadowTest" configurations. + // to occur in the "shadowTest" configurations. project.configurations.all { config -> - // When running beam_Dependency_Check, resolutionStrategy should not be used; otherwise - // gradle-versions-plugin does not report the latest versions of the dependencies. - def startTasks = project.gradle.startParameter.taskNames - def inDependencyUpdates = 'dependencyUpdates' in startTasks || 'runBeamDependencyCheck' in startTasks - - // The "errorprone" configuration controls the classpath used by errorprone static analysis, which - // has different dependencies than our project. - if (config.getName() != "errorprone" && !inDependencyUpdates) { + String configName = config.getName() + if (configName.toLowerCase().contains('test')) { config.resolutionStrategy { - force project.library.java.values() + force project.library.java.junit, + project.library.java.hamcrest_core, + project.library.java.guava, // sdks:java:io:google-cloud-platform needs this Review comment: If its only needed in these projects, does it make sense to apply force rule there? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 406557) Time Spent: 1h 40m (was: 1.5h) > Where the BeamModulePlugin's force is needed? > --------------------------------------------- > > Key: BEAM-9542 > URL: https://issues.apache.org/jira/browse/BEAM-9542 > Project: Beam > Issue Type: Task > Components: build-system > Reporter: Tomo Suzuki > Assignee: Tomo Suzuki > Priority: Major > Time Spent: 1h 40m > Remaining Estimate: 0h > > Followup of https://github.com/apache/beam/pull/11156#discussion_r394408735 > {noformat} > > Task :sdks:java:core:compileTestJava FAILED > /Users/suztomo/beam/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/DeduplicateTest.java:21: > error: cannot find symbol > import static org.junit.Assert.assertThrows; > ^ > symbol: static assertThrows > location: class > /Users/suztomo/beam/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/splittabledofn/WatermarkEstimatorsTest.java:21: > error: cannot find symbol > import static org.junit.Assert.assertThrows; > ^ > symbol: static assertThrows > location: class > Note: Some input files use or override a deprecated API. > Note: Recompile with -Xlint:deprecation for details. > 2 errors > <====---------> 36% EXECUTING [19m 37s] > {noformat} > Memo for my Mac: > {noformat} > suztomo-macbookpro44% ./gradlew -p sdks/java check -x > extensions:sql:zetasql:check -x harness:test -x io:jdbc:test -x > io:kafka:test -x io:solr:test -x core:test > {noformat} -- This message was sent by Atlassian Jira (v8.3.4#803005)