Accepting request 1109367 from Java:packages

Reduce dependencies a bit

OBS-URL: https://build.opensuse.org/request/show/1109367
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/maven-artifact-transfer?expand=0&rev=7
This commit is contained in:
Ana Guerrero 2023-09-07 19:13:00 +00:00 committed by Git OBS Bridge
commit 6abd1a641a
3 changed files with 20 additions and 98 deletions

View File

@ -40,11 +40,6 @@
<include name="**/*.jar"/>
</fileset>
</path>
<path id="build.test.classpath">
<fileset dir="lib">
<include name="**/*.jar"/>
</fileset>
</path>
<!-- ====================================================================== -->
<!-- Cleaning up target -->
@ -134,74 +129,6 @@
</javac>
</target>
<!-- ====================================================================== -->
<!-- Run all tests -->
<!-- ====================================================================== -->
<target name="test"
depends="compile-tests, junit-missing"
unless="junit.skipped"
description="Run the test cases">
<condition property="modularJava">
<javaversion atleast="9"/>
</condition>
<mkdir dir="${test.reports}"/>
<junit printSummary="yes" haltonerror="true" haltonfailure="true" fork="true" dir=".">
<jvmarg line="--add-opens java.base/java.io=ALL-UNNAMED" if:set="modularJava"/>
<jvmarg line="--add-opens java.base/java.lang=ALL-UNNAMED" if:set="modularJava"/>
<sysproperty key="basedir" value="."/>
<formatter type="xml"/>
<formatter type="plain" usefile="false"/>
<classpath>
<path refid="build.test.classpath"/>
<pathelement location="${build.outputDir}"/>
<pathelement location="${build.testOutputDir}"/>
</classpath>
<batchtest todir="${test.reports}" unless="test">
<fileset dir="${build.testDir}">
<include name="**/Test*.java"/>
<include name="**/*Test.java"/>
<include name="**/*TestCase.java"/>
<exclude name="**/*Abstract*Test.java"/>
</fileset>
</batchtest>
<batchtest todir="${test.reports}" if="test">
<fileset dir="${build.testDir}">
<include name="**/${test}.java"/>
<exclude name="**/*Abstract*Test.java"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="test-junit-present">
<available classname="junit.framework.Test" property="junit.present" classpathref="build.test.classpath"/>
</target>
<target name="test-junit-status"
depends="test-junit-present">
<condition property="junit.missing">
<and>
<isfalse value="${junit.present}"/>
<isfalse value="${test.skip}"/>
</and>
</condition>
<condition property="junit.skipped">
<or>
<isfalse value="${junit.present}"/>
<istrue value="${test.skip}"/>
</or>
</condition>
</target>
<target name="junit-missing"
depends="test-junit-status"
if="junit.missing">
<echo>=================================== WARNING ===================================</echo>
<echo> JUnit is not present in the test classpath or your $ANT_HOME/lib directory. Tests not executed.</echo>
<echo>===============================================================================</echo>
</target>
<!-- ====================================================================== -->
<!-- Javadoc target -->
<!-- ====================================================================== -->
@ -235,7 +162,7 @@
<!-- Package target -->
<!-- ====================================================================== -->
<target name="package" depends="plexus,test" description="Package the application">
<target name="package" depends="plexus" description="Package the application">
<jar jarfile="${build.dir}/${build.finalName}.jar"
compress="true"
index="false"

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed Sep 6 22:19:42 UTC 2023 - Fridrich Strba <fstrba@suse.com>
- Remove unnecessary dependency on xmvn tools and parent pom
-------------------------------------------------------------------
Wed May 11 13:25:18 UTC 2022 - Fridrich Strba <fstrba@suse.com>

View File

@ -1,7 +1,7 @@
#
# spec file for package maven-artifact-transfer
#
# Copyright (c) 2022 SUSE LLC
# 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
@ -16,7 +16,6 @@
#
%bcond_with tests
Name: maven-artifact-transfer
Version: 0.13.1
Release: 0
@ -36,7 +35,7 @@ BuildRequires: atinject
BuildRequires: fdupes
BuildRequires: google-guice
BuildRequires: guava
BuildRequires: javapackages-local
BuildRequires: javapackages-local >= 6
BuildRequires: jdom2
BuildRequires: maven-common-artifact-filters
BuildRequires: maven-lib
@ -55,16 +54,7 @@ BuildRequires: sisu-plexus
BuildRequires: slf4j
BuildRequires: unzip
BuildRequires: xbean
BuildRequires: xmvn-install
BuildRequires: xmvn-resolve
BuildRequires: mvn(org.apache.maven.shared:maven-shared-components:pom:)
BuildArch: noarch
%if %{with tests}
BuildRequires: ant-junit
BuildRequires: cglib
BuildRequires: mockito
BuildRequires: objenesis
%endif
%description
An API to either install or deploy artifacts with Maven 3.
@ -94,11 +84,6 @@ find -name Maven30\*.java -delete
%build
mkdir -p lib
build-jar-repository -s lib \
%if %{with tests}
cglib/cglib \
mockito/mockito-core \
objenesis/objenesis \
%endif
atinject \
commons-cli \
commons-codec \
@ -126,21 +111,26 @@ build-jar-repository -s lib \
xbean/xbean-reflect
%{ant} \
%if %{without tests}
-Dtest.skip=true \
%endif
package javadoc
%{mvn_artifact} pom.xml target/%{name}-%{version}.jar
%install
%mvn_install
# jar
install -dm 0755 %{buildroot}%{_javadir}/%{name}
install -pm 0644 target/%{name}-%{version}.jar %{buildroot}%{_javadir}/%{name}/%{name}.jar
# pom
install -dm 0755 %{buildroot}%{_mavenpomdir}/%{name}
%{mvn_install_pom} pom.xml %{buildroot}%{_mavenpomdir}/%{name}/%{name}.pom
%add_maven_depmap %{name}/%{name}.pom %{name}/%{name}.jar
# javadoc
install -dm 0755 %{buildroot}%{_javadocdir}/%{name}
cp -pr target/site/apidocs/* %{buildroot}%{_javadocdir}/%{name}/
%fdupes -s %{buildroot}%{_javadocdir}
%files -f .mfiles
%license LICENSE NOTICE
%files javadoc -f .mfiles-javadoc
%files javadoc
%{_javadocdir}/%{name}
%license LICENSE NOTICE
%changelog