From 82aede68cb6944b83445b83cff19a029e805a05b Mon Sep 17 00:00:00 2001 From: Mat Booth Date: Jul 13 2020 14:08:49 +0000 Subject: Patch out dep on aether and obsolete javadoc package --- diff --git a/0001-Fix-manifests-for-guava-and-use-OSGi-fied-archetypes.patch b/0001-Fix-manifests-for-guava-and-use-OSGi-fied-archetypes.patch index 573a8ab..ba458b5 100644 --- a/0001-Fix-manifests-for-guava-and-use-OSGi-fied-archetypes.patch +++ b/0001-Fix-manifests-for-guava-and-use-OSGi-fied-archetypes.patch @@ -1,7 +1,7 @@ -From 16930d63935426cb9f295cab5eccec1b1dfb632e Mon Sep 17 00:00:00 2001 +From 998973a4b3cbb738b017e9561fa7d00266de041f Mon Sep 17 00:00:00 2001 From: Mat Booth Date: Tue, 18 Jun 2019 15:35:48 +0100 -Subject: [PATCH 1/5] Fix manifests for guava and use OSGi-fied archetypes +Subject: [PATCH 1/6] Fix manifests for guava and use OSGi-fied archetypes --- org.eclipse.m2e.core.ui/META-INF/MANIFEST.MF | 4 +++- diff --git a/0002-Port-to-latest-versions-of-maven-indexer-and-lucene.patch b/0002-Port-to-latest-versions-of-maven-indexer-and-lucene.patch index 503a056..193a3ea 100644 --- a/0002-Port-to-latest-versions-of-maven-indexer-and-lucene.patch +++ b/0002-Port-to-latest-versions-of-maven-indexer-and-lucene.patch @@ -1,7 +1,7 @@ -From aace32fcbe00a2e79b640f8868459084c644b96d Mon Sep 17 00:00:00 2001 +From 14bc75f92c9fa3d94e1c29b56458e981f9ec7833 Mon Sep 17 00:00:00 2001 From: Mat Booth Date: Tue, 18 Jun 2019 15:45:18 +0100 -Subject: [PATCH 2/5] Port to latest versions of maven-indexer and lucene +Subject: [PATCH 2/6] Port to latest versions of maven-indexer and lucene --- .../org.eclipse.m2e.maven.indexer/pom.xml | 4 +- diff --git a/0003-Adapt-to-API-change-in-aether.patch b/0003-Adapt-to-API-change-in-aether.patch index ad7315a..e54e6d3 100644 --- a/0003-Adapt-to-API-change-in-aether.patch +++ b/0003-Adapt-to-API-change-in-aether.patch @@ -1,35 +1,13 @@ -From 7750d0adcca5ca745650540a53d903dad6befc8b Mon Sep 17 00:00:00 2001 +From c4fceef8e2f7a03171eb703e4f6ffba0cd3e451f Mon Sep 17 00:00:00 2001 From: Mat Booth Date: Fri, 21 Jun 2019 11:24:15 +0100 -Subject: [PATCH 3/5] Adapt to API change in aether +Subject: [PATCH 3/6] Adapt to API change in aether --- .../embedder/ContextRepositorySystemSessionImpl.java | 6 ------ .../internal/lifecyclemapping/LifecycleMappingFactory.java | 6 +++--- 2 files changed, 3 insertions(+), 9 deletions(-) -diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ContextRepositorySystemSessionImpl.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ContextRepositorySystemSessionImpl.java -index 1b9bf84..c40cf38 100644 ---- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ContextRepositorySystemSessionImpl.java -+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/embedder/ContextRepositorySystemSessionImpl.java -@@ -34,7 +34,6 @@ import org.eclipse.aether.repository.WorkspaceReader; - import org.eclipse.aether.resolution.ArtifactDescriptorPolicy; - import org.eclipse.aether.resolution.ResolutionErrorPolicy; - import org.eclipse.aether.transfer.TransferListener; --import org.eclipse.aether.transform.FileTransformerManager; - - import org.codehaus.plexus.component.annotations.Component; - import org.codehaus.plexus.component.annotations.Requirement; -@@ -180,9 +179,4 @@ public class ContextRepositorySystemSessionImpl implements ContextRepositorySyst - return getSession().getVersionFilter(); - } - -- @Override -- public FileTransformerManager getFileTransformerManager() { -- return getSession().getFileTransformerManager(); -- } -- - } diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/LifecycleMappingFactory.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/LifecycleMappingFactory.java index 416decc..630992a 100644 --- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/lifecyclemapping/LifecycleMappingFactory.java diff --git a/0004-Remove-mandatory-attirbutes-from-OSGi-manifests-whic.patch b/0004-Remove-mandatory-attirbutes-from-OSGi-manifests-whic.patch index 7e2757b..5298489 100644 --- a/0004-Remove-mandatory-attirbutes-from-OSGi-manifests-whic.patch +++ b/0004-Remove-mandatory-attirbutes-from-OSGi-manifests-whic.patch @@ -1,7 +1,7 @@ -From e89abd3fe021b366f7d082a53823f3a99d18e7fd Mon Sep 17 00:00:00 2001 +From 7c8940ab74e95d0dc5c4e093ba4372f995ac3540 Mon Sep 17 00:00:00 2001 From: Mat Booth Date: Fri, 21 Jun 2019 11:27:12 +0100 -Subject: [PATCH 4/5] Remove mandatory attirbutes from OSGi manifests, which +Subject: [PATCH 4/6] Remove mandatory attirbutes from OSGi manifests, which cause problems with P2 --- diff --git a/0005-Port-to-latest-version-of-maven-archetypes.patch b/0005-Port-to-latest-version-of-maven-archetypes.patch index e1a59ca..3da04a3 100644 --- a/0005-Port-to-latest-version-of-maven-archetypes.patch +++ b/0005-Port-to-latest-version-of-maven-archetypes.patch @@ -1,7 +1,7 @@ -From 3c3af2a6837f32c1234418bdc8416cf7ec921a01 Mon Sep 17 00:00:00 2001 +From 5242f2d4a7d852c8d75df4b492d90e73e1a3fe61 Mon Sep 17 00:00:00 2001 From: Mat Booth Date: Wed, 25 Mar 2020 11:26:45 +0000 -Subject: [PATCH 5/5] Port to latest version of maven-archetypes +Subject: [PATCH 5/6] Port to latest version of maven-archetypes --- .../org.eclipse.m2e.archetype.common/pom.xml | 9 +- diff --git a/0006-Remove-dep-on-aether-connector.patch b/0006-Remove-dep-on-aether-connector.patch new file mode 100644 index 0000000..36652b1 --- /dev/null +++ b/0006-Remove-dep-on-aether-connector.patch @@ -0,0 +1,453 @@ +From 789069406cc9f0ee5e048db1c8e4b0019fdff9b6 Mon Sep 17 00:00:00 2001 +From: Mat Booth +Date: Mon, 13 Jul 2020 13:52:18 +0100 +Subject: [PATCH 6/6] Remove dep on aether-connector + +Change-Id: I08f91c9ddc84f6f34205452467a71b18badad4a0 +Signed-off-by: Mat Booth +--- + .../org.eclipse.m2e.maven.runtime/pom.xml | 15 +- + org.eclipse.m2e.core/META-INF/MANIFEST.MF | 2 +- + .../nexus/AetherClientResourceFetcher.java | 201 ------------------ + .../index/nexus/HttpResourceFetcher.java | 153 +++++++++++++ + .../index/nexus/NexusIndexManager.java | 2 +- + 5 files changed, 156 insertions(+), 217 deletions(-) + delete mode 100644 org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/nexus/AetherClientResourceFetcher.java + create mode 100644 org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/nexus/HttpResourceFetcher.java + +diff --git a/m2e-maven-runtime/org.eclipse.m2e.maven.runtime/pom.xml b/m2e-maven-runtime/org.eclipse.m2e.maven.runtime/pom.xml +index 0ff5875..0440325 100644 +--- a/m2e-maven-runtime/org.eclipse.m2e.maven.runtime/pom.xml ++++ b/m2e-maven-runtime/org.eclipse.m2e.maven.runtime/pom.xml +@@ -33,7 +33,6 @@ + 3.6.3 + + 0.0.7 +- 0.17.8 + + + +@@ -76,17 +75,6 @@ + ${plexus-build-api.version} + true + +- +- io.takari.aether +- aether-connector-okhttp +- ${okhttp-connector.version} +- +- +- org.eclipse.aether +- aether-util +- +- +- + + org.apache.maven.resolver + maven-resolver-impl +@@ -143,8 +131,7 @@ + org.codehaus.plexus.*;provider=m2e, + org.sonatype.plexus.*;provider=m2e, + org.eclipse.aether.*;provider=m2e, +- com.google.inject.*;provider=m2e, +- io.takari.*;provider=m2e ++ com.google.inject.*;provider=m2e + + + +diff --git a/org.eclipse.m2e.core/META-INF/MANIFEST.MF b/org.eclipse.m2e.core/META-INF/MANIFEST.MF +index af681a0..51766cf 100644 +--- a/org.eclipse.m2e.core/META-INF/MANIFEST.MF ++++ b/org.eclipse.m2e.core/META-INF/MANIFEST.MF +@@ -18,7 +18,7 @@ Require-Bundle: org.eclipse.osgi;bundle-version="3.10.0", + com.google.guava;bundle-version="[20.0,29.0)" + Bundle-ActivationPolicy: lazy + Bundle-ClassPath: . +-Bundle-RequiredExecutionEnvironment: JavaSE-1.8 ++Bundle-RequiredExecutionEnvironment: JavaSE-11 + Export-Package: org.eclipse.m2e.core, + org.eclipse.m2e.core.archetype;x-friends:="org.eclipse.m2e.core.ui", + org.eclipse.m2e.core.embedder, +diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/nexus/AetherClientResourceFetcher.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/nexus/AetherClientResourceFetcher.java +deleted file mode 100644 +index b311824..0000000 +--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/nexus/AetherClientResourceFetcher.java ++++ /dev/null +@@ -1,201 +0,0 @@ +-/******************************************************************************* +- * Copyright (c) 2010 Sonatype, Inc. +- * All rights reserved. This program and the accompanying materials +- * are made available under the terms of the Eclipse Public License 2.0 +- * which accompanies this distribution, and is available at +- * https://www.eclipse.org/legal/epl-2.0/ +- * +- * SPDX-License-Identifier: EPL-2.0 +- * +- * Contributors: +- * Sonatype, Inc. - initial API and implementation +- *******************************************************************************/ +- +-package org.eclipse.m2e.core.internal.index.nexus; +- +-import java.io.BufferedOutputStream; +-import java.io.File; +-import java.io.FileNotFoundException; +-import java.io.FileOutputStream; +-import java.io.IOException; +-import java.io.InputStream; +-import java.io.OutputStream; +-import java.net.MalformedURLException; +-import java.net.URL; +-import java.security.NoSuchAlgorithmException; +-import java.util.HashMap; +-import java.util.Map; +- +-import javax.net.ssl.SSLContext; +- +-import org.slf4j.Logger; +-import org.slf4j.LoggerFactory; +- +-import org.eclipse.core.runtime.IProgressMonitor; +-import org.eclipse.core.runtime.NullProgressMonitor; +-import org.eclipse.core.runtime.OperationCanceledException; +- +-import org.apache.maven.index.updater.ResourceFetcher; +-import org.apache.maven.wagon.authentication.AuthenticationInfo; +-import org.apache.maven.wagon.proxy.ProxyInfo; +-import org.apache.maven.wagon.proxy.ProxyUtils; +- +-import org.eclipse.m2e.core.internal.MavenPluginActivator; +-import org.eclipse.m2e.core.internal.Messages; +- +-import io.takari.aether.client.AetherClient; +-import io.takari.aether.client.AetherClientAuthentication; +-import io.takari.aether.client.AetherClientConfig; +-import io.takari.aether.client.AetherClientProxy; +-import io.takari.aether.client.Response; +-import io.takari.aether.okhttp.OkHttpAetherClient; +- +- +-public class AetherClientResourceFetcher implements ResourceFetcher { +- +- private AetherClient aetherClient; +- +- private final AuthenticationInfo authInfo; +- +- private final ProxyInfo proxyInfo; +- +- private final String userAgent; +- +- private final IProgressMonitor monitor; +- +- private String baseUrl; +- +- public AetherClientResourceFetcher(final AuthenticationInfo authInfo, final ProxyInfo proxyInfo, +- final IProgressMonitor monitor) { +- this.authInfo = authInfo; +- this.proxyInfo = proxyInfo; +- this.monitor = (monitor != null) ? monitor : new NullProgressMonitor(); +- this.userAgent = MavenPluginActivator.getUserAgent(); +- } +- +- public void connect(String id, String url) { +- this.baseUrl = url; +- aetherClient = new OkHttpAetherClient( +- new AetherClientConfigAdapter(baseUrl, authInfo, proxyInfo, userAgent, +- new HashMap())); +- } +- +- public void disconnect() throws IOException { +- aetherClient.close(); +- } +- +- @Deprecated +- public void retrieve(String name, File targetFile) throws IOException, FileNotFoundException { +- String url = baseUrl + "/" + name; +- try (Response response = aetherClient.get(url); +- InputStream is = response.getInputStream(); +- OutputStream os = new BufferedOutputStream(new FileOutputStream(targetFile))) { +- final byte[] buffer = new byte[1024 * 1024]; +- int n = 0; +- while(-1 != (n = is.read(buffer))) { +- os.write(buffer, 0, n); +- if(monitor.isCanceled()) { +- throw new OperationCanceledException(); +- } +- } +- } +- } +- +- public InputStream retrieve(String name) throws IOException, FileNotFoundException { +- String url = baseUrl + "/" + name; +- Response response = aetherClient.get(url); +- +- return response.getInputStream(); +- } +- +- class AetherClientConfigAdapter extends AetherClientConfig { +- private final Logger log = LoggerFactory.getLogger(AetherClientConfigAdapter.class); +- +- int connectionTimeout; +- +- int requestTimeout; +- +- AuthenticationInfo authInfo; +- +- ProxyInfo proxyInfo; +- +- String userAgent; +- +- String baseUrl; +- +- Map headers; +- +- public AetherClientConfigAdapter(String baseUrl, AuthenticationInfo authInfo, ProxyInfo proxyInfo, String userAgent, +- Map headers) { +- this.baseUrl = baseUrl; +- this.authInfo = authInfo; +- this.proxyInfo = proxyInfo; +- this.userAgent = userAgent; +- this.headers = headers; +- +- try { +- // ensure JVM's trust & key stores are used +- setSslSocketFactory(SSLContext.getDefault().getSocketFactory()); +- } catch(NoSuchAlgorithmException ex) { +- log.warn(Messages.AetherClientConfigAdapter_error_sslContext); +- } +- } +- +- public String getUserAgent() { +- return userAgent; +- } +- +- public int getConnectionTimeout() { +- return connectionTimeout; +- } +- +- public int getRequestTimeout() { +- return requestTimeout; +- } +- +- public AetherClientProxy getProxy() { +- +- if(proxyInfo == null) { +- return null; +- } +- //Bug 512006 don't return the proxy for nonProxyHosts +- try { +- if(ProxyUtils.validateNonProxyHosts(proxyInfo, new URL(baseUrl).getHost())) { +- return null; +- } +- } catch(MalformedURLException ignore) { +- } +- +- return new AetherClientProxy() { +- +- public String getHost() { +- return proxyInfo.getHost(); +- } +- +- public int getPort() { +- return proxyInfo.getPort(); +- } +- +- public AetherClientAuthentication getAuthentication() { +- +- if(proxyInfo != null && proxyInfo.getUserName() != null && proxyInfo.getPassword() != null) { +- return new AetherClientAuthentication(proxyInfo.getUserName(), proxyInfo.getPassword()); +- } +- return null; +- } +- }; +- } +- +- public AetherClientAuthentication getAuthentication() { +- +- if(authInfo != null) { +- return new AetherClientAuthentication(authInfo.getUserName(), authInfo.getPassword()); +- } +- return null; +- } +- +- public Map getHeaders() { +- return headers; +- } +- } +-} +diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/nexus/HttpResourceFetcher.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/nexus/HttpResourceFetcher.java +new file mode 100644 +index 0000000..d1f467d +--- /dev/null ++++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/nexus/HttpResourceFetcher.java +@@ -0,0 +1,154 @@ ++/******************************************************************************* ++ * Copyright (c) 2020 Red Hat, Inc. ++ * All rights reserved. This program and the accompanying materials ++ * are made available under the terms of the Eclipse Public License 2.0 ++ * which accompanies this distribution, and is available at ++ * https://www.eclipse.org/legal/epl-2.0/ ++ * ++ * SPDX-License-Identifier: EPL-2.0 ++ *******************************************************************************/ ++ ++package org.eclipse.m2e.core.internal.index.nexus; ++ ++import java.io.BufferedOutputStream; ++import java.io.File; ++import java.io.FileNotFoundException; ++import java.io.FileInputStream; ++import java.io.FileOutputStream; ++import java.io.IOException; ++import java.io.InputStream; ++import java.io.OutputStream; ++import java.net.Authenticator; ++import java.net.InetSocketAddress; ++import java.net.PasswordAuthentication; ++import java.net.Proxy; ++import java.net.ProxySelector; ++import java.net.SocketAddress; ++import java.net.URI; ++import java.net.http.HttpClient; ++import java.net.http.HttpClient.Redirect; ++import java.net.http.HttpClient.Version; ++import java.net.http.HttpRequest; ++import java.net.http.HttpResponse; ++import java.net.http.HttpResponse.BodyHandlers; ++import java.time.Duration; ++import java.util.List; ++ ++import org.eclipse.core.runtime.IProgressMonitor; ++import org.eclipse.core.runtime.NullProgressMonitor; ++import org.eclipse.core.runtime.OperationCanceledException; ++ ++import org.apache.maven.index.updater.ResourceFetcher; ++import org.apache.maven.wagon.authentication.AuthenticationInfo; ++import org.apache.maven.wagon.proxy.ProxyInfo; ++import org.apache.maven.wagon.proxy.ProxyUtils; ++ ++import org.eclipse.m2e.core.internal.MavenPluginActivator; ++ ++ ++/** ++ * Resource fetcher implementation based on the JDK's built-in HTTP client. ++ */ ++public class HttpResourceFetcher implements ResourceFetcher { ++ ++ private HttpClient client; ++ ++ private Authenticator auth; ++ ++ private ProxySelector proxy; ++ ++ private IProgressMonitor monitor; ++ ++ private String baseUrl; ++ ++ public HttpResourceFetcher(final AuthenticationInfo authInfo, final ProxyInfo proxyInfo, ++ final IProgressMonitor monitor) { ++ if(authInfo != null) { ++ auth = new Authenticator() { ++ @Override ++ protected PasswordAuthentication getPasswordAuthentication() { ++ return new PasswordAuthentication(authInfo.getUserName(), authInfo.getPassword().toCharArray()); ++ } ++ }; ++ } ++ proxy = new WagonProxySelector(proxyInfo); ++ this.monitor = (monitor != null) ? monitor : new NullProgressMonitor(); ++ } ++ ++ public void connect(String id, String url) throws IOException { ++ baseUrl = url; ++ HttpClient.Builder builder = HttpClient.newBuilder().version(Version.HTTP_1_1).followRedirects(Redirect.NORMAL) ++ .connectTimeout(Duration.ofSeconds(10)).proxy(proxy); ++ if(auth != null) { ++ builder.authenticator(auth); ++ } ++ client = builder.build(); ++ } ++ ++ public void disconnect() throws IOException { ++ } ++ ++ public InputStream retrieve( String name ) ++ throws IOException, FileNotFoundException ++ { ++ final File target = File.createTempFile( name, "" ); ++ retrieve( name, target ); ++ return new FileInputStream( target ) ++ { ++ @Override ++ public void close() ++ throws IOException ++ { ++ super.close(); ++ target.delete(); ++ } ++ }; ++ } ++ ++ public void retrieve(String name, File targetFile) throws IOException, FileNotFoundException { ++ System.out.println(); ++ System.out.println("Requesting: " + baseUrl + "/" + name); ++ HttpRequest request = HttpRequest.newBuilder().uri(URI.create(baseUrl + "/" + name)).timeout(Duration.ofMinutes(2)) ++ .header("User-Agent", MavenPluginActivator.getUserAgent()).GET().build(); ++ System.out.println(request.headers()); ++ try (OutputStream os = new BufferedOutputStream(new FileOutputStream(targetFile))) { ++ HttpResponse response = client.send(request, BodyHandlers.ofInputStream()); ++ System.out.println(response.headers()); ++ final byte[] buffer = new byte[1024 * 1024]; ++ int n = 0; ++ while(-1 != (n = response.body().read(buffer))) { ++ os.write(buffer, 0, n); ++ if(monitor.isCanceled()) { ++ throw new OperationCanceledException(); ++ } ++ } ++ } catch(InterruptedException ex) { ++ throw new OperationCanceledException(); ++ } ++ monitor.worked(1); ++ } ++ ++ static class WagonProxySelector extends ProxySelector { ++ ++ private ProxyInfo proxyInfo; ++ ++ public WagonProxySelector(ProxyInfo proxyInfo) { ++ this.proxyInfo = proxyInfo; ++ } ++ ++ public List select(URI uri) { ++ if(proxyInfo == null || ProxyUtils.validateNonProxyHosts(proxyInfo, uri.getHost())) { ++ return List.of(Proxy.NO_PROXY); ++ } ++ Proxy.Type type = Proxy.Type.HTTP; ++ if(!proxyInfo.getType().equals(ProxyInfo.PROXY_HTTP)) { ++ type = Proxy.Type.SOCKS; ++ } ++ Proxy p = new Proxy(type, new InetSocketAddress(proxyInfo.getHost(), proxyInfo.getPort())); ++ return List.of(p); ++ } ++ ++ public void connectFailed(URI uri, SocketAddress sa, IOException ioe) { ++ } ++ } ++} +diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/nexus/NexusIndexManager.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/nexus/NexusIndexManager.java +index 61e3762..5426327 100644 +--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/nexus/NexusIndexManager.java ++++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/nexus/NexusIndexManager.java +@@ -1181,7 +1181,7 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList + ProxyInfo proxyInfo = maven.getProxyInfo(repository.getProtocol()); + AuthenticationInfo authenticationInfo = repository.getAuthenticationInfo(); + +- IndexUpdateRequest request = new IndexUpdateRequest(context, new AetherClientResourceFetcher(authenticationInfo, ++ IndexUpdateRequest request = new IndexUpdateRequest(context, new HttpResourceFetcher(authenticationInfo, + proxyInfo, monitor)); + File localRepo = repositoryRegistry.getLocalRepository().getBasedir(); + File indexCacheBasedir = new File(localRepo, ".cache/m2e/" + MavenPluginActivator.getVersion()).getCanonicalFile(); //$NON-NLS-1$ +-- +2.26.2 + diff --git a/eclipse-m2e-core.spec b/eclipse-m2e-core.spec index 5f86836..f325a40 100644 --- a/eclipse-m2e-core.spec +++ b/eclipse-m2e-core.spec @@ -2,7 +2,7 @@ Name: eclipse-m2e-core Version: 1.16.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Maven integration for Eclipse # Most of components are under EPL, but some of them are licensed under @@ -28,6 +28,9 @@ Patch3: 0004-Remove-mandatory-attirbutes-from-OSGi-manifests-whic.patch # Use latest version of maven-archetypes Patch4: 0005-Port-to-latest-version-of-maven-archetypes.patch +# Avoid dep on aether-connector, use java 11 instead +Patch5: 0006-Remove-dep-on-aether-connector.patch + Patch1000: core.patch BuildArch: noarch @@ -39,6 +42,7 @@ ExcludeArch: s390 %{arm} %{ix86} # they can be regenerated with the following command: # xmvn-builddep BuildRequires: maven-local +BuildRequires: java-11-openjdk-devel BuildRequires: mvn(io.takari.m2e.workspace:org.eclipse.m2e.workspace.cli) BuildRequires: mvn(org.apache.maven.plugins:maven-install-plugin) BuildRequires: mvn(org.codehaus.modello:modello-maven-plugin) @@ -55,7 +59,6 @@ BuildRequires: mvn(org.sonatype.forge:forge-parent:pom:) # Additional Maven build-requires for m2e-maven-runtime. They cannot # be regenerated using xmvn-builddep because m2e-maven-runtime is not # built using %%mvn_build. -BuildRequires: mvn(io.takari.aether:aether-connector-okhttp) BuildRequires: mvn(org.apache.felix:maven-bundle-plugin) BuildRequires: mvn(org.apache.maven.archetype:archetype-common) >= 3.1.1 BuildRequires: mvn(org.apache.maven.indexer:indexer-core) >= 6.0.0 @@ -159,7 +162,6 @@ BuildRequires: maven-install-plugin # for symlinks to JARs installed by other packages. After installing # m2e these requires can be regenerated with the following command: # rpm -qf --qf 'Requires: %%{name}\n' $(readlink -f $(find /usr/share/eclipse/droplets/m2e-core -type l)) | sort -u -Requires: aether-connector-okhttp Requires: aopalliance Requires: apache-commons-cli Requires: apache-commons-codec @@ -203,8 +205,6 @@ Requires: maven-shared-utils Requires: maven-wagon-file Requires: maven-wagon-http Requires: maven-wagon-provider-api -Requires: okhttp -Requires: okio Requires: plexus-build-api Requires: plexus-cipher Requires: plexus-classworlds @@ -224,8 +224,9 @@ Requires: xml-commons-apis Obsoletes: eclipse-m2e-sourcelookup < 1.1.1-1 Provides: eclipse-m2e-sourcelookup = %{version}-%{release} -# Not shipping tests since F31 -Obsoletes: %{name}-tests < 1.14.0-2 +# Not shipping tests or javadoc since F33 +Obsoletes: %{name}-javadoc <= 1.16.0-3 +Obsoletes: %{name}-tests <= 1.16.0-3 %description The goal of the m2ec project is to provide a first-class Apache Maven support @@ -239,13 +240,6 @@ additional Maven plugins (e.g. Android, web development, etc.), and facilitates the distribution of those extensions through the m2e marketplace. -%package javadoc -Summary: API documentation for %{name} - -%description javadoc -This package contains %{summary}. - - %prep %setup -q -n %{release_dir} %patch0 -p1 @@ -256,6 +250,7 @@ This package contains %{summary}. rm org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/LocalArchetypeCatalogDialog.java rm org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/RemoteArchetypeCatalogDialog.java %pom_remove_dep :dom4j m2e-maven-runtime/org.eclipse.m2e.archetype.common +%patch5 -p1 # Remove unnecessary parent pom %pom_remove_parent m2e-maven-runtime @@ -334,6 +329,7 @@ sed -i -e 's/DefaultProjectBuilder\.DISABLE_GLOBAL_MODEL_CACHE_SYSTEM_PROPERTY/" %patch1000 -p1 %build +export JAVA_HOME=%{_jvmdir}/java-11 # Building m2e is a two step process. See upstream documentation: # http://wiki.eclipse.org/M2E_Development_Environment#Building_m2e_on_command_line repo=localrepo @@ -350,7 +346,7 @@ xmvn -B -o install:install-file -DgroupId=org.eclipse.m2e -DartifactId=org.eclip -Dmaven.repo.local=../${repo} -Dfile=../m2e-maven-runtime/org.eclipse.m2e.maven.runtime.slf4j.simple/target/org.eclipse.m2e.maven.runtime.slf4j.simple-%{version}-SNAPSHOT.jar popd # Second stage build -%mvn_build -f -- -Dmaven.repo.local=${repo} -Dmaven.compiler.source=1.8 -Dmaven.compiler.target=1.8 +%mvn_build -j -f -- -Dmaven.repo.local=${repo} -Dmaven.compiler.source=1.8 -Dmaven.compiler.target=1.8 %install %mvn_artifact m2e-maven-runtime/$mod/pom.xml @@ -372,10 +368,10 @@ xmvn-subst -s $(find %{buildroot}%{_datadir}/eclipse/droplets/m2e-core -name jar %files -f .mfiles %license LICENSE-2.0.txt -%files javadoc -f .mfiles-javadoc -%license LICENSE-2.0.txt - %changelog +* Mon Jul 13 2020 Mat Booth - 1.16.0-3 +- Patch out dep on aether and obsolete javadoc package + * Fri Jul 10 2020 Jiri Vanek - 1.16.0-2 - Rebuilt for JDK-11, see https://fedoraproject.org/wiki/Changes/Java11