Compare commits

..

No commits in common. "c8-stream-201902" and "c10s" have entirely different histories.

15 changed files with 503 additions and 258 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

61
.gitignore vendored
View File

@ -1 +1,60 @@
SOURCES/da67577.tar.gz
/results_*
/*.src.rpm
/xmvn-0.tar.xz
/xmvn-0.0.1.tar.xz
/xmvn-0.0.2.tar.xz
/xmvn-0.1.0.tar.xz
/xmvn-0.1.1.tar.xz
/xmvn-0.1.2.tar.xz
/xmvn-0.1.3.tar.xz
/xmvn-0.1.4.tar.xz
/xmvn-0.1.5.tar.xz
/xmvn-0.2.0.tar.xz
/xmvn-0.2.1.tar.xz
/xmvn-0.2.2.tar.xz
/xmvn-0.2.3.tar.xz
/xmvn-0.2.4.tar.xz
/xmvn-0.2.5.tar.xz
/xmvn-0.2.6.tar.xz
/xmvn-0.3.0.tar.xz
/xmvn-0.3.1.tar.xz
/xmvn-snapshot.tar.xz
/xmvn-0.4.0.tar.xz
/xmvn-0.4.1.tar.xz
/xmvn-0.4.2.tar.xz
/xmvn-0.5.0.tar.xz
/xmvn-0.5.1.tar.xz
/xmvn-1.0.0.tar.xz
/xmvn-1.0.1.tar.xz
/xmvn-1.0.2.tar.xz
/xmvn-1.1.0.tar.xz
/xmvn-1.2.0.tar.xz
/xmvn-1.3.0.tar.xz
/xmvn-1.4.0.tar.xz
/xmvn-1.5.0-SNAPSHOT.tar.xz
/xmvn-2.0.0.tar.xz
/xmvn-2.0.1.tar.xz
/xmvn-2.1.0.tar.xz
/xmvn-2.1.1.tar.xz
/xmvn-2.2.0.tar.xz
/xmvn-2.2.1.tar.xz
/xmvn-2.3.0.tar.xz
/xmvn-2.3.1.tar.xz
/xmvn-2.3.2.tar.xz
/xmvn-2.4.0.tar.xz
/xmvn-2.5.0.tar.xz
/xmvn-3.0.0.tar.xz
/xmvn-3.1.0.tar.xz
/5d1e284.tar.gz
/da67577.tar.gz
/fac231b.tar.gz
/5547c28.tar.gz
/523e11f.tar.gz
/7e2d3db.tar.gz
/54026c1.tar.gz
/43c7e67.tar.gz
/3b84c99.tar.gz
/xmvn-4.0.0.tar.xz
/xmvn-4.1.0.tar.xz
/xmvn-4.2.0.tar.xz

View File

@ -1 +0,0 @@
df6cdcb0a2dd366cc384c03675c1a7f568472aae SOURCES/da67577.tar.gz

View File

@ -1,77 +0,0 @@
From c9362d3f23f950bb6987c63c67b06528de3ce100 Mon Sep 17 00:00:00 2001
From: Mikolaj Izdebski <mizdebsk@redhat.com>
Date: Thu, 23 Jan 2020 12:50:42 +0100
Subject: [PATCH] Initial PoC of XMvn toolchain manager
---
.../aether/XMvnMavenLifecycleParticipant.java | 38 +++++++++++++++++++
1 file changed, 38 insertions(+)
diff --git a/xmvn-connector-aether/src/main/java/org/fedoraproject/xmvn/connector/aether/XMvnMavenLifecycleParticipant.java b/xmvn-connector-aether/src/main/java/org/fedoraproject/xmvn/connector/aether/XMvnMavenLifecycleParticipant.java
index 0e360488..ddd6151b 100644
--- a/xmvn-connector-aether/src/main/java/org/fedoraproject/xmvn/connector/aether/XMvnMavenLifecycleParticipant.java
+++ b/xmvn-connector-aether/src/main/java/org/fedoraproject/xmvn/connector/aether/XMvnMavenLifecycleParticipant.java
@@ -15,10 +15,15 @@
*/
package org.fedoraproject.xmvn.connector.aether;
+import java.util.Collections;
+
import org.apache.maven.AbstractMavenLifecycleParticipant;
import org.apache.maven.MavenExecutionException;
import org.apache.maven.execution.MavenExecutionRequest;
import org.apache.maven.execution.MavenSession;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.toolchain.MisconfiguredToolchainException;
+import org.apache.maven.toolchain.ToolchainManagerPrivate;
import org.codehaus.plexus.component.annotations.Component;
import org.codehaus.plexus.component.annotations.Requirement;
import org.codehaus.plexus.logging.Logger;
@@ -42,6 +47,9 @@ public class XMvnMavenLifecycleParticipant
@Requirement( role = XMvnMojoExecutionListener.class )
private XMvnMojoExecutionListener mojoExecutionListener;
+ @Requirement
+ private ToolchainManagerPrivate toolchainManager;
+
@Override
public void afterSessionStart( MavenSession session )
throws MavenExecutionException
@@ -61,4 +69,34 @@ public class XMvnMavenLifecycleParticipant
chainedListener.addExecutionListener( reportGenerator );
request.setExecutionListener( chainedListener );
}
+
+ @Override
+ public void afterProjectsRead( MavenSession session )
+ throws MavenExecutionException
+ {
+ MavenProject currentProject = session.getCurrentProject();
+
+ try
+ {
+ for ( var toolchain : toolchainManager.getToolchainsForType( "jdk", session ) )
+ {
+ if ( toolchain.matchesRequirements( Collections.singletonMap( "xmvn", "xmvn" ) ) )
+ {
+ for ( var project : session.getAllProjects() )
+ {
+ session.setCurrentProject( project );
+ toolchainManager.storeToolchainToBuildContext( toolchain, session );
+ }
+ }
+ }
+ }
+ catch ( MisconfiguredToolchainException e )
+ {
+ throw new MavenExecutionException( "Unable to configure toolchains", e );
+ }
+ finally
+ {
+ session.setCurrentProject( currentProject );
+ }
+ }
}
--
2.21.0

59
build.bash Normal file
View File

@ -0,0 +1,59 @@
#!/bin/bash -ex
resultdir="/var/lib/mock/xmvn-rawhide/result"
# create directories
repo=RPM/latest/
[[ ! -d ${repo} ]] && mkdir -p ${repo}
# update version and release tag in spec file
version=$(sed -n '/<version>/{s/.*>\(.*\)<.*/\1/;s/-SNAPSHOT$//;p;q}' pom.xml)
release=$(git describe --match="[^(jenkins)].*" --tags | sed 's/[^-]*-/0./;s/-/./;s/g/git/')
sed -i "s/^Version:\s\+[0-9.]*$/Version: ${version}/" xmvn.spec
sed -i "s/^Release:\s\+[0-9.]*%{?dist}$/Release: ${release}/" xmvn.spec
# Skip patch application on Jenkins - it is supposed to always use the
# latest vanilla upstream snapshot.
sed -i "/^Patch[0-9]*:/d" xmvn.spec
sed -i "/^%patch[0-9]* -p/d" xmvn.spec
# make tarball
git archive -v --prefix=xmvn-${version}/ HEAD | xz > xmvn-${version}.tar.xz
# crate srpm
rm -f SRPMS/*
rpmbuild -bs --clean --define "_topdir `pwd`" --define "_sourcedir `pwd`" xmvn.spec
# build RPM with custom mock config
rm -Rf ${resultdir}/*
# print root.log and build.log in case of failure
trap "cat ${resultdir}/{root,build}.log || :" 0
mock -r ../..$PWD/fedora-rawhide-x86_64 SRPMS/*.src.rpm
# remove unneeded stuff
rm -f xmvn-*.tar.xz
last_bn=`grep "Build number" ${repo}/info.log | awk '{ print $3 }'`
if [ -n "${last_bn}" ]; then
mkdir -p RPM/${last_bn}
mv ${repo}/* RPM/${last_bn}
# we only want keep RPMs from last 10 builds
blist=`find ./RPM/ -maxdepth 1 -name "[0-9]*"`
for bn in $blist; do
if [ `basename $bn` -lt `expr $last_bn - 10` ]; then
rm -Rf $bn
fi
done
fi
# copy resulting RPMs to RPM/latest
cp ${resultdir}/* ${repo}
tail -n 50 ${resultdir}/build.log
createrepo ${repo}
# store current build number into the file
echo "Build number: $BUILD_NUMBER" >> ${repo}/info.log

1
ci.fmf Normal file
View File

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

37
fedora-rawhide-x86_64.cfg Normal file
View File

@ -0,0 +1,37 @@
config_opts['root'] = 'xmvn-rawhide'
config_opts['target_arch'] = 'x86_64'
config_opts['legal_host_arches'] = ('x86_64',)
config_opts['chroot_setup_cmd'] = 'install @buildsys-build'
config_opts['dist'] = 'rawhide' # only useful for --resultdir variable subst
config_opts['extra_chroot_dirs'] = [ '/run/lock', ]
config_opts['releasever'] = '21'
config_opts['yum.conf'] = """
[main]
logfile=/var/log/yum.log
retries=20
gpgcheck=0
assumeyes=1
syslog_ident=mock
syslog_device=
metadata_expire=1
mirrorlist_expire=1
debuglevel=2
[mock-rawhide]
name=mock-rawhide
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=rawhide&arch=x86_64
failovermethod=priority
cost=1000
[mock-koji]
name=mock-koji
baseurl=http://kojipkgs.fedoraproject.org/repos/rawhide/latest/x86_64/
cost=2000
[mock-override]
name=mock-override
baseurl=http://people.redhat.com/~mizdebsk/jenkins-extra-repo/
gpgcheck=0
cost=500
"""

8
gating.yaml Normal file
View File

@ -0,0 +1,8 @@
--- !Policy
product_versions:
- rhel-10
decision_contexts:
- osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build./plans/smoke.functional}
- !PassingTestCaseRule {test_case_name: osci.brew-build./plans/javapackages.functional}

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: c10s
execute:
how: tmt

5
plans/smoke.fmf Normal file
View File

@ -0,0 +1,5 @@
summary: Basic smoke test
discover:
how: fmf
execute:
how: tmt

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (xmvn-4.2.0.tar.xz) = 6b641bff64afee35c168c88ec2376ea70ae52812bd41fb231f8e3b088914363fbcfceb9ead8473283885d712b060ec8e1879928b021749534299f13606ca50b8

View File

@ -0,0 +1,6 @@
summary: XMvn smoke test
description: |
Test basic functionality of XMvn.
require:
- maven-dependency-plugin
- junit

70
tests/Sanity/smoke/runtest.sh Executable file
View File

@ -0,0 +1,70 @@
#!/bin/bash
# Author: Mikolaj Izdebski <mizdebsk@redhat.com>
. /usr/share/beakerlib/beakerlib.sh
rlJournalStart
rlPhaseStartTest "check for presence of XMvn commands"
rlAssertRpm xmvn
rlAssertRpm xmvn-minimal
rlAssertRpm xmvn-tools
rlAssertBinaryOrigin xmvn xmvn-minimal
rlAssertBinaryOrigin xmvn-install xmvn-tools
rlAssertBinaryOrigin xmvn-resolve xmvn-tools
rlAssertBinaryOrigin xmvn-subst xmvn-tools
rlPhaseEnd
rlPhaseStartTest "display xmvn version"
rlRun -s "xmvn --version"
rlAssertGrep "^Apache Maven " $rlRun_LOG
rlAssertGrep "^Maven home: " $rlRun_LOG
rlAssertGrep "^Java version:" $rlRun_LOG
rlPhaseEnd
rlPhaseStartTest "display xmvn help"
rlRun -s "xmvn --help"
rlAssertGrep "Comma-delimited list of" $rlRun_LOG
rlPhaseEnd
rlPhaseStartTest "display xmvn-install help"
rlRun -s "xmvn-install --help"
rlAssertGrep "^xmvn-install: Install artifacts" $rlRun_LOG
rlAssertGrep "^Usage: xmvn-install" $rlRun_LOG
rlPhaseEnd
rlPhaseStartTest "display xmvn-resolve help"
rlRun -s "xmvn-resolve --help"
rlAssertGrep "^xmvn-resolve: Resolve artifacts from system repository" $rlRun_LOG
rlAssertGrep "^Usage: xmvn-resolve" $rlRun_LOG
rlPhaseEnd
rlPhaseStartTest "display xmvn-subst help"
rlRun -s "xmvn-subst --help"
rlAssertGrep "^xmvn-subst: Substitute artifact files with symbolic links" $rlRun_LOG
rlAssertGrep "^Usage: xmvn-subst" $rlRun_LOG
rlPhaseEnd
rlPhaseStartTest "resolve local artifact"
rlRun "rm -rf $HOME/.m2/repository/junit/junit/4.12/"
rlAssertNotExists $HOME/.m2/repository/junit/junit/4.12/junit-4.12.jar
rlRun -s "xmvn -Dxmvn.debug=1 -B dependency:get -Dartifact=junit:junit:4.12"
rlAssertGrep "BUILD SUCCESS" $rlRun_LOG
rlAssertGrep "Resolving junit:junit:jar:4.12 with transitive dependencies" $rlRun_LOG
rlAssertGrep "Trying to resolve artifact junit:junit:jar:4.12" $rlRun_LOG
rlAssertGrep "Artifact junit:junit:jar:4.12 was resolved to /usr/share/java/" $rlRun_LOG
rlAssertNotExists $HOME/.m2/repository/junit/junit/4.12/junit-4.12.jar
rlPhaseEnd
rlPhaseStartTest "download remote artifact"
rlRun "rm -rf $HOME/.m2/repository/turbine/turbine/2.1/"
rlAssertNotExists $HOME/.m2/repository/turbine/turbine/2.1/turbine-2.1.jar
rlRun -s "xmvn -Dxmvn.debug=1 -B dependency:get -Dartifact=turbine:turbine:2.1"
rlAssertGrep "BUILD SUCCESS" $rlRun_LOG
rlAssertGrep "Resolving turbine:turbine:jar:2.1 with transitive dependencies" $rlRun_LOG
rlAssertGrep "Trying to resolve artifact turbine:turbine:jar:2.1" $rlRun_LOG
rlAssertGrep "Failed to resolve artifact: turbine:turbine:jar:2.1" $rlRun_LOG
rlAssertExists $HOME/.m2/repository/turbine/turbine/2.1/turbine-2.1.jar
rlPhaseEnd
rlJournalEnd
rlJournalPrintText

4
tests/main.fmf Normal file
View File

@ -0,0 +1,4 @@
contact: Mikolaj Izdebski <mizdebsk@redhat.com>
framework: beakerlib
test: ./runtest.sh
tier: 1

View File

@ -1,55 +1,53 @@
# XMvn uses OSGi environment provided by Tycho, it shouldn't require
# any additional bundles.
%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^osgi\\($
%bcond_with bootstrap
%if %{with bootstrap}
%global mbi 1
%endif
Name: xmvn
Version: 4.0.0~20191028.da67577
Release: 3%{?dist}
Version: 4.2.0
Release: 13%{?dist}
Summary: Local Extensions for Apache Maven
License: ASL 2.0
License: Apache-2.0
URL: https://fedora-java.github.io/xmvn/
BuildArch: noarch
ExclusiveArch: %{java_arches} noarch
#Source0: https://github.com/fedora-java/xmvn/releases/download/%{version}/xmvn-%{version}.tar.xz
Source0: https://github.com/fedora-java/xmvn/archive/da67577.tar.gz
Patch0: 0001-Initial-PoC-of-XMvn-toolchain-manager.patch
Source0: https://github.com/fedora-java/xmvn/releases/download/%{version}/xmvn-%{version}.tar.xz
%if %{with bootstrap}
BuildRequires: javapackages-bootstrap
%else
BuildRequires: maven-local
BuildRequires: mvn(com.beust:jcommander)
BuildRequires: mvn(javax.inject:javax.inject)
BuildRequires: mvn(org.apache.commons:commons-compress)
BuildRequires: mvn(org.apache.ivy:ivy)
BuildRequires: mvn(org.apache.maven.plugin-tools:maven-plugin-annotations)
BuildRequires: mvn(org.apache.maven.plugins:maven-assembly-plugin)
BuildRequires: mvn(org.apache.maven.plugins:maven-plugin-plugin)
BuildRequires: mvn(org.apache.maven.resolver:maven-resolver-api)
BuildRequires: mvn(org.apache.maven.resolver:maven-resolver-util)
BuildRequires: mvn(org.apache.maven.shared:maven-invoker)
BuildRequires: mvn(org.apache.maven:maven-artifact)
BuildRequires: mvn(org.apache.maven:maven-core)
BuildRequires: mvn(org.apache.maven:maven-model)
BuildRequires: mvn(org.apache.maven:maven-model-builder)
BuildRequires: mvn(org.apache.maven:maven-plugin-api)
BuildRequires: mvn(org.codehaus.modello:modello-maven-plugin)
BuildRequires: mvn(org.codehaus.mojo:build-helper-maven-plugin)
BuildRequires: mvn(org.codehaus.plexus:plexus-classworlds)
BuildRequires: mvn(org.codehaus.plexus:plexus-component-annotations)
BuildRequires: mvn(org.codehaus.plexus:plexus-component-metadata)
BuildRequires: mvn(org.codehaus.plexus:plexus-container-default)
BuildRequires: mvn(org.codehaus.plexus:plexus-utils)
BuildRequires: mvn(org.easymock:easymock)
BuildRequires: mvn(org.junit.jupiter:junit-jupiter)
BuildRequires: mvn(org.eclipse.sisu:org.eclipse.sisu.inject)
BuildRequires: mvn(org.eclipse.sisu:org.eclipse.sisu.plexus)
BuildRequires: mvn(org.eclipse.sisu:sisu-maven-plugin)
BuildRequires: mvn(org.junit.jupiter:junit-jupiter-api)
BuildRequires: mvn(org.ow2.asm:asm)
BuildRequires: mvn(org.slf4j:slf4j-api)
BuildRequires: mvn(org.slf4j:slf4j-simple)
BuildRequires: mvn(org.xmlunit:xmlunit-assertj)
# For /usr/bin/mvn, used to determine location of Maven home
BuildRequires: mvn(org.xmlunit:xmlunit-assertj3)
# Maven home is used as template for XMvn home
BuildRequires: maven
%endif
Requires: %{name}-minimal = %{version}-%{release}
Requires: maven >= 3.6.1
Requires: maven
%description
This package provides extensions for Apache Maven that can be used to
@ -59,16 +57,12 @@ creating RPM packages containing Maven artifacts.
%package minimal
Summary: Dependency-reduced version of XMvn
Requires: maven-lib >= 3.4.0
Requires: %{name}-api = %{version}-%{release}
Requires: %{name}-connector-aether = %{version}-%{release}
Requires: %{name}-core = %{version}-%{release}
Requires: apache-commons-cli
Requires: apache-commons-lang3
Requires: atinject
Requires: google-guice
Requires: guava
Requires: maven-lib
Requires: maven-resolver
Requires: maven-wagon
Requires: plexus-cipher
@ -80,48 +74,21 @@ Requires: plexus-utils
Requires: sisu
Requires: slf4j
Requires: maven-lib
Requires: maven-jdk-binding
Suggests: maven-openjdk21
%description minimal
This package provides minimal version of XMvn, incapable of using
remote repositories.
%package parent-pom
Summary: XMvn Parent POM
%description parent-pom
This package provides XMvn parent POM.
%package api
Summary: XMvn API
%description api
This package provides XMvn API module which contains public interface
for functionality implemented by XMvn Core.
%package core
Summary: XMvn Core
Summary: XMvn library
%description core
This package provides XMvn Core module, which implements the essential
functionality of XMvn such as resolution of artifacts from system
repository.
%package connector-aether
Summary: XMvn Connector for Maven Resolver
%description connector-aether
This package provides XMvn Connector for Maven Resolver, which
provides integration of Maven Resolver with XMvn. It provides an
adapter which allows XMvn resolver to be used as Maven workspace
reader.
%package connector-ivy
Summary: XMvn Connector for Apache Ivy
%description connector-ivy
This package provides XMvn Connector for Apache Ivy, which provides
integration of Apache Ivy with XMvn. It provides an adapter which
allows XMvn resolver to be used as Ivy resolver.
This package provides XMvn API and XMvn Core modules, which implement
the essential functionality of XMvn such as resolution of artifacts
from system repository.
%package mojo
Summary: XMvn MOJO
@ -132,57 +99,24 @@ of several MOJOs. Some goals of these MOJOs are intended to be
attached to default Maven lifecycle when building packages, others can
be called directly from Maven command line.
%package tools-pom
Summary: XMvn Tools POM
%description tools-pom
This package provides XMvn Tools parent POM.
%package resolve
Summary: XMvn Resolver
%package tools
Summary: XMvn tools
# Explicit javapackages-tools requires since scripts use
# /usr/share/java-utils/java-functions
Requires: javapackages-tools
%description resolve
This package provides XMvn Resolver, which is a very simple
commald-line tool to resolve Maven artifacts from system repositories.
Basically it's just an interface to artifact resolution mechanism
implemented by XMvn Core. The primary intended use case of XMvn
Resolver is debugging local artifact repositories.
%package bisect
Summary: XMvn Bisect
# Explicit javapackages-tools requires since scripts use
# /usr/share/java-utils/java-functions
Requires: javapackages-tools
%description bisect
This package provides XMvn Bisect, which is a debugging tool that can
diagnose build failures by using bisection method.
%package subst
Summary: XMvn Subst
# Explicit javapackages-tools requires since scripts use
# /usr/share/java-utils/java-functions
Requires: javapackages-tools
%description subst
This package provides XMvn Subst, which is a tool that can substitute
Maven artifact files with symbolic links to corresponding files in
artifact repository.
%package install
Summary: XMvn Install
Requires: apache-commons-compress
# Explicit javapackages-tools requires since scripts use
# /usr/share/java-utils/java-functions
Requires: javapackages-tools
%description install
This package provides XMvn Install, which is a command-line interface
to XMvn installer. The installer reads reactor metadata and performs
artifact installation according to specified configuration.
%description tools
This package provides various XMvn tools:
* XMvn Install, which is a command-line interface to XMvn installer.
The installer reads reactor metadata and performs artifact
installation according to specified configuration.
* XMvn Resolver, which is a very simple commald-line tool to resolve
Maven artifacts from system repositories. Basically it's just an
interface to artifact resolution mechanism implemented by XMvn Core.
The primary intended use case of XMvn Resolver is debugging local
artifact repositories.
* XMvn Subst, which is a tool that can substitute Maven artifact files
with symbolic links to corresponding files in artifact repository.
%package javadoc
Summary: API documentation for %{name}
@ -191,87 +125,76 @@ Summary: API documentation for %{name}
This package provides %{summary}.
%prep
%setup -q -n xmvn-da67577d9252f0b1fffed546c7c23d97a97dec4b
%patch0 -p1
%setup -q
# Bisect IT has no chances of working in local, offline mode, without
# network access - it needs to access remote repositories.
find -name BisectIntegrationTest.java -delete
# Resolver IT won't work either - it tries to execute JAR file, which
# relies on Class-Path in manifest, which is forbidden in Fedora...
find -name ResolverIntegrationTest.java -delete
%pom_remove_plugin -r :maven-site-plugin
%mvn_package ":xmvn{,-it}" __noinstall
%pom_disable_module xmvn-connector-gradle
# Upstream code quality checks, not relevant when building RPMs
%pom_remove_plugin -r :apache-rat-plugin
%pom_remove_plugin -r :maven-checkstyle-plugin
%pom_remove_plugin -r :jacoco-maven-plugin
# FIXME pom macros don't seem to support submodules in profile
%pom_remove_plugin :jacoco-maven-plugin xmvn-it
# remove dependency plugin maven-binaries execution
# we provide apache-maven by symlink
%pom_xpath_remove "pom:executions/pom:execution[pom:id[text()='maven-binaries']]"
%mvn_package ::tar.gz: __noinstall
%mvn_package ":{xmvn,xmvn-connector}" xmvn
%mvn_package ":xmvn-{api,core,parent}" core
%mvn_package ":xmvn-mojo" mojo
%mvn_package ":xmvn-{install,resolve,subst,tools}" tools
# Don't put Class-Path attributes in manifests
%pom_remove_plugin :maven-jar-plugin xmvn-tools
# get mavenVersion that is expected
maven_home=$(realpath $(dirname $(realpath $(which mvn)))/..)
# Copy Maven home packaged as RPM instead of unpacking Maven binary
# tarball with maven-dependency-plugin
%pom_remove_plugin :maven-dependency-plugin
maven_home=$(realpath $(dirname $(realpath $(%{?jpb_env} which mvn)))/..)
mver=$(sed -n '/<mavenVersion>/{s/.*>\(.*\)<.*/\1/;p}' \
xmvn-parent/pom.xml)
mkdir -p target/dependency/
cp -a ${maven_home} target/dependency/apache-maven-$mver
cp -a "${maven_home}" target/dependency/apache-maven-$mver
# Workaround easymock incompatibility with Java 17 that should be fixed
# in easymock 4.4: https://github.com/easymock/easymock/issues/274
%pom_add_plugin :maven-surefire-plugin xmvn-connector "<configuration>
<argLine>--add-opens=java.base/java.lang=ALL-UNNAMED</argLine></configuration>"
%pom_add_plugin :maven-surefire-plugin xmvn-tools/xmvn-install "<configuration>
<argLine>--add-opens=java.base/java.lang=ALL-UNNAMED</argLine></configuration>"
%build
%mvn_build -s -j
%mvn_build -j -- -P\\!quality
version=4.0.0-SNAPSHOT
tar --delay-directory-restore -xvf target/*tar.bz2
chmod -R +rwX %{name}-${version}*
version=4.*
tar --delay-directory-restore -xvf target/xmvn-*-bin.tar.gz
chmod -R +rwX %{name}-${version}
# These are installed as doc
rm -f %{name}-${version}*/{AUTHORS-XMVN,README-XMVN.md,LICENSE,NOTICE,NOTICE-XMVN}
rm -f %{name}-${version}/{AUTHORS-XMVN,README-XMVN.md,LICENSE,NOTICE,NOTICE-XMVN}
# Not needed - we use JPackage launcher scripts
rm -Rf %{name}-${version}*/lib/{installer,resolver,subst,bisect}/
rm -Rf %{name}-${version}/lib/{installer,resolver,subst}/
# Irrelevant Maven launcher scripts
rm -f %{name}-${version}*/bin/*
rm -f %{name}-${version}/bin/*
%install
%mvn_install
version=4.0.0-SNAPSHOT
maven_home=$(realpath $(dirname $(realpath $(which mvn)))/..)
version=4.*
maven_home=$(realpath $(dirname $(realpath $(%{?jpb_env} which mvn)))/..)
install -d -m 755 %{buildroot}%{_datadir}/%{name}
cp -r %{name}-${version}*/* %{buildroot}%{_datadir}/%{name}/
cp -r%{?mbi:L} %{name}-${version}/* %{buildroot}%{_datadir}/%{name}/
for cmd in mvn mvnDebug; do
cat <<EOF >%{buildroot}%{_datadir}/%{name}/bin/$cmd
#!/bin/sh -e
export _FEDORA_MAVEN_HOME="%{_datadir}/%{name}"
exec ${maven_home}/bin/$cmd "\${@}"
exec %{_datadir}/maven%{?maven_version_suffix}/bin/$cmd "\${@}"
EOF
chmod 755 %{buildroot}%{_datadir}/%{name}/bin/$cmd
done
# helper scripts
%jpackage_script org.fedoraproject.xmvn.tools.bisect.BisectCli "" "-Dxmvn.home=%{_datadir}/%{name}" xmvn/xmvn-bisect:beust-jcommander:maven-invoker:plexus/utils xmvn-bisect
%jpackage_script org.fedoraproject.xmvn.tools.install.cli.InstallerCli "" "" xmvn/xmvn-install:xmvn/xmvn-api:xmvn/xmvn-core:beust-jcommander:slf4j/api:slf4j/simple:objectweb-asm/asm:commons-compress xmvn-install
%jpackage_script org.fedoraproject.xmvn.tools.resolve.ResolverCli "" "" xmvn/xmvn-resolve:xmvn/xmvn-api:xmvn/xmvn-core:beust-jcommander xmvn-resolve
%jpackage_script org.fedoraproject.xmvn.tools.subst.SubstCli "" "" xmvn/xmvn-subst:xmvn/xmvn-api:xmvn/xmvn-core:beust-jcommander xmvn-subst
# copy over maven lib directory
cp -r ${maven_home}/lib/* %{buildroot}%{_datadir}/%{name}/lib/
# copy over maven boot and lib directories
cp -r%{?mbi:L} ${maven_home}/boot/* %{buildroot}%{_datadir}/%{name}/boot/
cp -r%{?mbi:L} ${maven_home}/lib/* %{buildroot}%{_datadir}/%{name}/lib/
# possibly recreate symlinks that can be automated with xmvn-subst
%if !0%{?sclraw_phase}
%if !0%{?mbi}
%{name}-subst -s -R %{buildroot} %{buildroot}%{_datadir}/%{name}/
%endif
@ -286,10 +209,13 @@ install -d -m 755 %{buildroot}%{_datadir}/%{name}/conf/
cp -P ${maven_home}/conf/settings.xml %{buildroot}%{_datadir}/%{name}/conf/
cp -P ${maven_home}/bin/m2.conf %{buildroot}%{_datadir}/%{name}/bin/
# Make sure javapackages config is not bundled
rm -rf %{buildroot}%{_datadir}/%{name}/{configuration.xml,config.d/,conf/toolchains.xml,maven-metadata/}
%files
%{_bindir}/mvn-local
%files minimal
%files minimal -f .mfiles-xmvn
%{_bindir}/%{name}
%dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}/bin
@ -303,40 +229,155 @@ cp -P ${maven_home}/bin/m2.conf %{buildroot}%{_datadir}/%{name}/bin/
%{_datadir}/%{name}/boot
%{_datadir}/%{name}/conf
%files parent-pom -f .mfiles-xmvn-parent
%doc LICENSE NOTICE
%files core -f .mfiles-xmvn-core
%files api -f .mfiles-xmvn-api
%doc LICENSE NOTICE
%files core -f .mfiles-core
%license LICENSE NOTICE
%doc AUTHORS README.md
%files connector-aether -f .mfiles-xmvn-connector-aether
%files mojo -f .mfiles-mojo
%files connector-ivy -f .mfiles-xmvn-connector-ivy
%files mojo -f .mfiles-xmvn-mojo
%files tools-pom -f .mfiles-xmvn-tools
%files resolve -f .mfiles-xmvn-resolve
%files tools -f .mfiles-tools
%{_bindir}/%{name}-install
%{_bindir}/%{name}-resolve
%files bisect -f .mfiles-xmvn-bisect
%{_bindir}/%{name}-bisect
%files subst -f .mfiles-xmvn-subst
%{_bindir}/%{name}-subst
%files install -f .mfiles-xmvn-install
%{_bindir}/%{name}-install
%files javadoc
%doc LICENSE NOTICE
%license LICENSE NOTICE
%changelog
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 4.2.0-13
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018
* Mon Aug 05 2024 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.2.0-12
- Suggest maven-openjdk21
- Resolves: RHEL-51257
* Thu Aug 01 2024 Troy Dawson <tdawson@redhat.com> - 4.2.0-12
- Bump release for Aug 2024 java mass rebuild
* Tue Jul 30 2024 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.2.0-11
- Remove temporary BR on maven-openjdk17
* Tue Jul 30 2024 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.2.0-10
- Add temporary BR on maven-openjdk17
* Tue Jul 30 2024 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.2.0-9
- Remove workaround for rpm bug 447156
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 4.2.0-8
- Bump release for June 2024 mass rebuild
* Fri Feb 09 2024 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.2.0-7
- Drop versioned requires on Maven
* Sat Jan 27 2024 Fedora Release Engineering <releng@fedoraproject.org> - 4.2.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Fri Sep 01 2023 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.2.0-5
- Convert License tag to SPDX format
* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 4.2.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Fri Mar 31 2023 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.2.0-3
- Rebuild with no changes
* Fri Mar 31 2023 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.2.0-2
- Rebuild for Maven 3.9.1
* Mon Mar 20 2023 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.2.0-1
- Update to upstream version 4.2.0
* Fri Mar 17 2023 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.1.0-1
- Update to upstream version 4.1.0
* Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.0-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Mon Sep 05 2022 Marian Koncek <mkoncek@redhat.com> - 4.0.0-11
- Mimic maven-javadoc-plugin for -source and --release
- Add simple implementation of toolchains
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.0-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Fri Apr 22 2022 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.0.0-9
- Port to Modello 2.0.0
* Sat Feb 05 2022 Jiri Vanek <jvanek@redhat.com> - 4.0.0-8
- Rebuilt for java-17-openjdk as system jdk
* Thu Jan 27 2022 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.0.0-7
- Suggest OpenJDK 17 as default Maven binding
* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Fri Jan 14 2022 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.0.0-5
- Rebuild for Maven 3.8.4
* Mon Nov 08 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.0.0-4
- For now keep suggesting OpenJDK 11 Maven binding
* Wed Nov 03 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.0.0-3
- Workaround build issue with OpenJDK 17
- Suggest OpenJDK 17 as default Maven binding
* Sun Sep 26 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.0.0-2
- Rebuild to update libjansi.so symlink
* Mon Jul 26 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.0.0-1
- Update to upstream version 4.0.0
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.0~20210709.3b84c99-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Fri Jul 09 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.0.0~20210709.3b84c99-11
- Change logic for JPMS detection by Javadoc MOJO
* Thu Jul 08 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.0.0~20210708.43c7e67-10
- Fix Javadoc generation for non-JPMS project with JDK 11
* Thu Jul 08 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.0.0~20210708.54026c1-9
- Update to latest upstream snapshot
* Tue Jun 01 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.0.0~20191028.da67577-8
- Workaround for rpm bug 447156 - rpm fails to change directory to symlink
* Wed May 26 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.0.0~20191028.da67577-7
- Conditionally enable Ivy connector
* Mon May 17 2021 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.0.0~20191028.da67577-6
- Bootstrap build
- Non-bootstrap build
* Thu Jan 28 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Fri Jul 10 2020 Jiri Vanek <jvanek@redhat.com> - 3.1.0-6
- Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11
* Thu Jul 09 2020 Mat Booth <mat.booth@redhat.com> - 3.1.0-5
- Honour source parameter in javadoc mojo
* Fri Jun 26 2020 Alexander Kurtakov <akurtako@redhat.com> 3.1.0-4
- Rebuild to pick jsr250-api switch to jakarta-annotations.
* Thu Jun 25 2020 Alexander Kurtakov <akurtako@redhat.com> 3.1.0-3
- Ignore test failures as they fail when built Java 11.
* Mon Apr 20 2020 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.0.0~20191028.da67577-5
- Disable Ivy connector
* Wed Feb 19 2020 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.0.0~20191028.da67577-4
- Require maven-jdk-binding
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 3.1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Thu Jan 23 2020 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.0.0~20191028.da67577-3
- Implement toolchain manager
@ -346,6 +387,24 @@ cp -P ${maven_home}/bin/m2.conf %{buildroot}%{_datadir}/%{name}/bin/
* Mon Oct 28 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 4.0.0~20191028.da67577-1
- Update to upstream snapshot of 4.0.0
* Thu Oct 17 2019 Fabio Valentini <decathorpe@gmail.com> - 3.1.0-1
- Update to version 3.1.0.
* Thu Oct 17 2019 Fabio Valentini <decathorpe@gmail.com> - 3.0.0-28
- Bump requirement to maven 3.6.1 and non-compat guava.
* Mon Sep 02 2019 Marian Koncek <mkoncek@redhat.com> - 3.0.0-27
- Port to maven-invoker 3.0.1
* Thu Aug 22 2019 Fabio Valentini <decathorpe@gmail.com> - 3.0.0-26
- Port to xmlunit2.
* Sun Aug 11 2019 Fabio Valentini <decathorpe@gmail.com> - 3.0.0-25
- Disable gradle support by default.
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.0-24
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Jun 28 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.1.0-2
- Prefer namespaced metadata when duplicates are found
@ -364,6 +423,12 @@ cp -P ${maven_home}/bin/m2.conf %{buildroot}%{_datadir}/%{name}/bin/
* Sat Apr 13 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.0.0-22
- Switch to Maven 3.6.1 and non-compat Guava
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.0-23
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Tue Oct 30 2018 Mikolaj Izdebski <mizdebsk@redhat.com> - 3.0.0-22
- Port to Gradle 4.4.1
* Wed Aug 01 2018 Severin Gehwolf <sgehwolf@redhat.com> - 3.0.0-21
- Add requirement on javapackages-tools since scripts use
java-functions.