[aether-connector-okhttp] Update to latest upstream; add patch for aether

Gerard Ryan galileo at fedoraproject.org
Sun May 25 00:00:55 UTC 2014


commit 37b8c337b9ea482dadafa17e2b729aa6a74e7fc8
Author: Gerard Ryan <gerard at ryan.lt>
Date:   Sat May 24 17:30:58 2014 +0100

    Update to latest upstream; add patch for aether

 aether-connector-okhttp-updated-aether-api.patch |  139 ++++++++++++++++++++++
 aether-connector-okhttp.spec                     |   15 ++-
 2 files changed, 151 insertions(+), 3 deletions(-)
---
diff --git a/aether-connector-okhttp-updated-aether-api.patch b/aether-connector-okhttp-updated-aether-api.patch
new file mode 100644
index 0000000..6f3ec48
--- /dev/null
+++ b/aether-connector-okhttp-updated-aether-api.patch
@@ -0,0 +1,139 @@
+--- src/main/java/io/tesla/aether/connector/AetherRepositoryConnector.java.orig	2014-05-01 02:41:07.000000000 +0100
++++ src/main/java/io/tesla/aether/connector/AetherRepositoryConnector.java	2014-05-24 16:17:15.050666912 +0100
+@@ -57,6 +57,7 @@
+ import org.codehaus.plexus.configuration.PlexusConfiguration;
+ import org.eclipse.aether.ConfigurationProperties;
+ import org.eclipse.aether.RepositorySystemSession;
++import org.eclipse.aether.impl.DefaultServiceLocator;
+ import org.eclipse.aether.repository.AuthenticationContext;
+ import org.eclipse.aether.repository.RemoteRepository;
+ import org.eclipse.aether.repository.RepositoryPolicy;
+@@ -68,7 +69,10 @@
+ import org.eclipse.aether.spi.connector.MetadataUpload;
+ import org.eclipse.aether.spi.connector.RepositoryConnector;
+ import org.eclipse.aether.spi.connector.Transfer;
++import org.eclipse.aether.spi.connector.layout.RepositoryLayout;
++import org.eclipse.aether.spi.connector.layout.RepositoryLayoutProvider;
+ import org.eclipse.aether.spi.io.FileProcessor;
++import org.eclipse.aether.spi.locator.ServiceLocator;
+ //import org.eclipse.aether.spi.log.Logger;
+ import org.eclipse.aether.transfer.ArtifactNotFoundException;
+ import org.eclipse.aether.transfer.ArtifactTransferException;
+@@ -76,6 +80,7 @@
+ import org.eclipse.aether.transfer.MetadataNotFoundException;
+ import org.eclipse.aether.transfer.MetadataTransferException;
+ import org.eclipse.aether.transfer.NoRepositoryConnectorException;
++import org.eclipse.aether.transfer.NoRepositoryLayoutException;
+ import org.eclipse.aether.transfer.TransferCancelledException;
+ import org.eclipse.aether.transfer.TransferEvent;
+ import org.eclipse.aether.transfer.TransferEvent.EventType;
+@@ -84,8 +89,6 @@
+ import org.eclipse.aether.transfer.TransferResource;
+ import org.eclipse.aether.util.ChecksumUtils;
+ import org.eclipse.aether.util.ConfigUtils;
+-import org.eclipse.aether.util.repository.layout.MavenDefaultLayout;
+-import org.eclipse.aether.util.repository.layout.RepositoryLayout;
+ import org.slf4j.Logger;
+ import org.slf4j.LoggerFactory;
+ 
+@@ -95,8 +98,10 @@
+ class AetherRepositoryConnector implements RepositoryConnector {
+ 
+   private final Logger logger = LoggerFactory.getLogger(AetherRepositoryConnector.class);
++
++  private final ServiceLocator serviceLocator = new DefaultServiceLocator();
+   
+-  private final RepositoryLayout layout = new MavenDefaultLayout();
++  private final RepositoryLayout layout;
+   private final TransferListener listener;
+   private final RepositorySystemSession session;
+   private final AuthenticationContext repoAuthenticationContext;
+@@ -165,7 +170,7 @@
+     this(repository, session, fileProcessor, null);
+   }
+ 
+-  public AetherRepositoryConnector(RemoteRepository repository, RepositorySystemSession session, FileProcessor fileProcessor, SSLSocketFactory sslSocketFactory) throws NoRepositoryConnectorException {
++    public AetherRepositoryConnector(RemoteRepository repository, RepositorySystemSession session, FileProcessor fileProcessor, SSLSocketFactory sslSocketFactory) throws NoRepositoryConnectorException {
+     //
+     // Right now this only support a Maven layout which is what we mean by type
+     //
+@@ -183,6 +188,13 @@
+     this.fileProcessor = fileProcessor;
+     this.session = session;
+ 
++    RepositoryLayoutProvider repositoryLayoutProvider = serviceLocator.getService(RepositoryLayoutProvider.class);
++    try {
++	this.layout = repositoryLayoutProvider.newRepositoryLayout(session, repository);
++    } catch (NoRepositoryLayoutException e) {
++	throw new RuntimeException(e);
++    }
++
+     AetherClientConfig config = new AetherClientConfig();
+ 
+     repoAuthenticationContext = AuthenticationContext.forRepository(session, repository);
+@@ -284,14 +296,14 @@
+     Collection<GetTask<?>> tasks = new ArrayList<GetTask<?>>();
+ 
+     for (MetadataDownload download : metadataDownloads) {
+-      String resource = layout.getPath(download.getMetadata()).getPath();
++      String resource = layout.getLocation(download.getMetadata(), false).getPath();
+       GetTask<?> task = new GetTask<MetadataTransfer>(resource, download.getFile(), download.getChecksumPolicy(), latch, download, METADATA);
+       tasks.add(task);
+       task.run();
+     }
+ 
+     for (ArtifactDownload download : artifactDownloads) {
+-      String resource = layout.getPath(download.getArtifact()).getPath();
++      String resource = layout.getLocation(download.getArtifact(), false).getPath();
+       GetTask<?> task = new GetTask<ArtifactTransfer>(resource, download.isExistenceCheck() ? null : download.getFile(), download.getChecksumPolicy(), latch, download, ARTIFACT);
+       tasks.add(task);
+       task.run();
+@@ -324,14 +336,14 @@
+     Collection<PutTask<?>> tasks = new ArrayList<PutTask<?>>();
+ 
+     for (ArtifactUpload upload : artifactUploads) {
+-      String path = layout.getPath(upload.getArtifact()).getPath();
++      String path = layout.getLocation(upload.getArtifact(), true).getPath();
+       PutTask<?> task = new PutTask<ArtifactTransfer>(path, upload.getFile(), latch, upload, ARTIFACT);
+       tasks.add(task);
+       task.run();
+     }
+ 
+     for (MetadataUpload upload : metadataUploads) {
+-      String path = layout.getPath(upload.getMetadata()).getPath();
++      String path = layout.getLocation(upload.getMetadata(), true).getPath();
+       PutTask<?> task = new PutTask<MetadataTransfer>(path, upload.getFile(), latch, upload, METADATA);
+       tasks.add(task);
+       task.run();
+@@ -413,7 +425,6 @@
+ 
+     public void run() {
+ 
+-      download.setState(Transfer.State.ACTIVE);
+       String uri = buildUrl(path);
+       TransferResource transferResource = new TransferResource(repository.getUrl(), path, fileInLocalRepository, download.getTrace());
+ 
+@@ -682,7 +693,6 @@
+ 
+     public void flush() {
+       wrapper.wrap(download, exception, repository);
+-      download.setState(Transfer.State.DONE);
+     }
+ 
+     private void rename(File from, File to) throws IOException {
+@@ -713,7 +723,6 @@
+ 
+     public void run() {
+ 
+-      upload.setState(Transfer.State.ACTIVE);
+       final TransferResource transferResource = new TransferResource(repository.getUrl(), path, file, upload.getTrace());
+ 
+       try {
+@@ -762,7 +771,6 @@
+ 
+     public void flush() {
+       wrapper.wrap(upload, exception, repository);
+-      upload.setState(Transfer.State.DONE);
+     }
+ 
+     private void uploadChecksums(File file, String uri) {
diff --git a/aether-connector-okhttp.spec b/aether-connector-okhttp.spec
index 384ba43..c116d8b 100644
--- a/aether-connector-okhttp.spec
+++ b/aether-connector-okhttp.spec
@@ -1,9 +1,9 @@
-%global commit 95e7d981d30ef53dd1d17b26559a2bed6af919f4
+%global commit 889599ceef60cd1577367e97f27d82914d01b9b8
 %global shortcommit %(c=%{commit}; echo ${c:0:7})
 
 Name:           aether-connector-okhttp
-Version:        0.0.11
-Release:        3%{?dist}
+Version:        0.12.0
+Release:        1%{?dist}
 Summary:        OkHttp Aether Connector
 
 # src/main/java/io/tesla/aether/wagon/OkHttpsWagon.java is ASL and EPL
@@ -11,6 +11,9 @@ License:        EPL and (ASL 2.0 and EPL)
 URL:            https://github.com/tesla/%{name}
 Source0:        https://github.com/tesla/%{name}/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz
 Source1:        eclipse-1.0.txt
+
+Patch0:         %{name}-updated-aether-api.patch
+
 BuildArch:      noarch
 
 BuildRequires: mvn(org.eclipse.jetty:jetty-util)
@@ -52,6 +55,8 @@ sed -i -e "s/io.tesla.aether.okhttp.ssl.SslContextFactory/org.eclipse.jetty.util
     -e "s/scf.setTrustStore(trustStorePath)/scf.setTrustStorePath(trustStorePath)/" \
     src/main/java/io/tesla/aether/okhttp/OkHttpAetherClient.java
 
+%patch0 -b .orig
+
 %build
 # We don't have all test deps (e.g. npn-boot)
 %mvn_build --skip-tests
@@ -68,6 +73,10 @@ sed -i -e "s/io.tesla.aether.okhttp.ssl.SslContextFactory/org.eclipse.jetty.util
 %doc eclipse-1.0.txt
 
 %changelog
+* Sat May 24 2014 Gerard Ryan <galileo at fedoraproject.org> - 0.12.0-1
+- Update to latest upstream version 0.12.0
+- Patch for latest aether api
+
 * Tue Mar 04 2014 Stanislav Ochotnicky <sochotnicky at redhat.com> - 0.0.11-3
 - Use Requires: java-headless rebuild (#1067528)
 


More information about the scm-commits mailing list