From fa9d04d71041f462a2bfd204339ec1fa7564d4e6d948bf25a4484a9f192813bd Mon Sep 17 00:00:00 2001 From: Fridrich Strba Date: Mon, 25 Mar 2019 16:04:16 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/Java:packages/maven-common-artifact-filters?expand=0&rev=1 --- .gitattributes | 23 ++ .gitignore | 1 + 0001-Remove-Maven-3.0-specific-code.patch | 55 +++++ ...-artifact-filters-3.0.1-source-release.zip | 3 + maven-common-artifact-filters-build.xml | 232 ++++++++++++++++++ maven-common-artifact-filters.changes | 5 + maven-common-artifact-filters.spec | 111 +++++++++ 7 files changed, 430 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 0001-Remove-Maven-3.0-specific-code.patch create mode 100644 maven-common-artifact-filters-3.0.1-source-release.zip create mode 100644 maven-common-artifact-filters-build.xml create mode 100644 maven-common-artifact-filters.changes create mode 100644 maven-common-artifact-filters.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/0001-Remove-Maven-3.0-specific-code.patch b/0001-Remove-Maven-3.0-specific-code.patch new file mode 100644 index 0000000..eb101f6 --- /dev/null +++ b/0001-Remove-Maven-3.0-specific-code.patch @@ -0,0 +1,55 @@ +From 2adad987d89aa6ab94fa1351756730c3c09dd35d Mon Sep 17 00:00:00 2001 +From: Mikolaj Izdebski +Date: Mon, 12 Oct 2015 13:03:40 +0200 +Subject: [PATCH] Remove Maven 3.0 specific code + +--- + .../collection/ArtifactTransitivityFilter.java | 32 +--------------------- + 1 file changed, 1 insertion(+), 31 deletions(-) + +diff --git a/src/main/java/org/apache/maven/shared/artifact/filter/collection/ArtifactTransitivityFilter.java b/src/main/java/org/apache/maven/shared/artifact/filter/collection/ArtifactTransitivityFilter.java +index 7db1664..df749db 100644 +--- a/src/main/java/org/apache/maven/shared/artifact/filter/collection/ArtifactTransitivityFilter.java ++++ b/src/main/java/org/apache/maven/shared/artifact/filter/collection/ArtifactTransitivityFilter.java +@@ -116,37 +116,7 @@ public class ArtifactTransitivityFilter + } + else + { +- try +- { +- @SuppressWarnings( "unchecked" ) List dependencies = +- (List) Invoker.invoke( resolutionResult, +- "getDependencies" ); +- +- for ( org.sonatype.aether.graph.Dependency dependency : dependencies ) +- { +- Artifact mavenArtifact = +- (Artifact) Invoker.invoke( RepositoryUtils.class, "toArtifact", +- org.sonatype.aether.artifact.Artifact.class, +- dependency.getArtifact() ); +- +- transitiveArtifacts.add( mavenArtifact.getDependencyConflictId() ); +- } +- } +- catch ( IllegalAccessException e ) +- { +- // don't want to pollute method signature with ReflectionExceptions +- throw new RuntimeException( e.getMessage(), e ); +- } +- catch ( InvocationTargetException e ) +- { +- // don't want to pollute method signature with ReflectionExceptions +- throw new RuntimeException( e.getMessage(), e ); +- } +- catch ( NoSuchMethodException e ) +- { +- // don't want to pollute method signature with ReflectionExceptions +- throw new RuntimeException( e.getMessage(), e ); +- } ++ throw new RuntimeException( "Maven older than 3.1 are not supported" ); + } + } + } +-- +2.7.4 + diff --git a/maven-common-artifact-filters-3.0.1-source-release.zip b/maven-common-artifact-filters-3.0.1-source-release.zip new file mode 100644 index 0000000..d272558 --- /dev/null +++ b/maven-common-artifact-filters-3.0.1-source-release.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:657ba86bbaa54d368e5c6ebd61559b5505cefdb0b128d100161ca89ad8b4ad61 +size 105661 diff --git a/maven-common-artifact-filters-build.xml b/maven-common-artifact-filters-build.xml new file mode 100644 index 0000000..ea78346 --- /dev/null +++ b/maven-common-artifact-filters-build.xml @@ -0,0 +1,232 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + =================================== WARNING =================================== + JUnit is not present in the test classpath or your $ANT_HOME/lib directory. Tests not executed. + =============================================================================== + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/maven-common-artifact-filters.changes b/maven-common-artifact-filters.changes new file mode 100644 index 0000000..7884d47 --- /dev/null +++ b/maven-common-artifact-filters.changes @@ -0,0 +1,5 @@ +------------------------------------------------------------------- +Mon Mar 25 16:02:51 UTC 2019 - Fridrich Strba + +- Initial packaging of maven-common-artifact-filters 3.0.1 +- Generate and customize the ant build.xml file diff --git a/maven-common-artifact-filters.spec b/maven-common-artifact-filters.spec new file mode 100644 index 0000000..c1deca8 --- /dev/null +++ b/maven-common-artifact-filters.spec @@ -0,0 +1,111 @@ +# +# spec file for package maven-common-artifact-filters +# +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# +# 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/ +# + +%bcond_with tests +Name: maven-common-artifact-filters +Version: 3.0.1 +Release: 0 +Summary: Maven Common Artifact Filters +License: Apache-2.0 +Group: Development/Libraries/Java +URL: http://maven.apache.org/shared/ +Source0: http://repo1.maven.org/maven2/org/apache/maven/shared/%{name}/%{version}/%{name}-%{version}-source-release.zip +Source1: %{name}-build.xml +Patch0: 0001-Remove-Maven-3.0-specific-code.patch +BuildRequires: ant +BuildRequires: fdupes +BuildRequires: javapackages-local +BuildRequires: maven-lib +BuildRequires: maven-resolver-api +BuildRequires: maven-resolver-util +BuildRequires: maven-shared-utils +BuildRequires: sisu-plexus +BuildRequires: unzip +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: apache-commons-lang3 +BuildRequires: easymock +BuildRequires: maven-plugin-testing-harness +BuildRequires: plexus-archiver +BuildRequires: plexus-utils +%endif + +%description +A collection of ready-made filters to control inclusion/exclusion of artifacts +during dependency resolution. + +%package javadoc +Summary: Javadoc for %{name} +Group: Development/Libraries/Java + +%description javadoc +This package contains javadoc for %{name}. + +%prep +%setup -q +cp %{SOURCE1} build.xml +%patch0 -p1 + +# We don't want to support legacy Maven versions (older than 3.1) +%pom_remove_dep org.sonatype.sisu: +%pom_remove_dep org.sonatype.aether: +find -name SonatypeAether\*.java -delete + +%build +mkdir -p lib +build-jar-repository -s lib \ + maven/maven-artifact \ + maven/maven-core \ + maven/maven-model \ + maven/maven-model-builder \ + maven/maven-plugin-api \ + maven-resolver/maven-resolver-api \ + maven-resolver/maven-resolver-util \ + maven-shared-utils/maven-shared-utils \ + org.eclipse.sisu.plexus +%if %{with tests} +build-jar-repository -s lib \ + commons-lang3 \ + easymock \ + maven-plugin-testing/maven-plugin-testing-harness \ + plexus/archiver \ + plexus/utils +%endif + +%{ant} \ +%if %{without tests} + -Dtest.skip=true \ +%endif + jar javadoc + +%mvn_artifact pom.xml target/%{name}-%{version}.jar + +%install +%mvn_install +%fdupes -s %{buildroot}%{_javadocdir} + +%files -f .mfiles +%license LICENSE NOTICE + +%files javadoc -f .mfiles-javadoc +%license LICENSE NOTICE + +%changelog