Merge branch 'maven' into stream-javapackages-bootstrap-202501-rhel-9.6.0

This commit is contained in:
Johnny Hughes 2025-01-15 12:52:42 -06:00
commit 8569e9a07c
13 changed files with 1648 additions and 0 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

36
.gitignore vendored
View File

@ -0,0 +1,36 @@
/results_*
/*.src.rpm
/apache-maven-3.0-src.tar.gz
/apache-maven-3.0.2-src.tar.gz
/apache-maven-3.0.3-RC1-src.tar.gz
/apache-maven-3.0.3-src.tar.gz
/apache-maven-3.0.4-src.tar.gz
/apache-maven-3.0.5-src.tar.gz
/apache-maven-3.1.0-src.tar.gz
/apache-maven-3.1.1-src.tar.gz
/apache-maven-3.2.0-src.tar.gz
/apache-maven-3.2.1-src.tar.gz
/apache-maven-3.2.2-src.tar.gz
/apache-maven-3.2.3-src.tar.gz
/apache-maven-3.2.5-src.tar.gz
/apache-maven-3.3.0-src.tar.gz
/apache-maven-3.3.1-src.tar.gz
/apache-maven-3.3.3-src.tar.gz
/apache-maven-3.3.8-src.tar.gz
/apache-maven-3.3.9-src.tar.gz
/apache-maven-3.4.0-SNAPSHOT-src.tar.gz
/apache-maven-3.5.0-src.tar.gz
/apache-maven-3.5.2-src.tar.gz
/apache-maven-3.5.3-src.tar.gz
/apache-maven-3.5.4-src.tar.gz
/apache-maven-3.6.1-src.tar.gz
/apache-maven-3.6.2-src.tar.gz
/apache-maven-3.6.3-src.tar.gz
/apache-maven-3.8.4-src.tar.gz
/apache-maven-3.8.5-src.tar.gz
/apache-maven-3.8.6-src.tar.gz
/apache-maven-3.9.1-src.tar.gz
/apache-maven-3.9.4-src.tar.gz
/apache-maven-3.9.6-src.tar.gz
/apache-maven-3.9.9-src.tar.gz

View File

@ -0,0 +1,62 @@
From abda3bfec41730810ee98e685b128f27ddc24c36 Mon Sep 17 00:00:00 2001
From: Michael Simacek <msimacek@redhat.com>
Date: Wed, 1 Feb 2017 14:54:26 +0100
Subject: [PATCH 1/3] Adapt mvn script
---
apache-maven/src/bin/mvn | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/apache-maven/src/bin/mvn b/apache-maven/src/bin/mvn
index a3004f917..9b118717e 100755
--- a/apache-maven/src/bin/mvn
+++ b/apache-maven/src/bin/mvn
@@ -22,7 +22,7 @@
#
# Environment Variable Prerequisites
#
-# JAVA_HOME Must point at your Java Development Kit installation.
+# JAVA_HOME (Optional) Must point at your Java Development Kit installation.
# MAVEN_ARGS (Optional) Arguments passed to Maven before CLI arguments.
# MAVEN_OPTS (Optional) Java runtime options used when Maven is executed.
# MAVEN_SKIP_RC (Optional) Flag to disable loading of mavenrc files.
@@ -30,20 +30,22 @@
if [ -z "$MAVEN_SKIP_RC" ] ; then
- if [ -f /usr/local/etc/mavenrc ] ; then
- . /usr/local/etc/mavenrc
- fi
-
if [ -f /etc/mavenrc ] ; then
. /etc/mavenrc
fi
+ if [ -z "$JAVA_HOME" ] ; then
+ . /etc/java/maven@{maven_version_suffix}.conf
+ fi
+
if [ -f "$HOME/.mavenrc" ] ; then
. "$HOME/.mavenrc"
fi
fi
+export JAVA_HOME
+
# OS specific support. $var _must_ be set to either true or false.
cygwin=false;
mingw=false;
@@ -68,7 +70,8 @@ done
saveddir=`pwd`
-MAVEN_HOME=`dirname "$PRG"`/..
+MAVEN_HOME="${_FEDORA_MAVEN_HOME:-`dirname "$PRG"`/..}"
+unset _FEDORA_MAVEN_HOME
# make it fully qualified
MAVEN_HOME=`cd "$MAVEN_HOME" && pwd`
--
2.39.2

View File

@ -0,0 +1,51 @@
From a59ddba0d41b0ba1ea9c8c6ac541a71d737cdf30 Mon Sep 17 00:00:00 2001
From: Michael Simacek <msimacek@redhat.com>
Date: Tue, 6 Jun 2017 13:47:43 +0200
Subject: [PATCH 2/3] Invoke logback via reflection
---
.../cli/logging/impl/LogbackConfiguration.java | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/LogbackConfiguration.java b/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/LogbackConfiguration.java
index 4dc5a37b8..a977ba085 100644
--- a/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/LogbackConfiguration.java
+++ b/maven-embedder/src/main/java/org/apache/maven/cli/logging/impl/LogbackConfiguration.java
@@ -31,21 +31,29 @@
public class LogbackConfiguration extends BaseSlf4jConfiguration {
@Override
public void setRootLoggerLevel(Level level) {
- ch.qos.logback.classic.Level value;
+ String value;
switch (level) {
case DEBUG:
- value = ch.qos.logback.classic.Level.DEBUG;
+ value = "DEBUG";
break;
case INFO:
- value = ch.qos.logback.classic.Level.INFO;
+ value = "INFO";
break;
default:
- value = ch.qos.logback.classic.Level.ERROR;
+ value = "ERROR";
break;
}
- ((ch.qos.logback.classic.Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME)).setLevel(value);
+ Logger logger = LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
+ try {
+ Class<?> levelClass = Class.forName("ch.qos.logback.classic.Level");
+ Object logbackLevel = levelClass.getField(value).get(null);
+ Class<?> loggerClass = Class.forName("ch.qos.logback.classic.Logger");
+ loggerClass.getMethod("setLevel", new Class<?>[] {levelClass}).invoke(logger, new Object[] {logbackLevel});
+ } catch (Exception e) {
+ throw new RuntimeException("Failed to initialize logback configuration", e);
+ }
}
@Override
--
2.39.2

View File

@ -0,0 +1,89 @@
From ad1e669b96a5d251c36384e89d535b9c712a6246 Mon Sep 17 00:00:00 2001
From: Marian Koncek <mkoncek@redhat.com>
Date: Thu, 5 Sep 2019 15:21:04 +0200
Subject: [PATCH 3/3] Remove dependency on powermock
---
.../StringSearchModelInterpolatorTest.java | 59 -------------------
1 file changed, 59 deletions(-)
diff --git a/maven-model-builder/src/test/java/org/apache/maven/model/interpolation/StringSearchModelInterpolatorTest.java b/maven-model-builder/src/test/java/org/apache/maven/model/interpolation/StringSearchModelInterpolatorTest.java
index b2612e540..20b7162e2 100644
--- a/maven-model-builder/src/test/java/org/apache/maven/model/interpolation/StringSearchModelInterpolatorTest.java
+++ b/maven-model-builder/src/test/java/org/apache/maven/model/interpolation/StringSearchModelInterpolatorTest.java
@@ -35,8 +35,6 @@
import static org.hamcrest.CoreMatchers.anyOf;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
-import static org.powermock.reflect.Whitebox.getField;
-import static org.powermock.reflect.Whitebox.getInternalState;
/**
* @author jdcasey
@@ -344,63 +342,6 @@ public void testInterpolateObjectWithPomFile() throws Exception {
is(System.getProperty("user.dir") + File.separator + '.' + File.separator + "target"))));
}
- public void testNotInterpolateObjectWithFile() throws Exception {
- Model model = new Model();
-
- File baseDir = new File(System.getProperty("user.dir"));
-
- Properties p = new Properties();
-
- ObjectWithNotInterpolatedFile obj = new ObjectWithNotInterpolatedFile(baseDir);
-
- StringSearchModelInterpolator interpolator = (StringSearchModelInterpolator) createInterpolator();
-
- ModelBuildingRequest config = createModelBuildingRequest(p);
-
- SimpleProblemCollector collector = new SimpleProblemCollector();
- interpolator.interpolateObject(obj, model, new File("."), config, collector);
- assertProblemFree(collector);
-
- //noinspection unchecked
- Map<Class<?>, ?> cache = (Map<Class<?>, ?>)
- getField(StringSearchModelInterpolator.class, "CACHED_ENTRIES").get(null);
-
- Object objCacheItem = cache.get(Object.class);
- Object fileCacheItem = cache.get(File.class);
-
- assertNotNull(objCacheItem);
- assertNotNull(fileCacheItem);
-
- assertThat(((Object[]) getInternalState(objCacheItem, "fields")).length, is(0));
- assertThat(((Object[]) getInternalState(fileCacheItem, "fields")).length, is(0));
- }
-
- public void testNotInterpolateFile() throws Exception {
- Model model = new Model();
-
- File baseDir = new File(System.getProperty("user.dir"));
-
- Properties p = new Properties();
-
- StringSearchModelInterpolator interpolator = (StringSearchModelInterpolator) createInterpolator();
-
- ModelBuildingRequest config = createModelBuildingRequest(p);
-
- SimpleProblemCollector collector = new SimpleProblemCollector();
- interpolator.interpolateObject(baseDir, model, new File("."), config, collector);
- assertProblemFree(collector);
-
- //noinspection unchecked
- Map<Class<?>, ?> cache = (Map<Class<?>, ?>)
- getField(StringSearchModelInterpolator.class, "CACHED_ENTRIES").get(null);
-
- Object fileCacheItem = cache.get(File.class);
-
- assertNotNull(fileCacheItem);
-
- assertThat(((Object[]) getInternalState(fileCacheItem, "fields")).length, is(0));
- }
-
public void testConcurrentInterpolation() throws Exception {
final Model model = new Model();
--
2.39.2

1
ci.fmf Normal file
View File

@ -0,0 +1 @@
resultsdb-testcase: separate

10
gating.yaml Normal file
View File

@ -0,0 +1,10 @@
--- !Policy
product_versions:
- rhel-9
decision_contexts:
- osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build./plans/matrix/jdk21/full.functional}
- !PassingTestCaseRule {test_case_name: osci.brew-build./plans/matrix/jdk21/headless.functional}
- !PassingTestCaseRule {test_case_name: osci.brew-build./plans/matrix/unbound/jlink.functional}
- !PassingTestCaseRule {test_case_name: osci.brew-build./plans/javapackages.functional}

90
maven-bash-completion Normal file
View File

@ -0,0 +1,90 @@
_m2_make_goals()
{
plugin=$1
mojos=$2
for mojo in $mojos
do
export goals="$goals $plugin:$mojo"
done
}
_m2_complete()
{
local cur goals
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
case "${prev}" in
-f | --file|-l|--log-file)
COMPREPLY=( $(compgen -f ${cur}) )
return 0
;;
*);;
esac
goals='clean compile test install package deploy site verify'
if [[ ${cur} == -* ]] ; then
goals="$goals -am --also-make
-amd --also-make-dependents
-B --batch-mode
-C --strict-checksums
-c --lax-checksums
-cpu --check-plugin-updates
-D --define
-e --errors
-emp --encrypt-master-password
-ep --encrypt-password
-f --file
-fae --fail-at-end
-ff --fail-fast
-fn --fail-never
-gs --global-settings
-h --help
-l --log-file
-N --non-recursive
-npr --no-plugin-registry
-npu --no-plugin-updates
-nsu --no-snapshot-updates
-o --offline
-P --activate-profiles
-pl --projects
-q --quiet
-rf --resume-from
-s --settings
-T --threads
-t --toolchains
-U --update-snapshots
-up --update-plugins
-V --show-version
-v --version
-X --debug
-Dmaven.test.skip=true
-Dmaven.compiler.source=1.5
-Dmaven.compiler.source=1.6
-Dmaven.compiler.source=1.7
-Dmaven.compiler.target=1.5
-Dmaven.compiler.target=1.6
-Dmaven.compiler.target=1.7
-Dproject.build.sourceEncoding=UTF-8
-Dmaven.repo.local=
-Dmaven.local.depmap.file=
-Dmaven.local.debug=true
-Dmaven.local.mode=true"
fi
goals=$goals _m2_make_goals "eclipse" "eclipse"
goals=$goals _m2_make_goals "idea" "idea"
goals=$goals _m2_make_goals "assembly" "assembly"
goals=$goals _m2_make_goals "plexus" "app bundle-application bundle-runtime descriptor runtime service"
goals=$goals _m2_make_goals "dependency" "analyze analyze-dep-mgt analyze-only analyze-report analyze-duplicate
build-classpath copy copy-dependencies get go-offline list properties
purge-local-repository resolve resolve-plugins sources tree unpack
unpack-dependencies"
cur=`echo $cur | sed 's/\\\\//g'`
COMPREPLY=($(compgen -W "${goals}" -- ${cur} | sed 's/\\\\//g') )
}
complete -F _m2_complete -o filenames mvn

1088
maven.spec Normal file

File diff suppressed because it is too large Load Diff

160
mvn.1 Normal file
View File

@ -0,0 +1,160 @@
.TH MVN "1" "March 2023" "Apache Maven 3.9.1" "User Commands"
.SH NAME
mvn \- software project management and comprehension tool
.SH DESCRIPTION
usage: mvn [options] [<goal(s)>] [<phase(s)>]
usage: mvnDebug [options] [<goal(s)>] [<phase(s)>]
.SH OPTIONS
.TP
\fB\-am\fR,\-\-also\-make
If project list is specified, also
build projects required by the
list
.TP
\fB\-amd\fR,\-\-also\-make\-dependents
If project list is specified, also
build projects that depend on
projects on the list
.TP
\fB\-B\fR,\-\-batch\-mode
Run in non\-interactive (batch)
mode (disables output color)
.TP
\fB\-b\fR,\-\-builder <arg>
The id of the build strategy to
use.
.TP
\fB\-C\fR,\-\-strict\-checksums
Fail the build if checksums don't
match
.TP
\fB\-c\fR,\-\-lax\-checksums
Warn if checksums don't match
.TP
\fB\-\-color
Defines the color mode of the
output. Supported are \'auto\',
\'always\', \'never\'.
.TP
\fB\-cpu\fR,\-\-check\-plugin\-updates
Ineffective, only kept for
backward compatibility
.TP
\fB\-D\fR,\-\-define <arg>
Define a user property
.TP
\fB\-e\fR,\-\-errors
Produce execution error messages
.TP
\fB\-emp\fR,\-\-encrypt\-master\-password <arg>
Encrypt master security password
.TP
\fB\-ep\fR,\-\-encrypt\-password <arg>
Encrypt server password
.TP
\fB\-f\fR,\-\-file <arg>
Force the use of an alternate POM
file (or directory with pom.xml)
.TP
\fB\-fae\fR,\-\-fail\-at\-end
Only fail the build afterwards;
allow all non\-impacted builds to
continue
.TP
\fB\-ff\fR,\-\-fail\-fast
Stop at first failure in
reactorized builds
.TP
\fB\-fn\fR,\-\-fail\-never
NEVER fail the build, regardless
of project result
.TP
\fB\-gs\fR,\-\-global\-settings <arg>
Alternate path for the global
settings file
.TP
\fB\-gt\fR,\-\-global\-toolchains <arg>
Alternate path for the global
toolchains file
.TP
\fB\-h\fR,\-\-help
Display help information
.TP
\fB\-l\fR,\-\-log\-file <arg>
Log file where all build output
will go (disables output color)
.TP
\fB\-llr\fR,\-\-legacy\-local\-repository
UNSUPPORTED: Use of this option
will make Maven invocation fail.
.TP
\fB\-N\fR,\-\-non\-recursive
Do not recurse into sub\-projects
.TP
\fB\-npr\fR,\-\-no\-plugin\-registry
Ineffective, only kept for
backward compatibility
.TP
\fB\-npu\fR,\-\-no\-plugin\-updates
Ineffective, only kept for
backward compatibility
.TP
\fB\-nsu\fR,\-\-no\-snapshot\-updates
Suppress SNAPSHOT updates
.TP
\fB\-ntp\fR,\-\-no\-transfer\-progress
Do not display transfer progress
when downloading or uploading
.TP
\fB\-o\fR,\-\-offline
Work offline
.TP
\fB\-P\fR,\-\-activate\-profiles <arg>
Comma\-delimited list of profiles
to activate
.TP
\fB\-pl\fR,\-\-projects <arg>
Comma\-delimited list of specified
reactor projects to build instead
of all projects. A project can be
specified by [groupId]:artifactId
or by its relative path
.TP
\fB\-q\fR,\-\-quiet
Quiet output \- only show errors
.TP
\fB\-rf\fR,\-\-resume\-from <arg>
Resume reactor from specified
project
.TP
\fB\-s\fR,\-\-settings <arg>
Alternate path for the user
settings file
.TP
\fB\-t\fR,\-\-toolchains <arg>
Alternate path for the user
toolchains file
.TP
\fB\-T\fR,\-\-threads <arg>
Thread count, for instance 4 (int)
or 2C/2.5C (int/float) where C is
core multiplied
.TP
\fB\-U\fR,\-\-update\-snapshots
Forces a check for missing
releases and updated snapshots on
remote repositories
.TP
\fB\-up\fR,\-\-update\-plugins
Ineffective, only kept for
backward compatibility
.TP
\fB\-v\fR,\-\-version
Display version information
.TP
\fB\-V\fR,\-\-show\-version
Display version information
WITHOUT stopping build
.TP
\fB\-X\fR,\-\-debug
Produce execution debug output

7
plans/javapackages.fmf Normal file
View File

@ -0,0 +1,7 @@
summary: Run javapackages-specific tests
discover:
how: fmf
url: https://src.fedoraproject.org/tests/javapackages
ref: c9s
execute:
how: tmt

52
plans/matrix.fmf Normal file
View File

@ -0,0 +1,52 @@
discover:
how: fmf
url: https://src.fedoraproject.org/tests/maven
execute:
how: tmt
environment:
MAVEN_IT_GIT_REF: maven-3.9.x
/jdk21:
environment+:
OPENJDK_VERSION: 21
prepare:
- how: install
exclude:
- maven-unbound
/full:
summary: Maven matrix tests - OpenJDK 21 full
discover+:
filter: tag:jdk21 & tier:0,1
/headless:
summary: Maven matrix tests - OpenJDK 21 headless
discover+:
filter: tag:jre21 & tier:0,1
environment+:
OPENJDK_HEADLESS: "true"
prepare+:
- how: shell
script: |
dnf -y remove java-*-openjdk
/unbound:
prepare:
- how: install
exclude:
- maven-openjdk21
/jlink:
summary: Maven matrix tests - unbound jlink-based Java
discover+:
filter: tag:unbound & tier:0,1
prepare+:
- how: shell
script: |
test -d /opt/java && test -x /usr/local/bin/java && exit 0
dnf -y install java-21-openjdk-jmods
jlink --add-modules java.base,java.logging,java.xml,java.naming --output /opt/java
ln -s /opt/java/bin/java /usr/local/bin/java
dnf -y remove java-21-openjdk-jmods

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (apache-maven-3.9.9-src.tar.gz) = 2f395661e7a48c454dd526f2800df209169a253e7980f6fbfbf5f63546fe726a45935f14b151a2737159c9574b5b0f223ea8cd0f62232dd47b47a6863df790d5