RHEL 9.0.0 Alpha bootstrap

The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/maven-resolver#4e1bd7bf40d642a1287ee0d4f04cafedeb92704b
This commit is contained in:
Petr Šabata 2020-10-15 19:23:44 +02:00
parent 2d4f397205
commit 145a9afd59
4 changed files with 402 additions and 0 deletions

10
.gitignore vendored
View File

@ -0,0 +1,10 @@
/results_*
/*.src.rpm
/maven-resolver-1.0.3-source-release.zip
/maven-resolver-1.1.0-source-release.zip
/maven-resolver-1.1.1-source-release.zip
/maven-resolver-1.3.1-source-release.zip
/maven-resolver-1.3.3-source-release.zip
/maven-resolver-1.4.1-source-release.zip
/maven-resolver-1.4.2-source-release.zip

View File

@ -0,0 +1,147 @@
diff --git a/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/CacheUtils.java b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/CacheUtils.java
new file mode 100644
index 0000000..d7e8f01
--- /dev/null
+++ b/maven-resolver-impl/src/main/java/org/eclipse/aether/internal/impl/CacheUtils.java
@@ -0,0 +1,141 @@
+package org.eclipse.aether.internal.impl;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.aether.RepositorySystemSession;
+import org.eclipse.aether.repository.ArtifactRepository;
+import org.eclipse.aether.repository.LocalRepository;
+import org.eclipse.aether.repository.RemoteRepository;
+import org.eclipse.aether.repository.RepositoryPolicy;
+import org.eclipse.aether.repository.WorkspaceReader;
+import org.eclipse.aether.repository.WorkspaceRepository;
+
+/**
+ * @deprecated To be deleted without replacement.
+ */
+@Deprecated
+public final class CacheUtils
+{
+
+ public static <T> boolean eq( T s1, T s2 )
+ {
+ return s1 != null ? s1.equals( s2 ) : s2 == null;
+ }
+
+ public static int hash( Object obj )
+ {
+ return obj != null ? obj.hashCode() : 0;
+ }
+
+ public static int repositoriesHashCode( List<RemoteRepository> repositories )
+ {
+ int result = 17;
+ for ( RemoteRepository repository : repositories )
+ {
+ result = 31 * result + repositoryHashCode( repository );
+ }
+ return result;
+ }
+
+ private static int repositoryHashCode( RemoteRepository repository )
+ {
+ int result = 17;
+ result = 31 * result + hash( repository.getUrl() );
+ return result;
+ }
+
+ private static boolean repositoryEquals( RemoteRepository r1, RemoteRepository r2 )
+ {
+ if ( r1 == r2 )
+ {
+ return true;
+ }
+
+ return eq( r1.getId(), r2.getId() ) && eq( r1.getUrl(), r2.getUrl() )
+ && policyEquals( r1.getPolicy( false ), r2.getPolicy( false ) )
+ && policyEquals( r1.getPolicy( true ), r2.getPolicy( true ) );
+ }
+
+ private static boolean policyEquals( RepositoryPolicy p1, RepositoryPolicy p2 )
+ {
+ if ( p1 == p2 )
+ {
+ return true;
+ }
+ // update policy doesn't affect contents
+ return p1.isEnabled() == p2.isEnabled() && eq( p1.getChecksumPolicy(), p2.getChecksumPolicy() );
+ }
+
+ public static boolean repositoriesEquals( List<RemoteRepository> r1, List<RemoteRepository> r2 )
+ {
+ if ( r1.size() != r2.size() )
+ {
+ return false;
+ }
+
+ for ( Iterator<RemoteRepository> it1 = r1.iterator(), it2 = r2.iterator(); it1.hasNext(); )
+ {
+ if ( !repositoryEquals( it1.next(), it2.next() ) )
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ public static WorkspaceRepository getWorkspace( RepositorySystemSession session )
+ {
+ WorkspaceReader reader = session.getWorkspaceReader();
+ return ( reader != null ) ? reader.getRepository() : null;
+ }
+
+ public static ArtifactRepository getRepository( RepositorySystemSession session,
+ List<RemoteRepository> repositories, Class<?> repoClass,
+ String repoId )
+ {
+ if ( repoClass != null )
+ {
+ if ( WorkspaceRepository.class.isAssignableFrom( repoClass ) )
+ {
+ return session.getWorkspaceReader().getRepository();
+ }
+ else if ( LocalRepository.class.isAssignableFrom( repoClass ) )
+ {
+ return session.getLocalRepository();
+ }
+ else
+ {
+ for ( RemoteRepository repository : repositories )
+ {
+ if ( repoId.equals( repository.getId() ) )
+ {
+ return repository;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+}

244
maven-resolver.spec Normal file
View File

@ -0,0 +1,244 @@
Name: maven-resolver
Epoch: 1
Version: 1.4.2
Release: 3%{?dist}
Summary: Apache Maven Artifact Resolver library
License: ASL 2.0
URL: https://maven.apache.org/resolver/
Source0: https://archive.apache.org/dist/maven/resolver/%{name}-%{version}-source-release.zip
# keep deprecated and removed aether CacheUtils for a while longer
# some packages still depend on this and things break without it
Patch0: 00-keep-deprecated-aether-CacheUtils.patch
BuildArch: noarch
BuildRequires: maven-local
BuildRequires: mvn(javax.inject:javax.inject)
BuildRequires: mvn(junit:junit)
BuildRequires: mvn(org.apache.felix:maven-bundle-plugin)
BuildRequires: mvn(org.apache.httpcomponents:httpclient)
BuildRequires: mvn(org.apache.httpcomponents:httpcore)
BuildRequires: mvn(org.apache.maven:maven-parent:pom:)
BuildRequires: mvn(org.apache.maven.wagon:wagon-provider-api)
BuildRequires: mvn(org.codehaus.plexus:plexus-classworlds)
BuildRequires: mvn(org.codehaus.plexus:plexus-utils)
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.hamcrest:hamcrest-core)
BuildRequires: mvn(org.mockito:mockito-core)
BuildRequires: mvn(org.slf4j:jcl-over-slf4j)
BuildRequires: mvn(org.slf4j:slf4j-api)
BuildRequires: mvn(org.slf4j:slf4j-simple)
BuildRequires: mvn(org.sonatype.sisu:sisu-guice::no_aop:)
%description
Apache Maven Artifact Resolver is a library for working with artifact
repositories and dependency resolution. Maven Artifact Resolver deals with the
specification of local repository, remote repository, developer workspaces,
artifact transports and artifact resolution.
%package api
Summary: Maven Artifact Resolver API
%description api
The application programming interface for the repository system.
%package spi
Summary: Maven Artifact Resolver SPI
%description spi
The service provider interface for repository system implementations and
repository connectors.
%package util
Summary: Maven Artifact Resolver Utilities
%description util
A collection of utility classes to ease usage of the repository system.
%package impl
Summary: Maven Artifact Resolver Implementation
%description impl
An implementation of the repository system.
%package test-util
Summary: Maven Artifact Resolver Test Utilities
%description test-util
A collection of utility classes to ease testing of the repository system.
%package connector-basic
Summary: Maven Artifact Resolver Connector Basic
%description connector-basic
A repository connector implementation for repositories using URI-based layouts.
%package transport-classpath
Summary: Maven Artifact Resolver Transport Classpath
%description transport-classpath
A transport implementation for repositories using classpath:// URLs.
%package transport-file
Summary: Maven Artifact Resolver Transport File
%description transport-file
A transport implementation for repositories using file:// URLs.
%package transport-http
Summary: Maven Artifact Resolver Transport HTTP
%description transport-http
A transport implementation for repositories using http:// and https:// URLs.
%package transport-wagon
Summary: Maven Artifact Resolver Transport Wagon
%description transport-wagon
A transport implementation based on Maven Wagon.
%package javadoc
Summary: API documentation for %{name}
%description javadoc
This package provides %{summary}.
%prep
%setup -q
%patch0 -p1
# tests require jetty 7
%pom_remove_dep :::test maven-resolver-transport-http
rm -r maven-resolver-transport-http/src/test
%pom_disable_module maven-resolver-demos
# generate OSGi manifests
for pom in $(find -mindepth 2 -name pom.xml) ; do
%pom_add_plugin "org.apache.felix:maven-bundle-plugin" $pom \
"<configuration>
<instructions>
<Bundle-SymbolicName>\${project.groupId}$(sed 's:./maven-resolver::;s:/pom.xml::;s:-:.:g' <<< $pom)</Bundle-SymbolicName>
<Export-Package>!org.eclipse.aether.internal*,org.eclipse.aether*</Export-Package>
<_nouses>true</_nouses>
</instructions>
</configuration>
<executions>
<execution>
<id>create-manifest</id>
<phase>process-classes</phase>
<goals><goal>manifest</goal></goals>
</execution>
</executions>"
done
%pom_add_plugin "org.apache.maven.plugins:maven-jar-plugin" pom.xml \
"<configuration>
<archive>
<manifestFile>\${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
</archive>
</configuration>"
%mvn_package :maven-resolver
%mvn_alias 'org.apache.maven.resolver:maven-resolver{*}' 'org.eclipse.aether:aether@1'
%mvn_file ':maven-resolver{*}' %{name}/maven-resolver@1 aether/aether@1
%build
%mvn_build -s
%install
%mvn_install
%files -f .mfiles
%license LICENSE NOTICE
%files api -f .mfiles-%{name}-api
%license LICENSE NOTICE
%files spi -f .mfiles-%{name}-spi
%files util -f .mfiles-%{name}-util
%files impl -f .mfiles-%{name}-impl
%files test-util -f .mfiles-%{name}-test-util
%files connector-basic -f .mfiles-%{name}-connector-basic
%files transport-classpath -f .mfiles-%{name}-transport-classpath
%files transport-file -f .mfiles-%{name}-transport-file
%files transport-http -f .mfiles-%{name}-transport-http
%files transport-wagon -f .mfiles-%{name}-transport-wagon
%files javadoc -f .mfiles-javadoc
%license LICENSE NOTICE
%changelog
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:1.4.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Fri Jul 10 2020 Jiri Vanek <jvanek@redhat.com> - 1:1.4.2-2
- Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11
* Sat May 09 2020 Fabio Valentini <decathorpe@gmail.com> - 1:1.4.2-1
- Update to version 1.4.2.
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1:1.4.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Sun Nov 03 2019 Fabio Valentini <decathorpe@gmail.com> - 1:1.4.1-1
- Update to version 1.4.1.
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:1.3.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Tue May 14 2019 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:1.3.3-1
- Update to upstream version 1.3.3
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1:1.3.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Tue Oct 23 2018 Marian Koncek <mkoncek@redhat.com> - 1:1.3.1-1
- Update to upstream version 1.3.1
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1:1.1.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Wed Apr 18 2018 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:1.1.1-2
- Remove aether provides
* Mon Feb 26 2018 Michael Simacek <msimacek@redhat.com> - 1:1.1.1-1
- Update to upstream version 1.1.1
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1:1.1.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Mon Nov 27 2017 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:1.1.0-2
- Obsolete aether-ant-tasks
- Resolves: rhbz#1516043
* Wed Oct 25 2017 Michael Simacek <msimacek@redhat.com> - 1:1.1.0-1
- Update to upstream version 1.1.0
* Thu Aug 24 2017 Mat Booth <mat.booth@redhat.com> - 1:1.0.3-7
- Fix OSGi metadata to also export "impl" packages; "internal" packages remain
unexported
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1:1.0.3-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Wed May 24 2017 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:1.0.3-5
- Add aether alias for main POM file
* Tue May 23 2017 Mikolaj Izdebski <mizdebsk@redhat.com> - 1:1.0.3-4
- Fix duplicate Bundle-SymbolicName in OSGi manifests
* Mon May 15 2017 Mat Booth <mat.booth@redhat.com> - 1:1.0.3-3
- Restore OSGi metadata that was lost in the switch from "aether" to
"maven-resolver"
* Wed Apr 12 2017 Michael Simacek <msimacek@redhat.com> - 1:1.0.3-2
- Split into subpackages
- Obsolete and provide aether
* Tue Apr 11 2017 Michael Simacek <msimacek@redhat.com> - 1.0.3-1
- Initial packaging

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (maven-resolver-1.4.2-source-release.zip) = 5d9513333da44e5d9b6097c8681a33f273ee78f797cdf7055be5cbf4d6c161e9e1e91a610b420201667a93ecc1f5c9a0a4a60fc1af2edfddb4c4e5d33f76ab40