[gradle] 01/03: Fix compatibility with Maven 3.3.3 and eclipse-aether
Kai-Chung Yan
seamlik-guest at moszumanska.debian.org
Mon Jul 13 14:31:32 UTC 2015
This is an automated email from the git hooks/post-receive script.
seamlik-guest pushed a commit to branch master
in repository gradle.
commit 3b487774594d0c81e50c34940c31351cf66d4d87
Author: Kai-Chung Yan <seamlikok at gmail.com>
Date: Mon Jul 13 22:27:44 2015 +0800
Fix compatibility with Maven 3.3.3 and eclipse-aether
---
debian/changelog | 4 +-
debian/control | 5 +-
debian/patches/eclipse-aether.diff | 194 ++++++++++++++++++++++++++++++
debian/patches/maven-aether-provider.diff | 23 ++++
debian/patches/series | 2 +
debian/patches/use_local_artifacts.diff | 10 +-
6 files changed, 230 insertions(+), 8 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index a3cfd48..ee524d6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,10 +8,10 @@ gradle (2.5-1) UNRELEASED; urgency=low
Remove libjna-posix-java
Remove ant-optional
Remove libplexus-container-default-java
+ Change maven to libmaven3-core-java (>= 3.3.3)
* d/watch: Watch services.gradle.org
* d/copyright: Add Files-Excluded for uscan
* d/rules: Simplify get-orig-source target
- * Refresh all existing patches
* Drop multiple patches under d/patches/:
- 03_plexus.diff: Files not exist
- 11_fix_jni_path.diff: Files not exist
@@ -33,6 +33,8 @@ gradle (2.5-1) UNRELEASED; urgency=low
- maven_testng.diff: Maven module uses a deprecated API from testng
- nekohtml.diff: Fix nekohtml usage
- relax_warnings.diff: strictCompile.gradle is too strict
+ - eclipse-aether.diff: Original aether is deprecated
+ - maven-aether-provider.diff: Used deprecated API of maven-aether-provider
* gradle-doc no longer provides Gradle User Guide and DSL Reference because
missing Sonar plugins causes their compilation produce errors.
diff --git a/debian/control b/debian/control
index 3405db3..97ef05a 100644
--- a/debian/control
+++ b/debian/control
@@ -49,6 +49,7 @@ Build-Depends: ant,
libjs-jquery,
libkryo-java,
liblogback-java,
+ libmaven3-core-java (>= 3.3.3),
libnative-platform-java (>= 0.10),
libnekohtml-java,
libobjenesis-java,
@@ -126,7 +127,7 @@ Breaks: libgradle-wrapper-java,
libgradle-plugins-java (<< 1.12)
Replaces: libgradle-wrapper-java,
libgradle-plugins-java (<< 1.12)
-Description: Powerful build system for the JVM - Core library
+Description: Powerful build system for the JVM - Core libraries
Gradle is a build tool with a focus on build automation and support for
multi-language development. If you are building, testing, publishing, and
deploying software on any platform, Gradle offers a flexible model that can
@@ -156,6 +157,7 @@ Depends: bnd (>= 2.1.0),
libjetty-java,
libjetty-extra-java,
libjs-jquery,
+ libmaven3-core-java (>= 3.3.3),
libobjenesis-java,
libplexus-containers1.5-java,
libplexus-interpolation-java,
@@ -165,7 +167,6 @@ Depends: bnd (>= 2.1.0),
libservlet2.5-java,
libtomcat7-java,
libxerces2-java,
- maven (>= 3),
testng,
${misc:Depends}
Breaks: libgradle-announce-java,
diff --git a/debian/patches/eclipse-aether.diff b/debian/patches/eclipse-aether.diff
new file mode 100644
index 0000000..2d90c53
--- /dev/null
+++ b/debian/patches/eclipse-aether.diff
@@ -0,0 +1,194 @@
+Description: Maven module originally uses aether which is deprecated. This
+ patch changes it to use eclipse-aether.
+Author: Kai-Chung Yan <seamlikok at gmail.com>
+Last-Update: 2015-07-13
+--- a/subprojects/maven/src/main/groovy/org/gradle/api/publication/maven/internal/action/SnapshotVersionManager.java
++++ b/subprojects/maven/src/main/groovy/org/gradle/api/publication/maven/internal/action/SnapshotVersionManager.java
+@@ -17,16 +17,16 @@
+ package org.gradle.api.publication.maven.internal.action;
+
+ import org.gradle.internal.UncheckedException;
+-import org.sonatype.aether.RepositorySystem;
+-import org.sonatype.aether.RepositorySystemSession;
+-import org.sonatype.aether.artifact.Artifact;
+-import org.sonatype.aether.deployment.DeployRequest;
+-import org.sonatype.aether.impl.MetadataGenerator;
+-import org.sonatype.aether.impl.MetadataGeneratorFactory;
+-import org.sonatype.aether.impl.internal.DefaultDeployer;
+-import org.sonatype.aether.impl.internal.DefaultRepositorySystem;
+-import org.sonatype.aether.installation.InstallRequest;
+-import org.sonatype.aether.metadata.Metadata;
++import org.eclipse.aether.RepositorySystem;
++import org.eclipse.aether.RepositorySystemSession;
++import org.eclipse.aether.artifact.Artifact;
++import org.eclipse.aether.deployment.DeployRequest;
++import org.eclipse.aether.impl.MetadataGenerator;
++import org.eclipse.aether.impl.MetadataGeneratorFactory;
++import org.eclipse.aether.internal.impl.DefaultDeployer;
++import org.eclipse.aether.internal.impl.DefaultRepositorySystem;
++import org.eclipse.aether.installation.InstallRequest;
++import org.eclipse.aether.metadata.Metadata;
+
+ import java.lang.reflect.Field;
+ import java.util.Collection;
+@@ -53,8 +53,8 @@
+ }
+
+ @Override
+- public int getPriority() {
+- return -100;
++ public float getPriority() {
++ return -100.0F;
+ }
+
+ @Override
+--- a/subprojects/maven/src/main/groovy/org/gradle/api/publication/maven/internal/action/MavenDeployAction.java
++++ b/subprojects/maven/src/main/groovy/org/gradle/api/publication/maven/internal/action/MavenDeployAction.java
+@@ -19,14 +19,14 @@
+ import java.util.Collection;
+
+ import org.apache.maven.artifact.ant.RemoteRepository;
+-import org.sonatype.aether.RepositorySystem;
+-import org.sonatype.aether.RepositorySystemSession;
+-import org.sonatype.aether.artifact.Artifact;
+-import org.sonatype.aether.deployment.DeployRequest;
+-import org.sonatype.aether.deployment.DeploymentException;
+-import org.sonatype.aether.repository.Authentication;
+-import org.sonatype.aether.repository.Proxy;
+-import org.sonatype.aether.util.repository.DefaultProxySelector;
++import org.eclipse.aether.RepositorySystem;
++import org.eclipse.aether.RepositorySystemSession;
++import org.eclipse.aether.artifact.Artifact;
++import org.eclipse.aether.deployment.DeployRequest;
++import org.eclipse.aether.deployment.DeploymentException;
++import org.eclipse.aether.repository.Authentication;
++import org.eclipse.aether.repository.Proxy;
++import org.eclipse.aether.util.repository.DefaultProxySelector;
+ import org.gradle.api.GradleException;
+ import org.slf4j.Logger;
+ import org.slf4j.LoggerFactory;
+@@ -61,7 +61,7 @@
+ throw new GradleException("Must specify a repository for deployment");
+ }
+
+- org.sonatype.aether.repository.RemoteRepository aetherRepo = createRepository(gradleRepo);
++ org.eclipse.aether.repository.RemoteRepository aetherRepo = createRepository(gradleRepo);
+
+ DeployRequest request = new DeployRequest();
+ request.setRepository(aetherRepo);
+@@ -75,23 +75,27 @@
+ repositorySystem.deploy(session, request);
+ }
+
+- private org.sonatype.aether.repository.RemoteRepository createRepository(RemoteRepository gradleRepo) {
+- org.sonatype.aether.repository.RemoteRepository repo = new org.sonatype.aether.repository.RemoteRepository("remote",
++ private org.eclipse.aether.repository.RemoteRepository createRepository(RemoteRepository gradleRepo) {
++ org.eclipse.aether.repository.RemoteRepository.Builder repo = new org.eclipse.aether.repository.RemoteRepository.Builder("remote",
+ gradleRepo.getLayout(), gradleRepo.getUrl());
+
+ org.apache.maven.artifact.ant.Authentication auth = gradleRepo.getAuthentication();
+ if (auth != null) {
+- repo.setAuthentication(new Authentication(auth.getUserName(), auth.getPassword(), auth.getPrivateKey(), auth.getPassphrase()));
++ org.eclipse.aether.util.repository.AuthenticationBuilder authBuilder = new org.eclipse.aether.util.repository.AuthenticationBuilder();
++ authBuilder.addUsername(auth.getUserName()).addPassword(auth.getPassword()).addPrivateKey(auth.getPrivateKey(), auth.getPassphrase());
++ repo.setAuthentication(authBuilder.build());
+ }
+
+ org.apache.maven.artifact.ant.Proxy proxy = gradleRepo.getProxy();
+ if (proxy != null) {
+ DefaultProxySelector proxySelector = new DefaultProxySelector();
+- Authentication proxyAuth = new Authentication(proxy.getUserName(), proxy.getPassword());
++ org.eclipse.aether.util.repository.AuthenticationBuilder authBuilder = new org.eclipse.aether.util.repository.AuthenticationBuilder();
++ authBuilder.addUsername(proxy.getUserName()).addPassword(proxy.getPassword());
++ Authentication proxyAuth = authBuilder.build();
+ proxySelector.add(new Proxy(proxy.getType(), proxy.getHost(), proxy.getPort(), proxyAuth), proxy.getNonProxyHosts());
+- repo.setProxy(proxySelector.getProxy(repo));
++ repo.setProxy(proxySelector.getProxy(repo.build()));
+ }
+
+- return repo;
++ return repo.build();
+ }
+ }
+--- a/subprojects/maven/src/main/groovy/org/gradle/api/publication/maven/internal/action/MavenInstallAction.java
++++ b/subprojects/maven/src/main/groovy/org/gradle/api/publication/maven/internal/action/MavenInstallAction.java
+@@ -18,11 +18,11 @@
+ import java.io.File;
+ import java.util.Collection;
+
+-import org.sonatype.aether.RepositorySystem;
+-import org.sonatype.aether.RepositorySystemSession;
+-import org.sonatype.aether.artifact.Artifact;
+-import org.sonatype.aether.installation.InstallRequest;
+-import org.sonatype.aether.installation.InstallationException;
++import org.eclipse.aether.RepositorySystem;
++import org.eclipse.aether.RepositorySystemSession;
++import org.eclipse.aether.artifact.Artifact;
++import org.eclipse.aether.installation.InstallRequest;
++import org.eclipse.aether.installation.InstallationException;
+
+ public class MavenInstallAction extends AbstractMavenPublishAction {
+
+--- a/subprojects/maven/src/main/groovy/org/gradle/api/publication/maven/internal/action/AbstractMavenPublishAction.java
++++ b/subprojects/maven/src/main/groovy/org/gradle/api/publication/maven/internal/action/AbstractMavenPublishAction.java
+@@ -25,14 +25,15 @@
+ import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
+ import org.gradle.api.GradleException;
+ import org.gradle.internal.UncheckedException;
+-import org.sonatype.aether.RepositoryException;
+-import org.sonatype.aether.RepositorySystem;
+-import org.sonatype.aether.RepositorySystemSession;
+-import org.sonatype.aether.artifact.Artifact;
+-import org.sonatype.aether.artifact.ArtifactType;
+-import org.sonatype.aether.impl.internal.SimpleLocalRepositoryManager;
+-import org.sonatype.aether.util.DefaultRepositorySystemSession;
+-import org.sonatype.aether.util.artifact.DefaultArtifact;
++import org.eclipse.aether.RepositoryException;
++import org.eclipse.aether.RepositorySystem;
++import org.eclipse.aether.RepositorySystemSession;
++import org.eclipse.aether.artifact.Artifact;
++import org.eclipse.aether.artifact.ArtifactType;
++import org.eclipse.aether.repository.LocalRepository;
++import org.eclipse.aether.internal.impl.DefaultRepositorySystem;
++import org.eclipse.aether.DefaultRepositorySystemSession;
++import org.eclipse.aether.artifact.DefaultArtifact;
+
+ import java.io.File;
+ import java.io.FileReader;
+@@ -61,7 +62,7 @@
+ }
+
+ public void setLocalMavenRepositoryLocation(File localMavenRepository) {
+- session.setLocalRepositoryManager(new SimpleLocalRepositoryManager(localMavenRepository));
++ session.setLocalRepositoryManager(new DefaultRepositorySystem().newLocalRepositoryManager(session, new LocalRepository(localMavenRepository)));
+ }
+
+ public void setMainArtifact(File file) {
+--- a/subprojects/maven/src/main/groovy/org/gradle/api/publication/maven/internal/action/LoggingMavenTransferListener.java
++++ b/subprojects/maven/src/main/groovy/org/gradle/api/publication/maven/internal/action/LoggingMavenTransferListener.java
+@@ -18,9 +18,9 @@
+
+ import org.slf4j.Logger;
+ import org.slf4j.LoggerFactory;
+-import org.sonatype.aether.transfer.AbstractTransferListener;
+-import org.sonatype.aether.transfer.TransferEvent;
+-import org.sonatype.aether.transfer.TransferEvent.RequestType;
++import org.eclipse.aether.transfer.AbstractTransferListener;
++import org.eclipse.aether.transfer.TransferEvent;
++import org.eclipse.aether.transfer.TransferEvent.RequestType;
+
+ class LoggingMavenTransferListener extends AbstractTransferListener {
+ private static final Logger LOGGER = LoggerFactory.getLogger(LoggingMavenTransferListener.class);
+--- a/subprojects/build-init/src/main/groovy/org/gradle/buildinit/plugins/internal/maven/MavenProjectsCreator.java
++++ b/subprojects/build-init/src/main/groovy/org/gradle/buildinit/plugins/internal/maven/MavenProjectsCreator.java
+@@ -29,8 +29,8 @@
+ import org.codehaus.plexus.classworlds.ClassWorld;
+ import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
+ import org.codehaus.plexus.configuration.PlexusConfigurationException;
+-import org.sonatype.aether.RepositorySystemSession;
+-import org.sonatype.aether.util.DefaultRepositorySystemSession;
++import org.eclipse.aether.RepositorySystemSession;
++import org.eclipse.aether.DefaultRepositorySystemSession;
+ import org.gradle.util.CollectionUtils;
+
+ import java.io.File;
diff --git a/debian/patches/maven-aether-provider.diff b/debian/patches/maven-aether-provider.diff
new file mode 100644
index 0000000..d2a4100
--- /dev/null
+++ b/debian/patches/maven-aether-provider.diff
@@ -0,0 +1,23 @@
+Description: Maven module uses a deprecated API of maven-aether-provider.
+Author: Kai-Chung Yan <seamlikok at gmail.com>
+Last-Update: 2015-07-13
+--- a/subprojects/maven/src/main/groovy/org/gradle/api/publication/maven/internal/action/AbstractMavenPublishAction.java
++++ b/subprojects/maven/src/main/groovy/org/gradle/api/publication/maven/internal/action/AbstractMavenPublishAction.java
+@@ -18,7 +18,7 @@
+
+ import org.apache.maven.model.Model;
+ import org.apache.maven.model.io.xpp3.MavenXpp3Reader;
+-import org.apache.maven.repository.internal.MavenRepositorySystemSession;
++import org.apache.maven.repository.internal.MavenRepositorySystemUtils;
+ import org.codehaus.plexus.DefaultPlexusContainer;
+ import org.codehaus.plexus.PlexusContainer;
+ import org.codehaus.plexus.PlexusContainerException;
+@@ -52,7 +52,7 @@
+
+ protected AbstractMavenPublishAction(File pomFile) {
+ container = newPlexusContainer();
+- session = new MavenRepositorySystemSession();
++ session = MavenRepositorySystemUtils.newSession();
+ session.setTransferListener(new LoggingMavenTransferListener());
+ session.getConfigProperties().put("maven.metadata.legacy", "true");
+
diff --git a/debian/patches/series b/debian/patches/series
index 322f248..dbbc5c8 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -20,3 +20,5 @@ nekohtml.diff
relax_warnings.diff
disable_java9.diff
maven_testng.diff
+eclipse-aether.diff
+maven-aether-provider.diff
diff --git a/debian/patches/use_local_artifacts.diff b/debian/patches/use_local_artifacts.diff
index 6323680..6cc3283 100644
--- a/debian/patches/use_local_artifacts.diff
+++ b/debian/patches/use_local_artifacts.diff
@@ -177,11 +177,11 @@ Last-Update: 2015-07-08
- dependency "org.sonatype.aether:aether-spi:1.13.1 at jar"
- dependency "org.sonatype.aether:aether-util:1.13.1 at jar"
- dependency 'org.sonatype.aether:aether-connector-wagon:1.13.1 at jar'
-+ dependency "org.sonatype.aether:aether-api"
-+ dependency "org.sonatype.aether:aether-impl"
-+ dependency "org.sonatype.aether:aether-spi"
-+ dependency "org.sonatype.aether:aether-util"
-+ dependency 'org.sonatype.aether:aether-connector-wagon'
++ dependency "org.eclipse.aether:eclipse-aether-api"
++ dependency "org.eclipse.aether:eclipse-aether-impl"
++ dependency "org.eclipse.aether:eclipse-aether-spi"
++ dependency "org.eclipse.aether:eclipse-aether-util"
++ dependency 'org.eclipse.aether:eclipse-aether-connector-basic'
}
libraries.spock = [
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/gradle.git
More information about the pkg-java-commits
mailing list