File jetty-test-helper.spec of Package jetty-test-helper

#
# spec file for package jetty-test-helper
#
# Copyright (c) 2023 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


Name:           jetty-test-helper
Version:        4.2.1
Release:        0
Summary:        Jetty toolchain test helper
License:        Apache-2.0 OR EPL-1.0
Group:          Development/Libraries/Java
URL:            https://github.com/eclipse/jetty.toolchain
Source0:        %{name}-%{version}.tar.xz
Source1:        http://www.eclipse.org/legal/epl-v10.html
Source2:        http://www.apache.org/licenses/LICENSE-2.0.txt
Patch0:         %{name}-hamcrest22.patch
BuildRequires:  fdupes
BuildRequires:  java-devel >= 1.8
BuildRequires:  maven-local
BuildRequires:  xz
BuildRequires:  mvn(junit:junit)
BuildRequires:  mvn(org.apache.maven.plugins:maven-remote-resources-plugin)
BuildRequires:  mvn(org.eclipse.jetty.toolchain:jetty-artifact-remote-resources)
BuildRequires:  mvn(org.eclipse.jetty.toolchain:jetty-toolchain:pom:)
BuildRequires:  mvn(org.hamcrest:hamcrest-library)
BuildArch:      noarch

%description
Unit Testing Support for Jetty (common classes for some unit tests).

%package        javadoc
Summary:        Javadoc %{name}
Group:          Development/Libraries/Java

%description javadoc
This package contains the API documentation for %{name}.

%prep
%setup -q
%patch -P 0 -p1

find -name '*.?ar' -delete
find -name '*.class' -delete

cp %{SOURCE1} %{SOURCE2} .

%pom_remove_plugin :maven-pmd-plugin
%pom_remove_plugin :license-maven-plugin
%pom_remove_plugin :maven-javadoc-plugin
%pom_remove_plugin :maven-source-plugin

%pom_xpath_set "pom:plugin[pom:artifactId[text()='maven-compiler-plugin']]/pom:configuration/pom:source" "1.8"
%pom_xpath_set "pom:plugin[pom:artifactId[text()='maven-compiler-plugin']]/pom:configuration/pom:target" "1.8"

%pom_xpath_remove pom:project/pom:parent/pom:relativePath

%build
%{mvn_build} -f -- -Dsource=8

%install
%mvn_install
%fdupes -s %{buildroot}%{_javadocdir}

%files -f .mfiles
%license epl-v10.html LICENSE-2.0.txt header-template.txt

%files javadoc -f .mfiles-javadoc
%license epl-v10.html LICENSE-2.0.txt header-template.txt

%changelog
openSUSE Build Service is sponsored by