Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"comment": "Modify this file in a trivial way to cause this test suite to run",
"modification": 1
"modification": 2
}
13 changes: 13 additions & 0 deletions sdks/java/testing/nexmark/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,19 @@ if (isSparkRunner) {
}
}

// Flink 2.1+ uses at.yawk.lz4:lz4-java instead of org.lz4:lz4-java
// Explicitly prefer Flink's at.yawk.lz4 version to resolve capability conflict
configurations.gradleRun {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix. Since this chunk of code needs to be repeated in a few place, can we generalize it into BeamModulePlugin, see comments

#39049 (comment)

I'm preparing a PR to fix all of these

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened #39061

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to generalize it in BeamModulePlugin instead of copying it in each build.gradle

resolutionStrategy.capabilitiesResolution.withCapability('org.lz4:lz4-java') {
def candidate = candidates.find { it.id.toString().contains('at.yawk.lz4') }
if (candidate != null) {
select(candidate)
} else {
selectHighestVersion()
}
}
}
Comment on lines +104 to +113

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Configuring the capability resolution strategy only on configurations.gradleRun might leave other configurations (such as runtimeClasspath or testRuntimeClasspath) vulnerable to the same capability conflict during other tasks (e.g., testing, compiling, or IDE sync). Applying this resolution strategy to configurations.all ensures consistent and robust dependency resolution across all configurations in this module.

configurations.all {
  resolutionStrategy.capabilitiesResolution.withCapability('org.lz4:lz4-java') {
    def candidate = candidates.find { it.id.toString().contains('at.yawk.lz4') }
    if (candidate != null) {
      select(candidate)
    } else {
      selectHighestVersion()
    }
  }
}


def getNexmarkArgs = {
def nexmarkArgsStr = project.findProperty(nexmarkArgsProperty) ?: ""
def nexmarkArgsList = new ArrayList<String>()
Expand Down
Loading