Skip to content
Open
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
6 changes: 3 additions & 3 deletions .github/workflows/docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ set -e
export JAVA_HOME=$JAVA_HOME_17_X64
export PATH=$JAVA_HOME_17_X64/bin:$PATH

mvn --version
./mvnw --version
java -version
javadoc -J-version

Expand Down Expand Up @@ -62,11 +62,11 @@ ErrorDocument 404 /flink/flink-docs-${BRANCH}/404.html
EOF

# build Flink; required for Javadoc step
mvn clean install -B -DskipTests -Dfast -Dskip.npm -Pskip-webui-build
./mvnw clean install -B -DskipTests -Dfast -Dskip.npm -Pskip-webui-build

# build java/scala docs
mkdir -p docs/target/api
mvn javadoc:aggregate -B \
./mvnw javadoc:aggregate -B \
-Pskip-webui-build \
-Dmaven.javadoc.failOnError=true \
-Dcheckstyle.skip=true \
Expand Down
8 changes: 4 additions & 4 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# under the License.

# updating the Maven version requires updates to certain documentation and verification logic
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.6/apache-maven-3.8.6-bin.zip
distributionSha256Sum=ccf20a80e75a17ffc34d47c5c95c98c39d426ca17d670f09cd91e877072a9309
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar
wrapperSha256Sum=3d8f20ce6103913be8b52aef6d994e0c54705fb527324ceb9b835b338739c7a8
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.16/apache-maven-3.9.16-bin.zip
distributionSha256Sum=5af3b743dd8b876b5c45da33b676251e5f1687712644abb4ee519ca56e1d89ce
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.4/maven-wrapper-3.3.4.jar
wrapperSha256Sum=4e2fbf6554bc8a4702cdfdd3bef464f423393d784ddbb037216320ce55d5e4e1
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ This file provides guidance for AI coding agents working with the Apache Flink c
## Prerequisites

- Java 11, 17 (default), or 21. Java 11 syntax must be used in all modules. Java 17 syntax (records, sealed classes, pattern matching) is only permitted in the `flink-tests-java17` module.
- Maven 3.8.6 (Maven wrapper `./mvnw` included; prefer it)
- Maven 3.9.16 (Maven wrapper `./mvnw` included; prefer it)
- Git
- Unix-like environment (Linux, macOS, WSL, Cygwin)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Prerequisites for building Flink:

* Unix-like environment (we use Linux, Mac OS X, Cygwin, WSL)
* Git
* Maven (we require version 3.8.6)
* Maven (we require version 3.9.16)
* Java (version 11, 17, or 21)

### Basic Build Instructions
Expand Down
2 changes: 1 addition & 1 deletion docs/content.zh/docs/dev/configuration/maven.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ under the License.

## 要求

- Maven 3.8.6
- Maven 3.9.16
- Java 11

## 将项目导入 IDE
Expand Down
2 changes: 1 addition & 1 deletion docs/content/docs/dev/configuration/maven.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ publish, and deploy projects. You can use it to manage the entire lifecycle of y

## Requirements

- Maven 3.8.6
- Maven 3.9.16
- Java 11

## Importing the project into your IDE
Expand Down
30 changes: 18 additions & 12 deletions mvnw

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions mvnw.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1879,7 +1879,7 @@ under the License.
<configuration>
<rules>
<requireMavenVersion>
<version>[3.8.6]</version>
<version>[3.9.16]</version>
</requireMavenVersion>
<requireJavaVersion>
<version>${target.java.version}</version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ public class ScalaSuffixChecker {
private static final Logger LOG = LoggerFactory.getLogger(ScalaSuffixChecker.class);

// [INFO] --- maven-dependency-plugin:3.1.1:tree (default-cli) @ flink-annotations ---
// [INFO] --- dependency:3.1.1:tree (default-cli) @ flink-annotations ---
// Maven logs the plugin as "maven-dependency-plugin" up to 3.8 and as "dependency" (the goal
// prefix) from 3.9 on; both spellings are accepted so the parser works on either Maven version.
private static final Pattern moduleNamePattern =
Pattern.compile(".* --- maven-dependency-plugin.* @ (.*) ---.*");
Pattern.compile(".* --- (?:maven-)?dependency(?:-plugin)?:.* @ (.*) ---.*");

// [INFO] +- junit:junit:jar:4.13.2:test
// [INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,21 @@
/** Parsing utils for the Maven dependency plugin. */
public class DependencyParser {

// Maven logs the plugin as "maven-dependency-plugin" up to 3.8 and as "dependency" (the goal
// prefix) from 3.9 on; both spellings are accepted so the parsers work on either Maven version.
private static final String DEPENDENCY_PLUGIN = "(?:maven-)?dependency(?:-plugin)?";

private static final Pattern DEPENDENCY_COPY_NEXT_MODULE_PATTERN =
Pattern.compile(
".*maven-dependency-plugin:[^:]+:copy .* @ (?<module>[^ _]+)(?:_[0-9.]+)? --.*");
".*"
+ DEPENDENCY_PLUGIN
+ ":[^:]+:copy .* @ (?<module>[^ _]+)(?:_[0-9.]+)? --.*");

private static final Pattern DEPENDENCY_TREE_NEXT_MODULE_PATTERN =
Pattern.compile(
".*maven-dependency-plugin:[^:]+:tree .* @ (?<module>[^ _]+)(?:_[0-9.]+)? --.*");
".*"
+ DEPENDENCY_PLUGIN
+ ":[^:]+:tree .* @ (?<module>[^ _]+)(?:_[0-9.]+)? --.*");

/** See {@link DependencyParserTreeTest} for examples. */
private static final Pattern DEPENDENCY_TREE_ITEM_PATTERN =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ public class DeployParser {
// Skipped deployment:
// [INFO] --- maven-deploy-plugin:2.8.2:deploy (default-deploy) @ flink-parent ---
// [INFO] Skipping artifact deployment
// Maven logs the plugin as "maven-deploy-plugin" up to 3.8 and as "deploy" (the goal prefix)
// from 3.9 on; both spellings are accepted so the parser works on either Maven version.
private static final Pattern DEPLOY_MODULE_PATTERN =
Pattern.compile(
".maven-deploy-plugin:.*:deploy .* @ (?<module>[^ _]+)(?:_[0-9.]+)? --.*");
".*(?:maven-)?deploy(?:-plugin)?:.*:deploy .* @ (?<module>[^ _]+)(?:_[0-9.]+)? --.*");

/**
* Parses the output of a Maven build where {@code deploy:deploy} was used, and returns a set of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,20 @@ private static Stream<String> getTestDependencyCopy() {

@Test
void testCopyParsing() {
assertCopyParsing(getTestDependencyCopy());
}

/** Maven 3.9+ logs plugins by their goal prefix instead of their artifactId. */
@Test
void testCopyParsingWithGoalPrefixedPluginName() {
assertCopyParsing(
getTestDependencyCopy()
.map(line -> line.replace("maven-dependency-plugin:", "dependency:")));
}

private static void assertCopyParsing(Stream<String> lines) {
final Map<String, Set<Dependency>> dependenciesByModule =
DependencyParser.parseDependencyCopyOutput(getTestDependencyCopy());
DependencyParser.parseDependencyCopyOutput(lines);

assertThat(dependenciesByModule).containsOnlyKeys("m1", "m2");
assertThat(dependenciesByModule.get("m1"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,20 @@ private static Stream<String> getTestDependencyTree() {

@Test
void testTreeParsing() {
assertTreeParsing(getTestDependencyTree());
}

/** Maven 3.9+ logs plugins by their goal prefix instead of their artifactId. */
@Test
void testTreeParsingWithGoalPrefixedPluginName() {
assertTreeParsing(
getTestDependencyTree()
.map(line -> line.replace("maven-dependency-plugin:", "dependency:")));
}

private static void assertTreeParsing(Stream<String> lines) {
final Map<String, DependencyTree> dependenciesByModule =
DependencyParser.parseDependencyTreeOutput(getTestDependencyTree());
DependencyParser.parseDependencyTreeOutput(lines);

assertThat(dependenciesByModule).containsOnlyKeys("m1", "m2");
assertThat(dependenciesByModule.get("m1").flatten())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ void testParseDeployOutputDetectsDeployment() {
.containsExactly("flink-parent");
}

/** Maven 3.9+ logs plugins by their goal prefix instead of their artifactId. */
@Test
void testParseDeployOutputDetectsDeploymentWithGoalPrefixedPluginName() {
assertThat(
DeployParser.parseDeployOutput(
Stream.of(
"[INFO] --- deploy:2.8.2:deploy (default-deploy) @ flink-parent ---",
"[INFO] ")))
.containsExactly("flink-parent");
}

@Test
void testParseDeployOutputDetectsDeploymentWithAltRepository() {
assertThat(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,19 @@ private static Stream<String> getTestDependencyCopy() {

@Test
void testParsing() {
assertParsing(getTestDependencyCopy());
}

/** Maven 3.9+ logs plugins by their goal prefix instead of their artifactId. */
@Test
void testParsingWithGoalPrefixedPluginName() {
assertParsing(
getTestDependencyCopy().map(line -> line.replace("maven-shade-plugin:", "shade:")));
}

private static void assertParsing(Stream<String> lines) {
final Map<String, Set<Dependency>> dependenciesByModule =
ShadeParser.parseShadeOutput(getTestDependencyCopy());
ShadeParser.parseShadeOutput(lines);

assertThat(dependenciesByModule).containsOnlyKeys("m1", "m2");
assertThat(dependenciesByModule.get("m1"))
Expand Down