Skip to content

WIP Test Maven 4 #51230

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
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: 6 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1357,3 +1357,9 @@ jobs:
cd ui-test
npm install --save-dev
node --experimental-vm-modules node_modules/.bin/jest

maven-test:
permissions:
packages: write
name: Run
uses: ./.github/workflows/maven_test.yml
24 changes: 24 additions & 0 deletions .mvn/extensions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<extensions>
<extension>
<groupId>eu.maveniverse.maven.nisse</groupId>
<artifactId>extension</artifactId>
<version>0.4.6</version>
</extension>
</extensions>
1 change: 1 addition & 0 deletions .mvn/maven.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-Dnisse.compat.osDetector
2 changes: 1 addition & 1 deletion build/mvn
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ install_mvn() {
fi
if [ $(version $MVN_DETECTED_VERSION) -ne $(version $MVN_VERSION) ]; then
local MVN_TARBALL="apache-maven-${MVN_VERSION}-bin.tar.gz"
local FILE_PATH="maven/maven-3/${MVN_VERSION}/binaries/${MVN_TARBALL}"
local FILE_PATH="maven/maven-${MVN_VERSION:0:1}/${MVN_VERSION}/binaries/${MVN_TARBALL}"
local APACHE_MIRROR=${APACHE_MIRROR:-'https://www.apache.org/dyn/closer.lua'}
local MIRROR_URL_QUERY="?action=download"

Expand Down
7 changes: 0 additions & 7 deletions connect-examples/server-library-example/common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,6 @@

<build>
<plugins>
<!-- os-maven-plugin helps resolve ${os.detected.classifier} automatically -->
<plugin>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.7.0</version>
<extensions>true</extensions>
</plugin>
<plugin>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
Expand Down
11 changes: 7 additions & 4 deletions dev/test-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ HADOOP_HIVE_PROFILES=(
hadoop-3-hive-2.3
)

MVN_EXEC_PLUGIN_VERSION=$(build/mvn help:evaluate \
-Dexpression=exec-maven-plugin.version -q -DforceStdout | grep -o -E "[0-9]+\.[0-9]+\.[0-9]+")

# We'll switch the version to a temp. one, publish POMs using that new version, then switch back to
# the old version. We need to do this because the `dependency:build-classpath` task needs to
# resolve Spark's internal submodule dependencies.
Expand All @@ -47,11 +50,11 @@ OLD_VERSION=$($MVN -q \
-Dexec.executable="echo" \
-Dexec.args='${project.version}' \
--non-recursive \
org.codehaus.mojo:exec-maven-plugin:1.6.0:exec | grep -E '[0-9]+\.[0-9]+\.[0-9]+')
org.codehaus.mojo:exec-maven-plugin:3.5.0:exec | grep -E '[0-9]+\.[0-9]+\.[0-9]+')
# dependency:get for guava and jetty-io are workaround for SPARK-37302.
GUAVA_VERSION=$(build/mvn help:evaluate -Dexpression=guava.version -q -DforceStdout | grep -E "^[0-9\.]+")
GUAVA_VERSION=$(build/mvn help:evaluate -Dexpression=guava.version -q -DforceStdout | grep -o -E "[0-9][0-9a-zA-Z\.]+")
build/mvn dependency:get -Dartifact=com.google.guava:guava:${GUAVA_VERSION} -q
JETTY_VERSION=$(build/mvn help:evaluate -Dexpression=jetty.version -q -DforceStdout | grep -E "[0-9]+\.[0-9]+\.[0-9]+")
JETTY_VERSION=$(build/mvn help:evaluate -Dexpression=jetty.version -q -DforceStdout | grep -o -E "[0-9]+\.[0-9]+\.[0-9]+")
build/mvn dependency:get -Dartifact=org.eclipse.jetty:jetty-io:${JETTY_VERSION} -q
if [ $? != 0 ]; then
echo -e "Error while getting version string from Maven:\n$OLD_VERSION"
Expand All @@ -61,7 +64,7 @@ SCALA_BINARY_VERSION=$($MVN -q \
-Dexec.executable="echo" \
-Dexec.args='${scala.binary.version}' \
--non-recursive \
org.codehaus.mojo:exec-maven-plugin:1.6.0:exec | grep -E '[0-9]+\.[0-9]+')
org.codehaus.mojo:exec-maven-plugin:3.5.0:exec | grep -E '[0-9]+\.[0-9]+')
if [[ "$SCALA_BINARY_VERSION" != "2.13" ]]; then
echo "Skip dependency testing on $SCALA_BINARY_VERSION"
exit 0
Expand Down
18 changes: 6 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>17</java.version>
<maven.compiler.release>${java.version}</maven.compiler.release>
<maven.version>3.9.10</maven.version>
<maven.version>4.0.0-rc-3</maven.version>
<exec-maven-plugin.version>3.5.0</exec-maven-plugin.version>
<sbt.project.name>spark</sbt.project.name>
<asm.version>9.8</asm.version>
Expand Down Expand Up @@ -2968,7 +2968,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.4.1</version>
<version>3.5.0</version>
<configuration>
<filesets>
<fileset>
Expand Down Expand Up @@ -3490,20 +3490,14 @@
-->
<profile>
<id>snapshots-and-staging</id>
<properties>
<!-- override point for ASF staging/snapshot repos -->
<asf.staging>https://repository.apache.org/content/groups/staging/</asf.staging>
<asf.snapshots>https://repository.apache.org/content/repositories/snapshots/</asf.snapshots>
</properties>

<pluginRepositories>
<pluginRepository>
<id>ASF Staging</id>
<url>${asf.staging}</url>
<url>https://repository.apache.org/content/groups/staging/</url>
Copy link
Member Author

Choose a reason for hiding this comment

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

address

[ERROR]   The project org.apache.spark:spark-parent_2.13:pom:4.1.0-SNAPSHOT (/Users/chengpan/Projects/apache-spark/pom.xml) has 4 errors
[ERROR]     'profiles.profile[snapshots-and-staging].repositories.repository.[ASF Staging].url' contains an unsupported expression (only expressions starting with 'project.basedir' or 'project.rootDirectory' are supported). @ org.apache.spark:spark-parent_2.13:4.1.0-SNAPSHOT, file:///Users/chengpan/Projects/apache-spark/pom.xml, line 3520, column 11
[ERROR]     'profiles.profile[snapshots-and-staging].repositories.repository.[ASF Snapshots].url' contains an unsupported expression (only expressions starting with 'project.basedir' or 'project.rootDirectory' are supported). @ org.apache.spark:spark-parent_2.13:4.1.0-SNAPSHOT, file:///Users/chengpan/Projects/apache-spark/pom.xml, line 3524, column 11
[ERROR]     'profiles.profile[snapshots-and-staging].pluginRepositories.pluginRepository.[ASF Staging].url' contains an unsupported expression (only expressions starting with 'project.basedir' or 'project.rootDirectory' are supported). @ org.apache.spark:spark-parent_2.13:4.1.0-SNAPSHOT, file:///Users/chengpan/Projects/apache-spark/pom.xml, line 3503, column 11
[ERROR]     'profiles.profile[snapshots-and-staging].pluginRepositories.pluginRepository.[ASF Snapshots].url' contains an unsupported expression (only expressions starting with 'project.basedir' or 'project.rootDirectory' are supported). @ org.apache.spark:spark-parent_2.13:4.1.0-SNAPSHOT, file:///Users/chengpan/Projects/apache-spark/pom.xml, line 3507, column 11

</pluginRepository>
<pluginRepository>
<id>ASF Snapshots</id>
<url>${asf.snapshots}</url>
<url>https://repository.apache.org/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
Expand All @@ -3516,11 +3510,11 @@
<repositories>
<repository>
<id>ASF Staging</id>
<url>${asf.staging}</url>
<url>https://repository.apache.org/content/groups/staging/</url>
</repository>
<repository>
<id>ASF Snapshots</id>
<url>${asf.snapshots}</url>
<url>https://repository.apache.org/content/repositories/snapshots/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
Expand Down
7 changes: 0 additions & 7 deletions sql/connect/common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,6 @@
</dependencies>
<build>
<!-- Protobuf compilation for Spark Connect -->
<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.6.2</version>
</extension>
</extensions>
<outputDirectory>target/scala-${scala.binary.version}/classes</outputDirectory>
<testOutputDirectory>target/scala-${scala.binary.version}/test-classes</testOutputDirectory>
<plugins>
Expand Down