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 7a520de..3cf379f 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,20 +1,20 @@ -From e912029f823d737197cc79b89d3cd98737a8da4b Mon Sep 17 00:00:00 2001 +From 5987084e7e4496d683c7b80d6cd0ca3232dd0fa9 Mon Sep 17 00:00:00 2001 From: Mat Booth Date: Tue, 18 Jun 2019 15:35:48 +0100 -Subject: [PATCH 1/7] 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 +++- - org.eclipse.m2e.core/META-INF/MANIFEST.MF | 5 +++-- + org.eclipse.m2e.core/META-INF/MANIFEST.MF | 4 +++- org.eclipse.m2e.editor.xml/META-INF/MANIFEST.MF | 2 +- org.eclipse.m2e.sourcelookup/META-INF/MANIFEST.MF | 2 +- - 4 files changed, 8 insertions(+), 5 deletions(-) + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/org.eclipse.m2e.core.ui/META-INF/MANIFEST.MF b/org.eclipse.m2e.core.ui/META-INF/MANIFEST.MF -index 93e30e8..9cbc82e 100644 +index a75496e..bd42d0f 100644 --- a/org.eclipse.m2e.core.ui/META-INF/MANIFEST.MF +++ b/org.eclipse.m2e.core.ui/META-INF/MANIFEST.MF -@@ -36,7 +36,9 @@ Require-Bundle: org.eclipse.m2e.core;bundle-version="[1.11.0,1.12.0)", +@@ -36,7 +36,9 @@ Require-Bundle: org.eclipse.m2e.core;bundle-version="[1.13.0,1.14.1)", org.eclipse.core.expressions;bundle-version="3.4.101", org.eclipse.ui.forms;bundle-version="3.4.1", org.eclipse.jface.text, @@ -26,48 +26,46 @@ index 93e30e8..9cbc82e 100644 org.eclipse.ltk.core.refactoring, org.slf4j;version="1.6.2" diff --git a/org.eclipse.m2e.core/META-INF/MANIFEST.MF b/org.eclipse.m2e.core/META-INF/MANIFEST.MF -index 4320041..583cc33 100644 +index 3b76f79..57e619c 100644 --- a/org.eclipse.m2e.core/META-INF/MANIFEST.MF +++ b/org.eclipse.m2e.core/META-INF/MANIFEST.MF -@@ -13,9 +13,10 @@ Require-Bundle: org.eclipse.osgi;bundle-version="3.10.0", +@@ -13,7 +13,9 @@ Require-Bundle: org.eclipse.osgi;bundle-version="3.10.0", org.eclipse.m2e.workspace.cli;bundle-version="0.1.0", org.eclipse.core.runtime;bundle-version="3.12.0", org.eclipse.core.resources;bundle-version="3.9.0", -- com.google.guava;bundle-version="[21.0,22.0)" +- com.google.guava;bundle-version="[27.1,28.0)" + org.apache.maven.archetype.catalog, + org.apache.maven.archetype.descriptor, -+ com.google.guava;bundle-version="[18.0,21.0)" ++ com.google.guava;bundle-version="[20.0,29.0)" Bundle-ActivationPolicy: lazy --Bundle-ClassPath: . + Bundle-ClassPath: . Bundle-RequiredExecutionEnvironment: JavaSE-1.8 - Export-Package: org.eclipse.m2e.core, - org.eclipse.m2e.core.archetype;x-friends:="org.eclipse.m2e.core.ui", diff --git a/org.eclipse.m2e.editor.xml/META-INF/MANIFEST.MF b/org.eclipse.m2e.editor.xml/META-INF/MANIFEST.MF -index a119663..9a70e0c 100644 +index f6890f2..c75cc34 100644 --- a/org.eclipse.m2e.editor.xml/META-INF/MANIFEST.MF +++ b/org.eclipse.m2e.editor.xml/META-INF/MANIFEST.MF @@ -22,7 +22,7 @@ Require-Bundle: org.eclipse.core.runtime, org.eclipse.ui.ide, org.eclipse.core.filesystem, org.eclipse.ui.forms, -- com.google.guava;bundle-version="[21.0,22.0)" -+ com.google.guava;bundle-version="[18.0,21.0)" +- com.google.guava;bundle-version="[27.1,28.0)" ++ com.google.guava;bundle-version="[20.0,29.0)" Export-Package: org.eclipse.m2e.editor.xml;x-internal:=true, org.eclipse.m2e.editor.xml.internal;x-internal:=true, org.eclipse.m2e.editor.xml.internal.lifecycle;x-internal:=true, diff --git a/org.eclipse.m2e.sourcelookup/META-INF/MANIFEST.MF b/org.eclipse.m2e.sourcelookup/META-INF/MANIFEST.MF -index f76eb8c..8e2e0fc 100644 +index 32b4e32..ef462f8 100644 --- a/org.eclipse.m2e.sourcelookup/META-INF/MANIFEST.MF +++ b/org.eclipse.m2e.sourcelookup/META-INF/MANIFEST.MF -@@ -15,7 +15,7 @@ Require-Bundle: org.eclipse.m2e.launching;bundle-version="[1.11.0,1.12.0)", +@@ -15,7 +15,7 @@ Require-Bundle: org.eclipse.m2e.launching;bundle-version="[1.13.0,1.14.1)", org.eclipse.core.expressions;bundle-version="3.4.400", org.eclipse.debug.ui;bundle-version="3.10.0", org.eclipse.core.resources, -- com.google.guava;bundle-version="15.0.0", -+ com.google.guava;bundle-version="[18.0.0,21.0.0)", +- com.google.guava;bundle-version="[27.1,28.0)", ++ com.google.guava;bundle-version="[20.0,29.0)", com.google.gson;bundle-version="2.2.4", org.eclipse.core.variables;bundle-version="3.2.0" Import-Package: org.slf4j;version="1.6.2" -- -2.20.1 +2.21.0 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 0dc8cb7..9aaa5a1 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 026fed9886fadb3c58b449514099bd891f8c62ba Mon Sep 17 00:00:00 2001 +From 432d8606118da63c5afcf1057c510a23a683f70e Mon Sep 17 00:00:00 2001 From: Mat Booth Date: Tue, 18 Jun 2019 15:45:18 +0100 -Subject: [PATCH 2/7] 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 +- @@ -13,10 +13,10 @@ Subject: [PATCH 2/7] Port to latest versions of maven-indexer and lucene 6 files changed, 83 insertions(+), 71 deletions(-) diff --git a/m2e-maven-runtime/org.eclipse.m2e.maven.indexer/pom.xml b/m2e-maven-runtime/org.eclipse.m2e.maven.indexer/pom.xml -index eb809b6..85d3dfe 100644 +index f0187a4..06c39a3 100644 --- a/m2e-maven-runtime/org.eclipse.m2e.maven.indexer/pom.xml +++ b/m2e-maven-runtime/org.eclipse.m2e.maven.indexer/pom.xml -@@ -25,7 +25,7 @@ +@@ -27,7 +27,7 @@ org.apache.maven.indexer indexer-core @@ -25,7 +25,7 @@ index eb809b6..85d3dfe 100644 true -@@ -68,7 +68,7 @@ +@@ -70,7 +70,7 @@ @@ -33,7 +33,7 @@ index eb809b6..85d3dfe 100644 + org.apache.lucene*,!* - org.eclipse.m2e.maven.runtime;bundle-version="[1.11.0,1.12.0)", + org.eclipse.m2e.maven.runtime;bundle-version="[1.14.0,1.15.0)", diff --git a/m2e-maven-runtime/org.eclipse.m2e.maven.indexer/src/main/java/org/apache/maven/index/DefaultIndexerEngine.java b/m2e-maven-runtime/org.eclipse.m2e.maven.indexer/src/main/java/org/apache/maven/index/DefaultIndexerEngine.java index 4b155c1..6aa1359 100644 --- a/m2e-maven-runtime/org.eclipse.m2e.maven.indexer/src/main/java/org/apache/maven/index/DefaultIndexerEngine.java @@ -107,11 +107,11 @@ index 4b155c1..6aa1359 100644 w.addDocument( doc ); w.deleteDocuments( new Term( ArtifactInfo.UINFO, uinfo ) ); diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/ProposalUtil.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/ProposalUtil.java -index e8d735c..69e42fd 100644 +index 1446936..40f851e 100644 --- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/ProposalUtil.java +++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/util/ProposalUtil.java -@@ -31,7 +31,7 @@ import org.eclipse.swt.widgets.Control; - import org.eclipse.swt.widgets.Text; +@@ -34,7 +34,7 @@ import org.eclipse.swt.widgets.Text; + import org.eclipse.ui.IWorkbenchCommandConstants; import org.eclipse.ui.fieldassist.ContentAssistCommandAdapter; -import org.apache.lucene.queryParser.QueryParser; @@ -120,10 +120,10 @@ index e8d735c..69e42fd 100644 import org.apache.maven.project.MavenProject; 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 -index 16a5b90..aa5e9a0 100644 +index 64e1fb7..619b132 100644 --- 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 -@@ -31,7 +31,7 @@ import org.eclipse.core.runtime.IProgressMonitor; +@@ -33,7 +33,7 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.OperationCanceledException; @@ -132,7 +132,7 @@ index 16a5b90..aa5e9a0 100644 import org.apache.maven.wagon.authentication.AuthenticationInfo; import org.apache.maven.wagon.proxy.ProxyInfo; -@@ -46,7 +46,7 @@ import io.takari.aether.client.Response; +@@ -48,7 +48,7 @@ import io.takari.aether.client.Response; import io.takari.aether.okhttp.OkHttpAetherClient; @@ -141,7 +141,7 @@ index 16a5b90..aa5e9a0 100644 private AetherClient aetherClient; -@@ -94,6 +94,13 @@ public class AetherClientResourceFetcher extends AbstractResourceFetcher { +@@ -97,6 +97,13 @@ public class AetherClientResourceFetcher extends AbstractResourceFetcher { } } @@ -156,10 +156,10 @@ index 16a5b90..aa5e9a0 100644 private final Logger log = LoggerFactory.getLogger(AetherClientConfigAdapter.class); diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/nexus/NexusIndex.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/nexus/NexusIndex.java -index de52ffc..eb578e8 100644 +index 0902eda..45b053d 100644 --- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/nexus/NexusIndex.java +++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/index/nexus/NexusIndex.java -@@ -105,7 +105,7 @@ public class NexusIndex implements IIndex, IMutableIndex { +@@ -107,7 +107,7 @@ public class NexusIndex implements IIndex, IMutableIndex { public Collection find(Collection groupId, Collection artifactId, Collection version, Collection packaging) throws CoreException { @@ -168,7 +168,7 @@ index de52ffc..eb578e8 100644 addQueryFromSearchExpressionCollection(query, MAVEN.PACKAGING, packaging); -@@ -115,18 +115,18 @@ public class NexusIndex implements IIndex, IMutableIndex { +@@ -117,18 +117,18 @@ public class NexusIndex implements IIndex, IMutableIndex { addQueryFromSearchExpressionCollection(query, MAVEN.VERSION, version); @@ -192,10 +192,10 @@ index de52ffc..eb578e8 100644 query.add(indexManager.constructQuery(field, sec.iterator().next()), Occur.MUST); } 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 9686315..96ebdb6 100644 +index 37d6906..e7e0688 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 -@@ -52,9 +52,7 @@ import org.codehaus.plexus.util.IOUtil; +@@ -54,9 +54,7 @@ import org.codehaus.plexus.util.IOUtil; import org.apache.lucene.search.BooleanClause; import org.apache.lucene.search.BooleanClause.Occur; import org.apache.lucene.search.BooleanQuery; @@ -205,7 +205,7 @@ index 9686315..96ebdb6 100644 import org.apache.lucene.store.Directory; import org.apache.lucene.store.FSDirectory; -@@ -69,7 +67,6 @@ import org.apache.maven.index.MAVEN; +@@ -71,7 +69,6 @@ import org.apache.maven.index.MAVEN; import org.apache.maven.index.NexusIndexer; import org.apache.maven.index.SearchType; import org.apache.maven.index.artifact.Gav; @@ -213,7 +213,7 @@ index 9686315..96ebdb6 100644 import org.apache.maven.index.context.IndexCreator; import org.apache.maven.index.context.IndexingContext; import org.apache.maven.index.creator.JarFileContentsIndexCreator; -@@ -229,7 +226,7 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList +@@ -231,7 +228,7 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList public IndexedArtifactFile getIndexedArtifactFile(IRepository repository, ArtifactKey gav) throws CoreException { try { @@ -222,7 +222,7 @@ index 9686315..96ebdb6 100644 query.add(constructQuery(MAVEN.GROUP_ID, gav.getGroupId(), SearchType.EXACT), BooleanClause.Occur.MUST); query.add(constructQuery(MAVEN.ARTIFACT_ID, gav.getArtifactId(), SearchType.EXACT), BooleanClause.Occur.MUST); query.add(constructQuery(MAVEN.VERSION, gav.getVersion(), SearchType.EXACT), BooleanClause.Occur.MUST); -@@ -239,9 +236,10 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList +@@ -241,9 +238,10 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList } synchronized(getIndexLock(repository)) { @@ -236,7 +236,7 @@ index 9686315..96ebdb6 100644 } } } catch(Exception ex) { -@@ -255,26 +253,26 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList +@@ -257,26 +255,26 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList /** for Unit test */ public IndexedArtifactFile getIndexedArtifactFile(ArtifactInfo artifactInfo) { @@ -276,7 +276,7 @@ index 9686315..96ebdb6 100644 return new IndexedArtifactFile(repository, groupId, artifactId, version, packaging, classifier, fname, size, date, sourcesExists, javadocExists, prefix, goals); -@@ -282,8 +280,9 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList +@@ -284,8 +282,9 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList public IndexedArtifactFile identify(File file) throws CoreException { try { @@ -288,7 +288,7 @@ index 9686315..96ebdb6 100644 } catch(IOException ex) { throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, Messages.NexusIndexManager_error_search, ex)); -@@ -341,7 +340,7 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList +@@ -343,7 +342,7 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList return search(null, term, type, classifier); } @@ -297,7 +297,7 @@ index 9686315..96ebdb6 100644 boolean includeJavaDocs = (classifier & IIndex.SEARCH_JAVADOCS) > 0; Query tq = null; if(!includeJavaDocs) { -@@ -372,46 +371,55 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList +@@ -374,46 +373,55 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList // query = new TermQuery(new Term(ArtifactInfo.GROUP_ID, term)); // query = new PrefixQuery(new Term(ArtifactInfo.GROUP_ID, term)); } else if(IIndex.SEARCH_ARTIFACT.equals(type)) { @@ -361,7 +361,7 @@ index 9686315..96ebdb6 100644 } else if(IIndex.SEARCH_PACKAGING.equals(type)) { query = constructQuery(MAVEN.PACKAGING, term); -@@ -437,7 +445,7 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList +@@ -439,7 +447,7 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList } for(ArtifactInfo artifactInfo : response.getResults()) { @@ -370,7 +370,7 @@ index 9686315..96ebdb6 100644 } // https://issues.sonatype.org/browse/MNGECLIPSE-1630 -@@ -488,7 +496,7 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList +@@ -490,7 +498,7 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList } for(ArtifactInfo artifactInfo : response.getResults()) { @@ -379,7 +379,7 @@ index 9686315..96ebdb6 100644 } } catch(IOException ex) { -@@ -626,27 +634,20 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList +@@ -628,27 +636,20 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList fireIndexChanged(repository); } @@ -413,7 +413,7 @@ index 9686315..96ebdb6 100644 } protected void scheduleIndexUpdate(final IRepository repository, final boolean force) { -@@ -843,7 +844,7 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList +@@ -841,7 +842,7 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList } protected Directory getIndexDirectory(IRepository repository) throws IOException { @@ -422,7 +422,7 @@ index 9686315..96ebdb6 100644 } public IndexedArtifactGroup resolveGroup(IndexedArtifactGroup group) { -@@ -1132,7 +1133,7 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList +@@ -1130,7 +1131,7 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList String details = getIndexDetails(repository); String id = repository.getUid() + "-cache"; //$NON-NLS-1$ File luceneCache = new File(request.getLocalIndexCacheDir(), details); @@ -431,7 +431,7 @@ index 9686315..96ebdb6 100644 IndexingContext cacheCtx = getIndexer().addIndexingContextForced(id, id, null, directory, null, null, getIndexers(details)); request = newIndexUpdateRequest(repository, cacheCtx, monitor); -@@ -1276,7 +1277,8 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList +@@ -1274,7 +1275,8 @@ public class NexusIndexManager implements IndexManager, IMavenProjectChangedList Query q = getIndexer().constructQuery(MAVEN.SHA1, encode(digest), SearchType.EXACT); @@ -442,5 +442,5 @@ index 9686315..96ebdb6 100644 } catch(NoSuchAlgorithmException ex) { throw new IOException("Unable to calculate digest"); -- -2.20.1 +2.21.0 diff --git a/0003-Adapt-to-API-change-in-aether.patch b/0003-Adapt-to-API-change-in-aether.patch index c366c32..605cae0 100644 --- a/0003-Adapt-to-API-change-in-aether.patch +++ b/0003-Adapt-to-API-change-in-aether.patch @@ -1,33 +1,55 @@ -From ce54eb1ed3df099c85309b9eb9462af7ced2802e Mon Sep 17 00:00:00 2001 +From c3f244381ba8a22ecb886beba308b3c240fb8910 Mon Sep 17 00:00:00 2001 From: Mat Booth Date: Fri, 21 Jun 2019 11:24:15 +0100 -Subject: [PATCH 3/7] Adapt to API change in aether +Subject: [PATCH 3/6] Adapt to API change in aether --- - .../lifecyclemapping/LifecycleMappingFactory.java | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) + .../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 ad3d322..d8955d8 100644 +index 416decc..630992a 100644 --- 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 -@@ -687,12 +687,12 @@ public class LifecycleMappingFactory { - List result = new ArrayList(); +@@ -686,12 +686,12 @@ public class LifecycleMappingFactory { + List result = new ArrayList<>(); all_metadatas: for(PluginExecutionMetadata metadata : metadatas) { @SuppressWarnings("unchecked") - Map parameters = metadata.getFilter().getParameters(); + Map parameters = metadata.getFilter().getParameters(); if(!parameters.isEmpty()) { -- for(String name : parameters.keySet()) { -- String value = parameters.get(name); -+ for(Object name : parameters.keySet()) { -+ String value = (String)parameters.get(name); +- for(Entry entry : parameters.entrySet()) { ++ for(Entry entry : parameters.entrySet()) { MojoExecution setupExecution = maven.setupMojoExecution(mavenProject, execution, monitor); -- if(!eq(value, maven.getMojoParameterValue(mavenProject, setupExecution, name, String.class, monitor))) { -+ if(!eq(value, maven.getMojoParameterValue(mavenProject, setupExecution, (String)name, String.class, monitor))) { + if(!eq(entry.getValue(), +- maven.getMojoParameterValue(mavenProject, setupExecution, entry.getKey(), String.class, monitor))) { ++ maven.getMojoParameterValue(mavenProject, setupExecution, (String)entry.getKey(), String.class, monitor))) { continue all_metadatas; } } -- -2.20.1 +2.21.0 diff --git a/0004-Port-tests-to-latest-versionof-jetty.patch b/0004-Port-tests-to-latest-versionof-jetty.patch index 2386d48..93aa840 100644 --- a/0004-Port-tests-to-latest-versionof-jetty.patch +++ b/0004-Port-tests-to-latest-versionof-jetty.patch @@ -1,7 +1,7 @@ -From 0e492e6cc123b992ce047e610e5eedcb824163a1 Mon Sep 17 00:00:00 2001 +From 626c0dc47c29091d891a7b41bfaff5cf1832526c Mon Sep 17 00:00:00 2001 From: Mat Booth Date: Fri, 21 Jun 2019 11:25:11 +0100 -Subject: [PATCH 4/7] Port tests to latest versionof jetty +Subject: [PATCH 4/6] Port tests to latest versionof jetty --- .../META-INF/MANIFEST.MF | 13 +- @@ -10,7 +10,7 @@ Subject: [PATCH 4/7] Port tests to latest versionof jetty 3 files changed, 95 insertions(+), 60 deletions(-) diff --git a/org.eclipse.m2e.tests.common/META-INF/MANIFEST.MF b/org.eclipse.m2e.tests.common/META-INF/MANIFEST.MF -index f41526b..c59e7ed 100644 +index 1dfb5f1..3088e5b 100644 --- a/org.eclipse.m2e.tests.common/META-INF/MANIFEST.MF +++ b/org.eclipse.m2e.tests.common/META-INF/MANIFEST.MF @@ -11,14 +11,17 @@ Require-Bundle: org.junit;bundle-version="4.0.0", @@ -37,10 +37,10 @@ index f41526b..c59e7ed 100644 +Import-Package: javax.servlet;version="3.1.0", + javax.servlet.http;version="3.1.0" diff --git a/org.eclipse.m2e.tests.common/build.properties b/org.eclipse.m2e.tests.common/build.properties -index 51bead7..3873d38 100644 +index 1a9040b..36b4965 100644 --- a/org.eclipse.m2e.tests.common/build.properties +++ b/org.eclipse.m2e.tests.common/build.properties -@@ -14,6 +14,5 @@ output.. = target/classes/ +@@ -15,6 +15,5 @@ output.. = target/classes/ bin.includes = META-INF/,\ .,\ about.html,\ @@ -48,10 +48,10 @@ index 51bead7..3873d38 100644 OSGI-INF/ src.includes = about.html diff --git a/org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/HttpServer.java b/org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/HttpServer.java -index 5851e7e..4205804 100644 +index 96db486..79c0e2a 100644 --- a/org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/HttpServer.java +++ b/org.eclipse.m2e.tests.common/src/org/eclipse/m2e/tests/common/HttpServer.java -@@ -11,6 +11,8 @@ +@@ -13,6 +13,8 @@ package org.eclipse.m2e.tests.common; @@ -60,7 +60,7 @@ index 5851e7e..4205804 100644 import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; -@@ -23,28 +25,36 @@ import java.util.HashMap; +@@ -25,28 +27,36 @@ import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; @@ -114,7 +114,7 @@ index 5851e7e..4205804 100644 /** -@@ -101,24 +111,29 @@ public class HttpServer { +@@ -103,24 +113,29 @@ public class HttpServer { private String storePassword; protected Connector newHttpConnector() { @@ -153,7 +153,7 @@ index 5851e7e..4205804 100644 return connector; } -@@ -142,7 +157,7 @@ public class HttpServer { +@@ -144,7 +159,7 @@ public class HttpServer { */ public int getHttpPort() { if(httpPort >= 0 && server != null && server.isRunning()) { @@ -162,7 +162,7 @@ index 5851e7e..4205804 100644 } return httpPort; } -@@ -176,7 +191,7 @@ public class HttpServer { +@@ -178,7 +193,7 @@ public class HttpServer { */ public int getHttpsPort() { if(httpsPort >= 0 && server != null && server.isRunning()) { @@ -171,7 +171,7 @@ index 5851e7e..4205804 100644 } return httpsPort; } -@@ -260,12 +275,13 @@ public class HttpServer { +@@ -262,12 +277,13 @@ public class HttpServer { protected Handler newProxyHandler() { return new AbstractHandler() { @@ -187,7 +187,7 @@ index 5851e7e..4205804 100644 } if(!(proxyUsername + ':' + proxyPassword).equals(auth)) { -@@ -293,8 +309,8 @@ public class HttpServer { +@@ -295,8 +311,8 @@ public class HttpServer { protected Handler newSslRedirectHandler() { return new AbstractHandler() { @@ -198,7 +198,7 @@ index 5851e7e..4205804 100644 int httpsPort = getHttpsPort(); if(!((Request) request).isHandled() && request.getServerPort() != httpsPort) { String url = "https://" + request.getServerName() + ":" + httpsPort + request.getRequestURI(); -@@ -336,7 +352,7 @@ public class HttpServer { +@@ -338,7 +354,7 @@ public class HttpServer { return this; } @@ -207,7 +207,7 @@ index 5851e7e..4205804 100644 List mappings = new ArrayList(); for(String pathSpec : securedRealms.keySet()) { -@@ -354,22 +370,32 @@ public class HttpServer { +@@ -356,22 +372,32 @@ public class HttpServer { mappings.add(constraintMapping); } @@ -249,7 +249,7 @@ index 5851e7e..4205804 100644 return securityHandler; } -@@ -470,8 +496,8 @@ public class HttpServer { +@@ -472,8 +498,8 @@ public class HttpServer { protected Handler newSleepHandler(final long millis) { return new AbstractHandler() { @@ -260,7 +260,7 @@ index 5851e7e..4205804 100644 if(millis >= 0) { try { Thread.sleep(millis); -@@ -505,6 +531,8 @@ public class HttpServer { +@@ -507,6 +533,8 @@ public class HttpServer { recordedRequests.clear(); @@ -269,7 +269,7 @@ index 5851e7e..4205804 100644 List connectors = new ArrayList(); if(httpPort >= 0) { connectors.add(newHttpConnector()); -@@ -526,15 +554,20 @@ public class HttpServer { +@@ -528,15 +556,20 @@ public class HttpServer { if(proxyUsername != null && proxyPassword != null) { handlerList.addHandler(newProxyHandler()); } @@ -293,7 +293,7 @@ index 5851e7e..4205804 100644 server.setHandler(handlerList); server.setConnectors(connectors.toArray(new Connector[connectors.size()])); server.start(); -@@ -556,7 +589,7 @@ public class HttpServer { +@@ -558,7 +591,7 @@ public class HttpServer { for(int i = 200; i > 0; i-- ) { badConnectors.clear(); for(Connector connector : server.getConnectors()) { @@ -302,7 +302,7 @@ index 5851e7e..4205804 100644 badConnectors.add(connector); } } -@@ -620,8 +653,8 @@ public class HttpServer { +@@ -622,8 +655,8 @@ public class HttpServer { } class ResHandler extends AbstractHandler { @@ -313,7 +313,7 @@ index 5851e7e..4205804 100644 throws IOException { String uri = request.getRequestURI(); -@@ -631,14 +664,14 @@ public class HttpServer { +@@ -633,14 +666,14 @@ public class HttpServer { File basedir = resourceDirs.get(contextRoot); File file = new File(basedir, path); @@ -330,7 +330,7 @@ index 5851e7e..4205804 100644 file.getParentFile().mkdirs(); FileOutputStream os = new FileOutputStream(file); try { -@@ -704,8 +737,8 @@ public class HttpServer { +@@ -706,8 +739,8 @@ public class HttpServer { } class RecordingHandler extends AbstractHandler { @@ -342,5 +342,5 @@ index 5851e7e..4205804 100644 for(String pattern : recordedPatterns) { -- -2.20.1 +2.21.0 diff --git a/0005-Remove-mandatory-attirbutes-from-OSGi-manifests-whic.patch b/0005-Remove-mandatory-attirbutes-from-OSGi-manifests-whic.patch index ec8ec03..7cea2c0 100644 --- a/0005-Remove-mandatory-attirbutes-from-OSGi-manifests-whic.patch +++ b/0005-Remove-mandatory-attirbutes-from-OSGi-manifests-whic.patch @@ -1,7 +1,7 @@ -From 47ef390748cc7d8910888e65c4387193c8c12a21 Mon Sep 17 00:00:00 2001 +From 5bfc220447528961cf47627e6682eb87c5dcaf04 Mon Sep 17 00:00:00 2001 From: Mat Booth Date: Fri, 21 Jun 2019 11:27:12 +0100 -Subject: [PATCH 5/7] Remove mandatory attirbutes from OSGi manifests, which +Subject: [PATCH 5/6] Remove mandatory attirbutes from OSGi manifests, which cause problems with P2 --- @@ -11,10 +11,10 @@ Subject: [PATCH 5/7] Remove mandatory attirbutes from OSGi manifests, which 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/m2e-maven-runtime/org.eclipse.m2e.archetype.common/pom.xml b/m2e-maven-runtime/org.eclipse.m2e.archetype.common/pom.xml -index 9fa1b09..4975150 100644 +index e06a064..57eaca4 100644 --- a/m2e-maven-runtime/org.eclipse.m2e.archetype.common/pom.xml +++ b/m2e-maven-runtime/org.eclipse.m2e.archetype.common/pom.xml -@@ -80,8 +80,8 @@ +@@ -82,8 +82,8 @@ <_exportcontents> META-INF.plexus;-noimport:=true;x-internal:=true, @@ -26,10 +26,10 @@ index 9fa1b09..4975150 100644 diff --git a/m2e-maven-runtime/org.eclipse.m2e.maven.indexer/pom.xml b/m2e-maven-runtime/org.eclipse.m2e.maven.indexer/pom.xml -index 85d3dfe..b1a7f8f 100644 +index 06c39a3..0d35e9b 100644 --- a/m2e-maven-runtime/org.eclipse.m2e.maven.indexer/pom.xml +++ b/m2e-maven-runtime/org.eclipse.m2e.maven.indexer/pom.xml -@@ -63,8 +63,7 @@ +@@ -65,8 +65,7 @@ <_exportcontents> META-INF.plexus;-noimport:=true, @@ -40,10 +40,10 @@ index 85d3dfe..b1a7f8f 100644 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 8e7c53a..2390698 100644 +index 012edf6..948b4ef 100644 --- a/m2e-maven-runtime/org.eclipse.m2e.maven.runtime/pom.xml +++ b/m2e-maven-runtime/org.eclipse.m2e.maven.runtime/pom.xml -@@ -138,12 +138,12 @@ +@@ -140,12 +140,12 @@ <_exportcontents> META-INF.plexus;-noimport:=true, META-INF.sisu;-noimport:=true, @@ -63,5 +63,5 @@ index 8e7c53a..2390698 100644 -- -2.20.1 +2.21.0 diff --git a/0006-Bug-547760-Errors-in-the-log-Failed-to-evaluate-Refe.patch b/0006-Bug-547760-Errors-in-the-log-Failed-to-evaluate-Refe.patch deleted file mode 100644 index 07e5fae..0000000 --- a/0006-Bug-547760-Errors-in-the-log-Failed-to-evaluate-Refe.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 94bf241b223d54b69817f5165bfc4f11dc87dd5e Mon Sep 17 00:00:00 2001 -From: Andrey Loskutov -Date: Wed, 29 May 2019 15:23:15 +0200 -Subject: [PATCH 6/7] Bug 547760 - Errors in the log "Failed to evaluate: - ReferenceExpression - [definitionId=org.eclipse.m2e.sourcelookup.ui.m2estratum]" - -Only test "org.eclipse.jdt.launching.jdtstratum" property on appropriate -elements (org.eclipse.debug.core.model.DebugElement) to avoid runtime -exceptions. - -Change-Id: I81b280ff9bc8fd2e29430c1de96319b386de2304 -Signed-off-by: Andrey Loskutov ---- - org.eclipse.m2e.sourcelookup.ui/plugin.xml | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/org.eclipse.m2e.sourcelookup.ui/plugin.xml b/org.eclipse.m2e.sourcelookup.ui/plugin.xml -index ccee9bf..8233ce6 100644 ---- a/org.eclipse.m2e.sourcelookup.ui/plugin.xml -+++ b/org.eclipse.m2e.sourcelookup.ui/plugin.xml -@@ -87,7 +87,10 @@ - - -+ operator="and"> -+ -+ - - --- -2.20.1 - diff --git a/0006-Port-to-latest-version-of-maven-archetypes.patch b/0006-Port-to-latest-version-of-maven-archetypes.patch new file mode 100644 index 0000000..3aa6ae2 --- /dev/null +++ b/0006-Port-to-latest-version-of-maven-archetypes.patch @@ -0,0 +1,582 @@ +From 1e6c94ad3bbe31d299bbc5a3feebed839eeeab82 Mon Sep 17 00:00:00 2001 +From: Mat Booth +Date: Wed, 3 Jul 2019 15:29:05 +0100 +Subject: [PATCH 6/6] Port to latest version of maven-archetypes + +Change-Id: I208abd50bdbe420d5413ad12bbe5150c428c9453 +--- + .../org.eclipse.m2e.archetype.common/pom.xml | 9 +- + .../MavenArchetypesPreferencePage.java | 109 +----------- + .../MavenProjectWizardArchetypePage.java | 8 +- + .../m2e/core/internal/ExtensionReader.java | 27 +-- + .../eclipse/m2e/core/internal/Messages.java | 2 - + .../archetype/ArchetypeCatalogFactory.java | 164 ++---------------- + .../archetype/ArchetypeCatalogsWriter.java | 49 +----- + .../internal/archetype/ArchetypeManager.java | 5 +- + 8 files changed, 34 insertions(+), 339 deletions(-) + +diff --git a/m2e-maven-runtime/org.eclipse.m2e.archetype.common/pom.xml b/m2e-maven-runtime/org.eclipse.m2e.archetype.common/pom.xml +index 57eaca4..29a2496 100644 +--- a/m2e-maven-runtime/org.eclipse.m2e.archetype.common/pom.xml ++++ b/m2e-maven-runtime/org.eclipse.m2e.archetype.common/pom.xml +@@ -24,7 +24,7 @@ + Maven Archetype Common Bundle + + +- 2.4 ++ 3.1.1 + + + +@@ -34,11 +34,6 @@ + ${archetype-common.version} + true + +- +- +- velocity +- velocity +- + + plexus-container-default + org.codehaus.plexus +@@ -67,12 +62,10 @@ + archetype-common, + archetype-catalog, + archetype-descriptor, +- archetype-registry, + maven-invoker, + commons-collections, + commons-io, + commons-lang, +- dom4j, + jchardet, + jdom, + oro, +diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenArchetypesPreferencePage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenArchetypesPreferencePage.java +index 6a931a0..503e69b 100644 +--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenArchetypesPreferencePage.java ++++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenArchetypesPreferencePage.java +@@ -57,8 +57,6 @@ import org.eclipse.ui.browser.IWebBrowser; + + import org.eclipse.m2e.core.internal.MavenPluginActivator; + import org.eclipse.m2e.core.internal.archetype.ArchetypeCatalogFactory; +-import org.eclipse.m2e.core.internal.archetype.ArchetypeCatalogFactory.LocalCatalogFactory; +-import org.eclipse.m2e.core.internal.archetype.ArchetypeCatalogFactory.RemoteCatalogFactory; + import org.eclipse.m2e.core.internal.archetype.ArchetypeManager; + import org.eclipse.m2e.core.ui.internal.Messages; + +@@ -181,100 +179,6 @@ public class MavenArchetypesPreferencePage extends PreferencePage implements IWo + typeColumn.setWidth(250); + typeColumn.setText(""); //$NON-NLS-1$ + +- Button enableAllBtn = new Button(composite, SWT.NONE); +- enableAllBtn.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false)); +- enableAllBtn.setText(Messages.MavenArchetypesPreferencePage_btnEnableAll); +- enableAllBtn.addSelectionListener(new SelectionAdapter() { +- public void widgetSelected(SelectionEvent e) { +- toggleRepositories(true); +- } +- }); +- +- Button disableAllBtn = new Button(composite, SWT.NONE); +- disableAllBtn.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false)); +- disableAllBtn.setText(Messages.MavenArchetypesPreferencePage_btnDisableAll); +- disableAllBtn.addSelectionListener(new SelectionAdapter() { +- public void widgetSelected(SelectionEvent e) { +- toggleRepositories(false); +- } +- }); +- +- Button addLocalButton = new Button(composite, SWT.NONE); +- addLocalButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false)); +- addLocalButton.setText(Messages.MavenArchetypesPreferencePage_btnAddLocal); +- addLocalButton.addSelectionListener(new SelectionAdapter() { +- public void widgetSelected(SelectionEvent e) { +- LocalArchetypeCatalogDialog dialog = new LocalArchetypeCatalogDialog(getShell(), null); +- if(dialog.open() == Window.OK) { +- addCatalogFactory(dialog.getArchetypeCatalogFactory()); +- } +- } +- }); +- +- Button addRemoteButton = new Button(composite, SWT.NONE); +- addRemoteButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false)); +- addRemoteButton.setText(Messages.MavenArchetypesPreferencePage_btnAddRemote); +- addRemoteButton.addSelectionListener(new SelectionAdapter() { +- public void widgetSelected(SelectionEvent e) { +- RemoteArchetypeCatalogDialog dialog = new RemoteArchetypeCatalogDialog(getShell(), null); +- if(dialog.open() == Window.OK) { +- addCatalogFactory(dialog.getArchetypeCatalogFactory()); +- } +- } +- }); +- +- final Button editButton = new Button(composite, SWT.NONE); +- editButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false)); +- editButton.setEnabled(false); +- editButton.setText(Messages.MavenArchetypesPreferencePage_btnEdit); +- editButton.addSelectionListener(new SelectionAdapter() { +- public void widgetSelected(SelectionEvent e) { +- ArchetypeCatalogFactory factory = getSelectedArchetypeCatalogFactory(); +- ArchetypeCatalogFactory newFactory = null; +- if(factory instanceof LocalCatalogFactory) { +- LocalArchetypeCatalogDialog dialog = new LocalArchetypeCatalogDialog(getShell(), factory); +- if(dialog.open() == Window.OK) { +- newFactory = dialog.getArchetypeCatalogFactory(); +- } +- } else if(factory instanceof RemoteCatalogFactory) { +- RemoteArchetypeCatalogDialog dialog = new RemoteArchetypeCatalogDialog(getShell(), factory); +- if(dialog.open() == Window.OK) { +- newFactory = dialog.getArchetypeCatalogFactory(); +- } +- } +- if(newFactory != null) { +- int n = archetypeCatalogs.indexOf(factory); +- if(n > -1) { +- archetypeCatalogs.set(n, newFactory); +- archetypesViewer.setInput(archetypeCatalogs); +- archetypesViewer.setSelection(new StructuredSelection(newFactory), true); +- } +- } +- } +- }); +- +- final Button removeButton = new Button(composite, SWT.NONE); +- removeButton.setEnabled(false); +- removeButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, true)); +- removeButton.setText(Messages.MavenArchetypesPreferencePage_btnRemove); +- removeButton.addSelectionListener(new SelectionAdapter() { +- public void widgetSelected(SelectionEvent e) { +- ArchetypeCatalogFactory factory = getSelectedArchetypeCatalogFactory(); +- archetypeCatalogs.remove(factory); +- archetypesViewer.setInput(archetypeCatalogs); +- archetypesViewer.setSelection(null, true); +- } +- }); +- +- archetypesViewer.addSelectionChangedListener(event -> { +- if(archetypesViewer.getSelection() instanceof IStructuredSelection) { +- ArchetypeCatalogFactory factory = getSelectedArchetypeCatalogFactory(); +- boolean isEnabled = factory != null && factory.isEditable(); +- removeButton.setEnabled(isEnabled); +- editButton.setEnabled(isEnabled); +- } +- }); +- + archetypesViewer.addCheckStateListener((event) -> { + archetypesViewer.refresh(event.getElement(), true); + }); +@@ -316,18 +220,7 @@ public class MavenArchetypesPreferencePage extends PreferencePage implements IWo + public String getColumnText(Object element, int columnIndex) { + ArchetypeCatalogFactory factory = (ArchetypeCatalogFactory) element; + String description = factory.getDescription(); +- String text; +- if(factory instanceof LocalCatalogFactory) { +- text = NLS.bind(Messages.MavenArchetypesPreferencePage_local, description); +- } else if(factory instanceof RemoteCatalogFactory) { +- if(factory.isEditable()) { +- text = NLS.bind(Messages.MavenArchetypesPreferencePage_remote, description); +- } else { +- text = NLS.bind(Messages.MavenArchetypesPreferencePage_packaged, description); +- } +- } else { +- text = description; +- } ++ String text = description; + + return factory.isEditable() ? text : NLS.bind(Messages.MavenArchetypesPreferencePage_SystemLabel, text); + } +diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypePage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypePage.java +index 663854d..d868da4 100644 +--- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypePage.java ++++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypePage.java +@@ -83,11 +83,13 @@ import org.apache.maven.artifact.Artifact; + import org.apache.maven.artifact.repository.ArtifactRepository; + import org.apache.maven.artifact.versioning.ArtifactVersion; + import org.apache.maven.artifact.versioning.DefaultArtifactVersion; ++import org.apache.maven.project.ProjectBuildingRequest; + + import org.eclipse.m2e.core.MavenPlugin; + import org.eclipse.m2e.core.archetype.ArchetypeUtil; + import org.eclipse.m2e.core.embedder.ArtifactKey; + import org.eclipse.m2e.core.embedder.IMaven; ++import org.eclipse.m2e.core.embedder.IMavenExecutionContext; + import org.eclipse.m2e.core.internal.MavenPluginActivator; + import org.eclipse.m2e.core.internal.archetype.ArchetypeCatalogFactory; + import org.eclipse.m2e.core.internal.archetype.ArchetypeManager; +@@ -850,7 +852,11 @@ public class MavenProjectWizardArchetypePage extends AbstractMavenWizardPage imp + archetype.setRepository(repositoryUrl); + org.apache.maven.archetype.ArchetypeManager archetyper = MavenPluginActivator.getDefault() + .getArchetypeManager().getArchetyper(); +- archetyper.updateLocalCatalog(archetype); ++ ++ IMavenExecutionContext context = maven.createExecutionContext(); ++ ProjectBuildingRequest buildingReq = context.newProjectBuildingRequest(); ++ ++ archetyper.updateLocalCatalog(buildingReq, archetype); + + archetypesCache.clear(); + +diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/ExtensionReader.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/ExtensionReader.java +index a7a4fd4..0afbc71 100644 +--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/ExtensionReader.java ++++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/ExtensionReader.java +@@ -13,11 +13,9 @@ + + package org.eclipse.m2e.core.internal; + +-import java.net.URL; + import java.util.ArrayList; + import java.util.List; + +-import org.osgi.framework.Bundle; + import org.slf4j.Logger; + import org.slf4j.LoggerFactory; + +@@ -84,29 +82,8 @@ public class ExtensionReader { + + private static ArchetypeCatalogFactory readArchetypeCatalogs(IConfigurationElement element, + IContributor contributor) { +- if(ELEMENT_LOCAL_ARCHETYPE.equals(element.getName())) { +- String name = element.getAttribute(ATTR_NAME); +- if(name != null) { +- Bundle[] bundles = Platform.getBundles(contributor.getName(), null); +- URL catalogUrl = null; +- for(int i = 0; i < bundles.length; i++ ) { +- Bundle bundle = bundles[i]; +- catalogUrl = bundle.getEntry(name); +- if(catalogUrl != null) { +- String description = element.getAttribute(ATTR_DESCRIPTION); +- String url = catalogUrl.toString(); +- return new ArchetypeCatalogFactory.LocalCatalogFactory(url, description, false); +- } +- } +- log.error("Unable to find Archetype catalog " + name + " in " + contributor.getName()); +- } +- } else if(ELEMENT_REMOTE_ARCHETYPE.equals(element.getName())) { +- String url = element.getAttribute(ATTR_URL); +- if(url != null) { +- String description = element.getAttribute(ATTR_DESCRIPTION); +- return new ArchetypeCatalogFactory.RemoteCatalogFactory(url, description, false); +- } +- } ++ log.error("Local and remote Archetype catalogs specified by URL from " + contributor.getName() ++ + " are no longer supported"); + return null; + } + +diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/Messages.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/Messages.java +index 0f486cd..069e210 100644 +--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/Messages.java ++++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/Messages.java +@@ -50,8 +50,6 @@ public class Messages extends NLS { + + public static String ArchetypeCatalogFactory_internal; + +- public static String ArchetypeCatalogFactory_local; +- + public static String ArchetypeCatalogFactory_remote; + + public static String ArchetypeCatalogsWriter_error_parse; +diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/archetype/ArchetypeCatalogFactory.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/archetype/ArchetypeCatalogFactory.java +index 8c82854..3da1f1a 100644 +--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/archetype/ArchetypeCatalogFactory.java ++++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/archetype/ArchetypeCatalogFactory.java +@@ -31,10 +31,13 @@ import org.eclipse.osgi.util.NLS; + import org.apache.maven.archetype.ArchetypeManager; + import org.apache.maven.archetype.catalog.Archetype; + import org.apache.maven.archetype.catalog.ArchetypeCatalog; +-import org.apache.maven.archetype.catalog.io.xpp3.ArchetypeCatalogXpp3Reader; + import org.apache.maven.archetype.source.ArchetypeDataSource; + import org.apache.maven.archetype.source.ArchetypeDataSourceException; ++import org.apache.maven.project.ProjectBuildingRequest; + ++import org.eclipse.m2e.core.MavenPlugin; ++import org.eclipse.m2e.core.embedder.IMaven; ++import org.eclipse.m2e.core.embedder.IMavenExecutionContext; + import org.eclipse.m2e.core.internal.IMavenConstants; + import org.eclipse.m2e.core.internal.MavenPluginActivator; + import org.eclipse.m2e.core.internal.Messages; +@@ -107,8 +110,12 @@ public abstract class ArchetypeCatalogFactory { + + public ArchetypeCatalog getArchetypeCatalog() throws CoreException { + try { ++ final IMaven maven = MavenPlugin.getMaven(); ++ IMavenExecutionContext context = maven.createExecutionContext(); ++ ProjectBuildingRequest buildingReq = context.newProjectBuildingRequest(); ++ + ArchetypeDataSource source = MavenPluginActivator.getDefault().getIndexManager().getArchetypeCatalog(); +- return source.getArchetypeCatalog(new Properties()); ++ return source.getArchetypeCatalog(buildingReq); + } catch(ArchetypeDataSourceException ex) { + String msg = NLS.bind(Messages.ArchetypeCatalogFactory_error_missing_catalog, ex.getMessage()); + log.error(msg, ex); +@@ -143,156 +150,11 @@ public abstract class ArchetypeCatalogFactory { + super(ID, Messages.ArchetypeCatalogFactory_default_local, false); + } + +- public ArchetypeCatalog getArchetypeCatalog() { +- return getArchetyper().getDefaultLocalCatalog(); +- } +- } +- +- /** +- * Factory for local ArchetypeCatalog +- */ +- public static class LocalCatalogFactory extends ArchetypeCatalogFactory { +- +- public LocalCatalogFactory(String path, String description, boolean editable) { +- this(path, description, editable, true); +- } +- +- public LocalCatalogFactory(String path, String description, boolean editable, boolean enabled) { +- super(path, description == null || description.trim().length() == 0 +- ? NLS.bind(Messages.ArchetypeCatalogFactory_local, path) +- : description, editable, enabled); +- } +- + public ArchetypeCatalog getArchetypeCatalog() throws CoreException { +- ArchetypeCatalog catalog = getEmbeddedCatalog(); +- if(catalog == null) { +- //local but not embedded catalog +- catalog = getArchetyper().getLocalCatalog(getId()); +- } +- return catalog; +- } +- +- private ArchetypeCatalog getEmbeddedCatalog() throws CoreException { +- URL url = getEmbeddedUrl(); +- if(url == null) { +- //Not an embedded catalog, nothing else to do +- return null; +- } +- try (InputStream is = new BufferedInputStream(url.openStream())) { +- return new ArchetypeCatalogXpp3Reader().read(is); +- } catch(Exception ex) { +- String msg = NLS.bind(Messages.ArchetypeCatalogFactory_error_missing_catalog, ex.getMessage()); +- log.error(msg, ex); +- throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, msg, ex)); +- } +- } +- +- private URL getEmbeddedUrl() { +- String path = getId(); +- if(path != null && path.startsWith("bundleentry://")) { +- try { +- return new URL(path); +- } catch(Exception ex) { +- log.error(ex.getMessage(), ex); +- } +- } +- return null; +- } +- } +- +- /** +- * Factory for remote ArchetypeCatalog +- */ +- public static class RemoteCatalogFactory extends ArchetypeCatalogFactory { +- +- private String repositoryUrl = null; +- +- public RemoteCatalogFactory(String url, String description, boolean editable) { +- this(url, description, editable, true); +- } +- +- public RemoteCatalogFactory(String url, String description, boolean editable, boolean enabled) { +- super(url, description == null || description.trim().length() == 0 +- ? NLS.bind(Messages.ArchetypeCatalogFactory_remote, url) +- : description, editable, enabled); +- repositoryUrl = parseCatalogUrl(url); +- } +- +- /** +- * @param url +- * @return +- */ +- private String parseCatalogUrl(String url) { +- if(url == null) { +- return null; +- } +- int length = url.length(); +- if(length > 1 && url.endsWith("/")) //$NON-NLS-1$ +- { +- return url.substring(0, url.length() - 1); +- } +- int idx = url.lastIndexOf("/"); //$NON-NLS-1$ +- idx = (idx > 0) ? idx : 0; +- if(url.lastIndexOf(".") >= idx) { //$NON-NLS-1$ +- //Assume last fragment of the url is a file, let's keep its parent folder +- return url.substring(0, idx); +- } +- return url; +- } +- +- public ArchetypeCatalog getArchetypeCatalog() { +- String url = getId(); +- int idx = url.lastIndexOf("/archetype-catalog.xml"); +- if(idx > -1) { +- url = url.substring(0, idx); +- } +- final ArchetypeCatalog catalog = getArchetyper().getRemoteCatalog(url); +- final String remoteUrl = url; +- @SuppressWarnings("serial") +- ArchetypeCatalog catalogWrapper = new ArchetypeCatalog() { +- public void addArchetype(Archetype archetype) { +- catalog.addArchetype(archetype); +- } +- +- public List getArchetypes() { +- List archetypes = new ArrayList<>(catalog.getArchetypes()); +- for(Archetype arch : archetypes) { +- if(arch.getRepository() == null || arch.getRepository().trim().isEmpty()) { +- arch.setRepository(remoteUrl); +- } +- } +- return archetypes; +- } +- +- public String getModelEncoding() { +- return catalog.getModelEncoding(); +- } +- +- public void removeArchetype(Archetype archetype) { +- catalog.removeArchetype(archetype); +- } +- +- public void setModelEncoding(String modelEncoding) { +- catalog.setModelEncoding(modelEncoding); +- } +- +- public void setArchetypes(List archetypes) { +- catalog.setArchetypes(archetypes); +- } +- +- public String toString() { +- return catalog.toString(); +- } +- }; +- +- return catalogWrapper; +- } +- +- /** +- * @return the url of the remote repository hosting the catalog +- */ +- public String getRepositoryUrl() { +- return repositoryUrl; ++ final IMaven maven = MavenPlugin.getMaven(); ++ IMavenExecutionContext context = maven.createExecutionContext(); ++ ProjectBuildingRequest buildingReq = context.newProjectBuildingRequest(); ++ return getArchetyper().getLocalCatalog(buildingReq); + } + } + +diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/archetype/ArchetypeCatalogsWriter.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/archetype/ArchetypeCatalogsWriter.java +index 2adb946..31ef580 100644 +--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/archetype/ArchetypeCatalogsWriter.java ++++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/archetype/ArchetypeCatalogsWriter.java +@@ -45,8 +45,6 @@ import org.xml.sax.helpers.XMLFilterImpl; + import org.eclipse.osgi.util.NLS; + + import org.eclipse.m2e.core.internal.Messages; +-import org.eclipse.m2e.core.internal.archetype.ArchetypeCatalogFactory.LocalCatalogFactory; +-import org.eclipse.m2e.core.internal.archetype.ArchetypeCatalogFactory.RemoteCatalogFactory; + + + /** +@@ -63,14 +61,8 @@ public class ArchetypeCatalogsWriter { + + private static final String ATT_CATALOG_TYPE = "type"; //$NON-NLS-1$ + +- private static final String ATT_CATALOG_LOCATION = "location"; //$NON-NLS-1$ +- + public static final String ATT_CATALOG_DESCRIPTION = "description"; //$NON-NLS-1$ + +- private static final String TYPE_LOCAL = "local"; //$NON-NLS-1$ +- +- private static final String TYPE_REMOTE = "remote"; //$NON-NLS-1$ +- + private static final String TYPE_SYSTEM = "system"; //$NON-NLS-1$ + + public static final String ATT_CATALOG_ID = "id"; +@@ -127,20 +119,8 @@ public class ArchetypeCatalogsWriter { + + for(ArchetypeCatalogFactory factory : this.catalogs) { + AttributesImpl attrs = new AttributesImpl(); +- if(factory.isEditable()) { +- if(factory instanceof LocalCatalogFactory) { +- attrs.addAttribute(null, ATT_CATALOG_TYPE, ATT_CATALOG_TYPE, null, TYPE_LOCAL); +- attrs.addAttribute(null, ATT_CATALOG_LOCATION, ATT_CATALOG_LOCATION, null, factory.getId()); +- attrs.addAttribute(null, ATT_CATALOG_DESCRIPTION, ATT_CATALOG_DESCRIPTION, null, factory.getDescription()); +- } else if(factory instanceof RemoteCatalogFactory) { +- attrs.addAttribute(null, ATT_CATALOG_TYPE, ATT_CATALOG_TYPE, null, TYPE_REMOTE); +- attrs.addAttribute(null, ATT_CATALOG_LOCATION, ATT_CATALOG_LOCATION, null, factory.getId()); +- attrs.addAttribute(null, ATT_CATALOG_DESCRIPTION, ATT_CATALOG_DESCRIPTION, null, factory.getDescription()); +- } +- } else { +- attrs.addAttribute(null, ATT_CATALOG_TYPE, ATT_CATALOG_TYPE, null, TYPE_SYSTEM); +- attrs.addAttribute(null, ATT_CATALOG_ID, ATT_CATALOG_ID, null, factory.getId()); +- } ++ attrs.addAttribute(null, ATT_CATALOG_TYPE, ATT_CATALOG_TYPE, null, TYPE_SYSTEM); ++ attrs.addAttribute(null, ATT_CATALOG_ID, ATT_CATALOG_ID, null, factory.getId()); + attrs.addAttribute(null, ATT_CATALOG_ENABLED, ATT_CATALOG_ENABLED, null, Boolean.toString(factory.isEnabled())); + handler.startElement(null, ELEMENT_CATALOG, ELEMENT_CATALOG, attrs); + handler.endElement(null, ELEMENT_CATALOG, ELEMENT_CATALOG); +@@ -165,28 +145,13 @@ public class ArchetypeCatalogsWriter { + + public void startElement(String uri, String localName, String qName, Attributes attributes) { + if(ELEMENT_CATALOG.equals(qName) && attributes != null) { +- String type = attributes.getValue(ATT_CATALOG_TYPE); + String enabledStr = attributes.getValue(ATT_CATALOG_ENABLED); + boolean enabled = enabledStr==null||Boolean.parseBoolean(enabledStr); +- if(TYPE_LOCAL.equals(type)) { +- String path = attributes.getValue(ATT_CATALOG_LOCATION); +- if(path != null) { +- String description = attributes.getValue(ATT_CATALOG_DESCRIPTION); +- catalogs.add(new LocalCatalogFactory(path, description, true, enabled)); +- } +- } else if(TYPE_REMOTE.equals(type)) { +- String url = attributes.getValue(ATT_CATALOG_LOCATION); +- if(url != null) { +- String description = attributes.getValue(ATT_CATALOG_DESCRIPTION); +- catalogs.add(new RemoteCatalogFactory(url, description, true, enabled)); +- } +- } else { +- String id = attributes.getValue(ATT_CATALOG_ID); +- if(id != null && !id.isEmpty()) { +- ArchetypeCatalogFactory catalog = existingCatalogs.get(id); +- if(catalog != null) { +- catalog.setEnabled(enabled); +- } ++ String id = attributes.getValue(ATT_CATALOG_ID); ++ if(id != null && !id.isEmpty()) { ++ ArchetypeCatalogFactory catalog = existingCatalogs.get(id); ++ if(catalog != null) { ++ catalog.setEnabled(enabled); + } + } + } +diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/archetype/ArchetypeManager.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/archetype/ArchetypeManager.java +index 6096dab..34d54d4 100644 +--- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/archetype/ArchetypeManager.java ++++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/archetype/ArchetypeManager.java +@@ -183,11 +183,12 @@ public class ArchetypeManager { + return maven.execute(new ICallable>() { + public List call(IMavenExecutionContext context, IProgressMonitor monitor) { + ArtifactRepository localRepository = context.getLocalRepository(); +- if(aaMgr.isFileSetArchetype(groupId, artifactId, version, null, localRepository, repositories)) { ++ if(aaMgr.isFileSetArchetype(groupId, artifactId, version, null, localRepository, repositories, ++ context.newProjectBuildingRequest())) { + ArchetypeDescriptor descriptor; + try { + descriptor = aaMgr.getFileSetArchetypeDescriptor(groupId, artifactId, version, null, localRepository, +- repositories); ++ repositories, context.newProjectBuildingRequest()); + } catch(UnknownArchetype ex) { + throw new WrappedUnknownArchetype(ex); + } +-- +2.21.0 + diff --git a/0007-Port-to-latest-version-of-maven-archetypes.patch b/0007-Port-to-latest-version-of-maven-archetypes.patch deleted file mode 100644 index 277e17f..0000000 --- a/0007-Port-to-latest-version-of-maven-archetypes.patch +++ /dev/null @@ -1,1169 +0,0 @@ -From 6813e7ebd71472751e1a77265e8be578de0cb251 Mon Sep 17 00:00:00 2001 -From: Mat Booth -Date: Wed, 3 Jul 2019 15:29:05 +0100 -Subject: [PATCH 7/7] Port to latest version of maven-archetypes - -Change-Id: I208abd50bdbe420d5413ad12bbe5150c428c9453 ---- - .../org.eclipse.m2e.archetype.common/pom.xml | 9 +- - .../LocalArchetypeCatalogDialog.java | 237 -------------- - .../MavenArchetypesPreferencePage.java | 96 +----- - .../RemoteArchetypeCatalogDialog.java | 305 ------------------ - .../MavenProjectWizardArchetypePage.java | 8 +- - .../m2e/core/internal/ExtensionReader.java | 27 +- - .../eclipse/m2e/core/internal/Messages.java | 2 - - .../archetype/ArchetypeCatalogFactory.java | 174 +--------- - .../archetype/ArchetypeCatalogsWriter.java | 49 +-- - .../internal/archetype/ArchetypeManager.java | 5 +- - .../m2e/core/internal/messages.properties | 1 - - 11 files changed, 34 insertions(+), 879 deletions(-) - delete mode 100644 org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/LocalArchetypeCatalogDialog.java - delete mode 100644 org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/RemoteArchetypeCatalogDialog.java - -diff --git a/m2e-maven-runtime/org.eclipse.m2e.archetype.common/pom.xml b/m2e-maven-runtime/org.eclipse.m2e.archetype.common/pom.xml -index 4975150..bc6abc1 100644 ---- a/m2e-maven-runtime/org.eclipse.m2e.archetype.common/pom.xml -+++ b/m2e-maven-runtime/org.eclipse.m2e.archetype.common/pom.xml -@@ -22,7 +22,7 @@ - Maven Archetype Common Bundle - - -- 2.4 -+ 3.1.1 - - - -@@ -32,11 +32,6 @@ - ${archetype-common.version} - true - -- -- -- velocity -- velocity -- - - plexus-container-default - org.codehaus.plexus -@@ -65,12 +60,10 @@ - archetype-common, - archetype-catalog, - archetype-descriptor, -- archetype-registry, - maven-invoker, - commons-collections, - commons-io, - commons-lang, -- dom4j, - jchardet, - jdom, - oro, -diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/LocalArchetypeCatalogDialog.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/LocalArchetypeCatalogDialog.java -deleted file mode 100644 -index 0301bdd..0000000 ---- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/LocalArchetypeCatalogDialog.java -+++ /dev/null -@@ -1,237 +0,0 @@ --/******************************************************************************* -- * Copyright (c) 2008-2018 Sonatype, Inc. -- * All rights reserved. This program and the accompanying materials -- * are made available under the terms of the Eclipse Public License v1.0 -- * which accompanies this distribution, and is available at -- * http://www.eclipse.org/legal/epl-v10.html -- * -- * Contributors: -- * Sonatype, Inc. - initial API and implementation -- *******************************************************************************/ -- --package org.eclipse.m2e.core.ui.internal.preferences; -- --import java.io.File; --import java.util.ArrayList; --import java.util.Arrays; --import java.util.List; -- --import org.eclipse.core.runtime.CoreException; --import org.eclipse.core.runtime.IStatus; --import org.eclipse.jface.dialogs.DialogSettings; --import org.eclipse.jface.dialogs.IDialogConstants; --import org.eclipse.jface.dialogs.IDialogSettings; --import org.eclipse.jface.dialogs.TitleAreaDialog; --import org.eclipse.osgi.util.NLS; --import org.eclipse.swt.SWT; --import org.eclipse.swt.events.ModifyEvent; --import org.eclipse.swt.events.ModifyListener; --import org.eclipse.swt.events.SelectionAdapter; --import org.eclipse.swt.events.SelectionEvent; --import org.eclipse.swt.layout.GridData; --import org.eclipse.swt.layout.GridLayout; --import org.eclipse.swt.widgets.Button; --import org.eclipse.swt.widgets.Combo; --import org.eclipse.swt.widgets.Composite; --import org.eclipse.swt.widgets.Control; --import org.eclipse.swt.widgets.FileDialog; --import org.eclipse.swt.widgets.Label; --import org.eclipse.swt.widgets.Shell; --import org.eclipse.swt.widgets.Text; -- --import org.apache.maven.archetype.catalog.Archetype; --import org.apache.maven.archetype.catalog.ArchetypeCatalog; -- --import org.eclipse.m2e.core.internal.archetype.ArchetypeCatalogFactory; --import org.eclipse.m2e.core.internal.archetype.ArchetypeCatalogFactory.LocalCatalogFactory; --import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator; --import org.eclipse.m2e.core.ui.internal.Messages; -- -- --/** -- * Local Archetype catalog dialog -- * -- * @author Eugene Kuleshov -- */ --public class LocalArchetypeCatalogDialog extends TitleAreaDialog { -- -- private static final String DIALOG_SETTINGS = LocalArchetypeCatalogDialog.class.getName(); -- -- private static final String KEY_LOCATIONS = "catalogLocation"; //$NON-NLS-1$ -- -- private static final int MAX_HISTORY = 15; -- -- private String title; -- -- private String message; -- -- Combo catalogLocationCombo; -- -- private Text catalogDescriptionText; -- -- private IDialogSettings dialogSettings; -- -- private ArchetypeCatalogFactory archetypeCatalogFactory; -- -- protected LocalArchetypeCatalogDialog(Shell shell, ArchetypeCatalogFactory factory) { -- super(shell); -- this.archetypeCatalogFactory = factory; -- this.title = Messages.LocalArchetypeCatalogDialog_title; -- this.message = Messages.LocalArchetypeCatalogDialog_message; -- setShellStyle(SWT.DIALOG_TRIM); -- setHelpAvailable(false); -- -- IDialogSettings pluginSettings = M2EUIPluginActivator.getDefault().getDialogSettings(); -- dialogSettings = pluginSettings.getSection(DIALOG_SETTINGS); -- if(dialogSettings == null) { -- dialogSettings = new DialogSettings(DIALOG_SETTINGS); -- pluginSettings.addSection(dialogSettings); -- } -- } -- -- protected Control createContents(Composite parent) { -- Control control = super.createContents(parent); -- setTitle(title); -- setMessage(message); -- return control; -- } -- -- protected Control createDialogArea(Composite parent) { -- Composite composite1 = (Composite) super.createDialogArea(parent); -- -- Composite composite = new Composite(composite1, SWT.NONE); -- composite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false)); -- GridLayout gridLayout = new GridLayout(); -- gridLayout.marginTop = 7; -- gridLayout.marginWidth = 12; -- gridLayout.numColumns = 3; -- composite.setLayout(gridLayout); -- -- Label catalogLocationLabel = new Label(composite, SWT.NONE); -- catalogLocationLabel.setText(Messages.LocalArchetypeCatalogDialog_lblCatalog); -- -- catalogLocationCombo = new Combo(composite, SWT.NONE); -- GridData gd_catalogLocationCombo = new GridData(SWT.FILL, SWT.CENTER, true, false); -- gd_catalogLocationCombo.widthHint = 250; -- catalogLocationCombo.setLayoutData(gd_catalogLocationCombo); -- catalogLocationCombo.setItems(getSavedValues(KEY_LOCATIONS)); -- -- Button browseButton = new Button(composite, SWT.NONE); -- browseButton.setText(Messages.LocalArchetypeCatalogDialog_btnBrowse); -- browseButton.addSelectionListener(new SelectionAdapter() { -- public void widgetSelected(SelectionEvent e) { -- FileDialog dialog = new FileDialog(getShell()); -- dialog.setText(Messages.LocalArchetypeCatalogDialog_dialog_title); -- String location = dialog.open(); -- if(location != null) { -- catalogLocationCombo.setText(location); -- update(); -- } -- } -- }); -- setButtonLayoutData(browseButton); -- -- Label catalogDescriptionLabel = new Label(composite, SWT.NONE); -- catalogDescriptionLabel.setText(Messages.LocalArchetypeCatalogDialog_lblDesc); -- -- catalogDescriptionText = new Text(composite, SWT.BORDER); -- catalogDescriptionText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1)); -- -- if(archetypeCatalogFactory != null) { -- catalogLocationCombo.setText(archetypeCatalogFactory.getId()); -- catalogDescriptionText.setText(archetypeCatalogFactory.getDescription()); -- } -- -- ModifyListener modifyListener = new ModifyListener() { -- public void modifyText(final ModifyEvent e) { -- update(); -- } -- }; -- catalogLocationCombo.addModifyListener(modifyListener); -- catalogDescriptionText.addModifyListener(modifyListener); -- -- return composite; -- } -- -- private String[] getSavedValues(String key) { -- String[] array = dialogSettings.getArray(key); -- return array == null ? new String[0] : array; -- } -- -- protected void configureShell(Shell shell) { -- super.configureShell(shell); -- shell.setText(title); -- } -- -- public void create() { -- super.create(); -- getButton(IDialogConstants.OK_ID).setEnabled(false); -- } -- -- protected void okPressed() { -- String description = catalogDescriptionText.getText().trim(); -- String location = catalogLocationCombo.getText().trim(); -- -- archetypeCatalogFactory = new LocalCatalogFactory(location, description, true); -- -- saveValue(KEY_LOCATIONS, location); -- -- super.okPressed(); -- } -- -- public ArchetypeCatalogFactory getArchetypeCatalogFactory() { -- return archetypeCatalogFactory; -- } -- -- private void saveValue(String key, String value) { -- List dirs = new ArrayList(); -- dirs.addAll(Arrays.asList(getSavedValues(key))); -- -- dirs.remove(value); -- dirs.add(0, value); -- -- if(dirs.size() > MAX_HISTORY) { -- dirs = dirs.subList(0, MAX_HISTORY); -- } -- -- dialogSettings.put(key, dirs.toArray(new String[dirs.size()])); -- } -- -- void update() { -- boolean isValid = isValid(); -- // verifyButton.setEnabled(isValid); -- getButton(IDialogConstants.OK_ID).setEnabled(isValid); -- } -- -- private boolean isValid() { -- setErrorMessage(null); -- setMessage(null, IStatus.WARNING); -- -- String location = catalogLocationCombo.getText().trim(); -- if(location.length() == 0) { -- setErrorMessage(Messages.LocalArchetypeCatalogDialog_error_no_location); -- return false; -- } -- -- if(!new File(location).exists()) { -- setErrorMessage(Messages.LocalArchetypeCatalogDialog_error_exist); -- return false; -- } -- -- LocalCatalogFactory factory = new LocalCatalogFactory(location, null, true); -- ArchetypeCatalog archetypeCatalog; -- try { -- archetypeCatalog = factory.getArchetypeCatalog(); -- } catch(CoreException ex) { -- setMessage(NLS.bind(Messages.LocalArchetypeCatalogDialog_error, ex.getMessage()), IStatus.ERROR); -- return false; -- } -- List archetypes = archetypeCatalog.getArchetypes(); -- if(archetypes == null || archetypes.size() == 0) { -- setMessage(Messages.LocalArchetypeCatalogDialog_error_empty, IStatus.WARNING); -- } -- -- return true; -- } -- --} -diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenArchetypesPreferencePage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenArchetypesPreferencePage.java -index 31ebd44..83ad59f 100644 ---- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenArchetypesPreferencePage.java -+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/MavenArchetypesPreferencePage.java -@@ -26,14 +26,11 @@ import org.eclipse.jface.preference.PreferencePage; - import org.eclipse.jface.viewers.CheckboxTableViewer; - import org.eclipse.jface.viewers.IColorProvider; - import org.eclipse.jface.viewers.ILabelProviderListener; --import org.eclipse.jface.viewers.ISelectionChangedListener; - import org.eclipse.jface.viewers.IStructuredContentProvider; - import org.eclipse.jface.viewers.IStructuredSelection; - import org.eclipse.jface.viewers.ITableLabelProvider; --import org.eclipse.jface.viewers.SelectionChangedEvent; - import org.eclipse.jface.viewers.StructuredSelection; - import org.eclipse.jface.viewers.Viewer; --import org.eclipse.jface.window.Window; - import org.eclipse.osgi.util.NLS; - import org.eclipse.swt.SWT; - import org.eclipse.swt.events.SelectionAdapter; -@@ -57,8 +54,6 @@ import org.eclipse.ui.browser.IWebBrowser; - - import org.eclipse.m2e.core.internal.MavenPluginActivator; - import org.eclipse.m2e.core.internal.archetype.ArchetypeCatalogFactory; --import org.eclipse.m2e.core.internal.archetype.ArchetypeCatalogFactory.LocalCatalogFactory; --import org.eclipse.m2e.core.internal.archetype.ArchetypeCatalogFactory.RemoteCatalogFactory; - import org.eclipse.m2e.core.internal.archetype.ArchetypeManager; - import org.eclipse.m2e.core.ui.internal.Messages; - -@@ -199,84 +194,6 @@ public class MavenArchetypesPreferencePage extends PreferencePage implements IWo - } - }); - -- Button addLocalButton = new Button(composite, SWT.NONE); -- addLocalButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false)); -- addLocalButton.setText(Messages.MavenArchetypesPreferencePage_btnAddLocal); -- addLocalButton.addSelectionListener(new SelectionAdapter() { -- public void widgetSelected(SelectionEvent e) { -- LocalArchetypeCatalogDialog dialog = new LocalArchetypeCatalogDialog(getShell(), null); -- if(dialog.open() == Window.OK) { -- addCatalogFactory(dialog.getArchetypeCatalogFactory()); -- } -- } -- }); -- -- Button addRemoteButton = new Button(composite, SWT.NONE); -- addRemoteButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false)); -- addRemoteButton.setText(Messages.MavenArchetypesPreferencePage_btnAddRemote); -- addRemoteButton.addSelectionListener(new SelectionAdapter() { -- public void widgetSelected(SelectionEvent e) { -- RemoteArchetypeCatalogDialog dialog = new RemoteArchetypeCatalogDialog(getShell(), null); -- if(dialog.open() == Window.OK) { -- addCatalogFactory(dialog.getArchetypeCatalogFactory()); -- } -- } -- }); -- -- final Button editButton = new Button(composite, SWT.NONE); -- editButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false)); -- editButton.setEnabled(false); -- editButton.setText(Messages.MavenArchetypesPreferencePage_btnEdit); -- editButton.addSelectionListener(new SelectionAdapter() { -- public void widgetSelected(SelectionEvent e) { -- ArchetypeCatalogFactory factory = getSelectedArchetypeCatalogFactory(); -- ArchetypeCatalogFactory newFactory = null; -- if(factory instanceof LocalCatalogFactory) { -- LocalArchetypeCatalogDialog dialog = new LocalArchetypeCatalogDialog(getShell(), factory); -- if(dialog.open() == Window.OK) { -- newFactory = dialog.getArchetypeCatalogFactory(); -- } -- } else if(factory instanceof RemoteCatalogFactory) { -- RemoteArchetypeCatalogDialog dialog = new RemoteArchetypeCatalogDialog(getShell(), factory); -- if(dialog.open() == Window.OK) { -- newFactory = dialog.getArchetypeCatalogFactory(); -- } -- } -- if(newFactory != null) { -- int n = archetypeCatalogs.indexOf(factory); -- if(n > -1) { -- archetypeCatalogs.set(n, newFactory); -- archetypesViewer.setInput(archetypeCatalogs); -- archetypesViewer.setSelection(new StructuredSelection(newFactory), true); -- } -- } -- } -- }); -- -- final Button removeButton = new Button(composite, SWT.NONE); -- removeButton.setEnabled(false); -- removeButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, true)); -- removeButton.setText(Messages.MavenArchetypesPreferencePage_btnRemove); -- removeButton.addSelectionListener(new SelectionAdapter() { -- public void widgetSelected(SelectionEvent e) { -- ArchetypeCatalogFactory factory = getSelectedArchetypeCatalogFactory(); -- archetypeCatalogs.remove(factory); -- archetypesViewer.setInput(archetypeCatalogs); -- archetypesViewer.setSelection(null, true); -- } -- }); -- -- archetypesViewer.addSelectionChangedListener(new ISelectionChangedListener() { -- public void selectionChanged(SelectionChangedEvent event) { -- if(archetypesViewer.getSelection() instanceof IStructuredSelection) { -- ArchetypeCatalogFactory factory = getSelectedArchetypeCatalogFactory(); -- boolean isEnabled = factory != null && factory.isEditable(); -- removeButton.setEnabled(isEnabled); -- editButton.setEnabled(isEnabled); -- } -- } -- }); -- - archetypesViewer.addCheckStateListener((event) -> { - archetypesViewer.refresh(event.getElement(), true); - }); -@@ -318,18 +235,7 @@ public class MavenArchetypesPreferencePage extends PreferencePage implements IWo - public String getColumnText(Object element, int columnIndex) { - ArchetypeCatalogFactory factory = (ArchetypeCatalogFactory) element; - String description = factory.getDescription(); -- String text; -- if(factory instanceof LocalCatalogFactory) { -- text = NLS.bind(Messages.MavenArchetypesPreferencePage_local, description); -- } else if(factory instanceof RemoteCatalogFactory) { -- if(factory.isEditable()) { -- text = NLS.bind(Messages.MavenArchetypesPreferencePage_remote, description); -- } else { -- text = NLS.bind(Messages.MavenArchetypesPreferencePage_packaged, description); -- } -- } else { -- text = description; -- } -+ String text = description; - - return factory.isEditable() ? text : NLS.bind(Messages.MavenArchetypesPreferencePage_SystemLabel, text); - } -diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/RemoteArchetypeCatalogDialog.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/RemoteArchetypeCatalogDialog.java -deleted file mode 100644 -index afedca3..0000000 ---- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/preferences/RemoteArchetypeCatalogDialog.java -+++ /dev/null -@@ -1,305 +0,0 @@ --/******************************************************************************* -- * Copyright (c) 2008-2018 Sonatype, Inc. -- * All rights reserved. This program and the accompanying materials -- * are made available under the terms of the Eclipse Public License v1.0 -- * which accompanies this distribution, and is available at -- * http://www.eclipse.org/legal/epl-v10.html -- * -- * Contributors: -- * Sonatype, Inc. - initial API and implementation -- *******************************************************************************/ -- --package org.eclipse.m2e.core.ui.internal.preferences; -- --import java.net.URL; --import java.util.ArrayList; --import java.util.Arrays; --import java.util.Collections; --import java.util.List; -- --import org.eclipse.core.runtime.IProgressMonitor; --import org.eclipse.core.runtime.IStatus; --import org.eclipse.core.runtime.Status; --import org.eclipse.core.runtime.jobs.Job; --import org.eclipse.jface.dialogs.DialogSettings; --import org.eclipse.jface.dialogs.IDialogConstants; --import org.eclipse.jface.dialogs.IDialogSettings; --import org.eclipse.jface.dialogs.TitleAreaDialog; --import org.eclipse.osgi.util.NLS; --import org.eclipse.swt.SWT; --import org.eclipse.swt.events.ModifyEvent; --import org.eclipse.swt.events.ModifyListener; --import org.eclipse.swt.events.SelectionAdapter; --import org.eclipse.swt.events.SelectionEvent; --import org.eclipse.swt.layout.GridData; --import org.eclipse.swt.layout.GridLayout; --import org.eclipse.swt.widgets.Button; --import org.eclipse.swt.widgets.Combo; --import org.eclipse.swt.widgets.Composite; --import org.eclipse.swt.widgets.Control; --import org.eclipse.swt.widgets.Label; --import org.eclipse.swt.widgets.Shell; --import org.eclipse.swt.widgets.Text; -- --import org.apache.maven.archetype.catalog.Archetype; --import org.apache.maven.archetype.catalog.ArchetypeCatalog; -- --import org.eclipse.m2e.core.internal.archetype.ArchetypeCatalogFactory; --import org.eclipse.m2e.core.internal.archetype.ArchetypeCatalogFactory.RemoteCatalogFactory; --import org.eclipse.m2e.core.ui.internal.M2EUIPluginActivator; --import org.eclipse.m2e.core.ui.internal.Messages; -- -- --/** -- * Remote Archetype catalog dialog -- * -- * @author Eugene Kuleshov -- */ --public class RemoteArchetypeCatalogDialog extends TitleAreaDialog { -- -- /** -- * -- */ -- private static final int VERIFY_ID = IDialogConstants.CLIENT_ID + 1; -- -- private static final String DIALOG_SETTINGS = RemoteArchetypeCatalogDialog.class.getName(); -- -- private static final String KEY_LOCATIONS = "catalogUrl"; //$NON-NLS-1$ -- -- private static final int MAX_HISTORY = 15; -- -- private String title; -- -- private String message; -- -- Combo catalogUrlCombo; -- -- private Text catalogDescriptionText; -- -- private IDialogSettings dialogSettings; -- -- private ArchetypeCatalogFactory archetypeCatalogFactory; -- -- Button verifyButton; -- -- protected RemoteArchetypeCatalogDialog(Shell shell, ArchetypeCatalogFactory factory) { -- super(shell); -- this.archetypeCatalogFactory = factory; -- this.title = Messages.RemoteArchetypeCatalogDialog_title; -- this.message = Messages.RemoteArchetypeCatalogDialog_message; -- setShellStyle(SWT.DIALOG_TRIM); -- setHelpAvailable(false); -- -- IDialogSettings pluginSettings = M2EUIPluginActivator.getDefault().getDialogSettings(); -- dialogSettings = pluginSettings.getSection(DIALOG_SETTINGS); -- if(dialogSettings == null) { -- dialogSettings = new DialogSettings(DIALOG_SETTINGS); -- pluginSettings.addSection(dialogSettings); -- } -- } -- -- protected Control createContents(Composite parent) { -- Control control = super.createContents(parent); -- setTitle(title); -- setMessage(message); -- update(); -- return control; -- } -- -- protected Control createDialogArea(Composite parent) { -- Composite composite1 = (Composite) super.createDialogArea(parent); -- -- Composite composite = new Composite(composite1, SWT.NONE); -- composite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false)); -- GridLayout gridLayout = new GridLayout(); -- gridLayout.marginTop = 7; -- gridLayout.marginWidth = 12; -- gridLayout.numColumns = 2; -- composite.setLayout(gridLayout); -- -- Label catalogLocationLabel = new Label(composite, SWT.NONE); -- catalogLocationLabel.setText(Messages.RemoteArchetypeCatalogDialog_lblCatalog); -- -- catalogUrlCombo = new Combo(composite, SWT.NONE); -- GridData gd_catalogLocationCombo = new GridData(SWT.FILL, SWT.CENTER, true, false); -- gd_catalogLocationCombo.widthHint = 250; -- catalogUrlCombo.setLayoutData(gd_catalogLocationCombo); -- catalogUrlCombo.setItems(getSavedValues(KEY_LOCATIONS)); -- -- Label catalogDescriptionLabel = new Label(composite, SWT.NONE); -- catalogDescriptionLabel.setText(Messages.RemoteArchetypeCatalogDialog_lblDesc); -- -- catalogDescriptionText = new Text(composite, SWT.BORDER); -- catalogDescriptionText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); -- -- if(archetypeCatalogFactory != null) { -- catalogUrlCombo.setText(archetypeCatalogFactory.getId()); -- catalogDescriptionText.setText(archetypeCatalogFactory.getDescription()); -- } -- -- ModifyListener modifyListener = new ModifyListener() { -- public void modifyText(final ModifyEvent e) { -- update(); -- } -- }; -- catalogUrlCombo.addModifyListener(modifyListener); -- catalogDescriptionText.addModifyListener(modifyListener); -- -- return composite; -- } -- -- /* (non-Javadoc) -- * @see org.eclipse.jface.dialogs.TrayDialog#createButtonBar(org.eclipse.swt.widgets.Composite) -- */ -- protected Control createButtonBar(Composite parent) { -- Composite composite = new Composite(parent, SWT.NONE); -- GridLayout layout = new GridLayout(); -- layout.marginHeight = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN); -- layout.marginWidth = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_MARGIN); -- layout.verticalSpacing = convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_SPACING); -- layout.horizontalSpacing = convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING); -- composite.setLayout(layout); -- composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false)); -- composite.setFont(parent.getFont()); -- -- // create help control if needed -- if(isHelpAvailable()) { -- createHelpControl(composite); -- } -- -- verifyButton = createButton(composite, VERIFY_ID, Messages.RemoteArchetypeCatalogDialog_btnVerify, false); -- verifyButton.addSelectionListener(new SelectionAdapter() { -- public void widgetSelected(SelectionEvent e) { -- verifyButton.setEnabled(false); -- String url = catalogUrlCombo.getText(); -- final RemoteCatalogFactory factory = new RemoteCatalogFactory(url, null, true); -- -- new Job(Messages.RemoteArchetypeCatalogDialog_job_download) { -- protected IStatus run(IProgressMonitor monitor) { -- IStatus status = Status.OK_STATUS; -- ArchetypeCatalog catalog = null; -- try { -- catalog = factory.getArchetypeCatalog(); -- } finally { -- final IStatus s = status; -- final List archetypes = ((catalog == null) ? Collections.emptyList() -- : catalog.getArchetypes()); -- Shell shell = getShell(); -- if(shell == null) { -- return status; -- } -- shell.getDisplay().asyncExec(new Runnable() { -- public void run() { -- if(verifyButton.isDisposed()) { -- return; -- } -- verifyButton.setEnabled(true); -- if(!s.isOK()) { -- setErrorMessage(NLS.bind(Messages.RemoteArchetypeCatalogDialog_error_read, s.getMessage())); -- getButton(IDialogConstants.OK_ID).setEnabled(false); -- } else if(archetypes.size() == 0) { -- setMessage(Messages.RemoteArchetypeCatalogDialog_error_empty, IStatus.WARNING); -- } else { -- setMessage(NLS.bind(Messages.RemoteArchetypeCatalogDialog_message_found, archetypes.size()), -- IStatus.INFO); -- } -- } -- }); -- } -- return Status.OK_STATUS; -- } -- }.schedule(); -- } -- }); -- -- Label filler = new Label(composite, SWT.NONE); -- filler.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.GRAB_HORIZONTAL)); -- layout.numColumns++ ; -- -- super.createButtonsForButtonBar(composite); // cancel button -- -- return composite; -- } -- -- protected Button getButton(int id) { -- return super.getButton(id); -- } -- -- private String[] getSavedValues(String key) { -- String[] array = dialogSettings.getArray(key); -- return array == null ? new String[0] : array; -- } -- -- protected void configureShell(Shell shell) { -- super.configureShell(shell); -- shell.setText(title); -- } -- -- public void create() { -- super.create(); -- getButton(IDialogConstants.OK_ID).setEnabled(false); -- } -- -- protected void okPressed() { -- String description = catalogDescriptionText.getText().trim(); -- String location = catalogUrlCombo.getText().trim(); -- -- archetypeCatalogFactory = new RemoteCatalogFactory(location, description, true); -- -- saveValue(KEY_LOCATIONS, location); -- -- super.okPressed(); -- } -- -- public ArchetypeCatalogFactory getArchetypeCatalogFactory() { -- return archetypeCatalogFactory; -- } -- -- private void saveValue(String key, String value) { -- List dirs = new ArrayList(); -- dirs.addAll(Arrays.asList(getSavedValues(key))); -- -- dirs.remove(value); -- dirs.add(0, value); -- -- if(dirs.size() > MAX_HISTORY) { -- dirs = dirs.subList(0, MAX_HISTORY); -- } -- -- dialogSettings.put(key, dirs.toArray(new String[dirs.size()])); -- } -- -- void update() { -- boolean isValid = isValid(); -- getButton(IDialogConstants.OK_ID).setEnabled(isValid); -- getButton(VERIFY_ID).setEnabled(isValid); -- } -- -- private boolean isValid() { -- setErrorMessage(null); -- setMessage(null, IStatus.WARNING); -- -- String url = catalogUrlCombo.getText().trim(); -- boolean isValid = false; -- if(url.isEmpty()) { -- setErrorMessage(Messages.RemoteArchetypeCatalogDialog_error_required); -- } else if(!isWellFormedUrl(url)) { -- setErrorMessage(NLS.bind(Messages.RemoteArchetypeCatalogDialog_error_invalidUrl, url)); -- } else { -- isValid = true; -- } -- verifyButton.setEnabled(isValid); -- return isValid; -- } -- -- public boolean isWellFormedUrl(String url) { -- try { -- new URL(url).toURI(); -- return true; -- } catch(Exception O_o) { -- //Not good enough -- } -- return false; -- } -- --} -diff --git a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypePage.java b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypePage.java -index aa5ecdf..28ca448 100644 ---- a/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypePage.java -+++ b/org.eclipse.m2e.core.ui/src/org/eclipse/m2e/core/ui/internal/wizards/MavenProjectWizardArchetypePage.java -@@ -85,11 +85,13 @@ import org.apache.maven.artifact.Artifact; - import org.apache.maven.artifact.repository.ArtifactRepository; - import org.apache.maven.artifact.versioning.ArtifactVersion; - import org.apache.maven.artifact.versioning.DefaultArtifactVersion; -+import org.apache.maven.project.ProjectBuildingRequest; - - import org.eclipse.m2e.core.MavenPlugin; - import org.eclipse.m2e.core.archetype.ArchetypeUtil; - import org.eclipse.m2e.core.embedder.ArtifactKey; - import org.eclipse.m2e.core.embedder.IMaven; -+import org.eclipse.m2e.core.embedder.IMavenExecutionContext; - import org.eclipse.m2e.core.internal.MavenPluginActivator; - import org.eclipse.m2e.core.internal.archetype.ArchetypeCatalogFactory; - import org.eclipse.m2e.core.internal.archetype.ArchetypeManager; -@@ -879,7 +881,11 @@ public class MavenProjectWizardArchetypePage extends AbstractMavenWizardPage imp - archetype.setRepository(repositoryUrl); - org.apache.maven.archetype.ArchetypeManager archetyper = MavenPluginActivator.getDefault() - .getArchetypeManager().getArchetyper(); -- archetyper.updateLocalCatalog(archetype); -+ -+ IMavenExecutionContext context = maven.createExecutionContext(); -+ ProjectBuildingRequest buildingReq = context.newProjectBuildingRequest(); -+ -+ archetyper.updateLocalCatalog(buildingReq, archetype); - - archetypesCache.clear(); - -diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/ExtensionReader.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/ExtensionReader.java -index a58a93c..c8dbc3c 100644 ---- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/ExtensionReader.java -+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/ExtensionReader.java -@@ -11,11 +11,9 @@ - - package org.eclipse.m2e.core.internal; - --import java.net.URL; - import java.util.ArrayList; - import java.util.List; - --import org.osgi.framework.Bundle; - import org.slf4j.Logger; - import org.slf4j.LoggerFactory; - -@@ -82,29 +80,8 @@ public class ExtensionReader { - - private static ArchetypeCatalogFactory readArchetypeCatalogs(IConfigurationElement element, - IContributor contributor) { -- if(ELEMENT_LOCAL_ARCHETYPE.equals(element.getName())) { -- String name = element.getAttribute(ATTR_NAME); -- if(name != null) { -- Bundle[] bundles = Platform.getBundles(contributor.getName(), null); -- URL catalogUrl = null; -- for(int i = 0; i < bundles.length; i++ ) { -- Bundle bundle = bundles[i]; -- catalogUrl = bundle.getEntry(name); -- if(catalogUrl != null) { -- String description = element.getAttribute(ATTR_DESCRIPTION); -- String url = catalogUrl.toString(); -- return new ArchetypeCatalogFactory.LocalCatalogFactory(url, description, false); -- } -- } -- log.error("Unable to find Archetype catalog " + name + " in " + contributor.getName()); -- } -- } else if(ELEMENT_REMOTE_ARCHETYPE.equals(element.getName())) { -- String url = element.getAttribute(ATTR_URL); -- if(url != null) { -- String description = element.getAttribute(ATTR_DESCRIPTION); -- return new ArchetypeCatalogFactory.RemoteCatalogFactory(url, description, false); -- } -- } -+ log.error("Local and remote Archetype catalogs specified by URL from " + contributor.getName() -+ + " are no longer supported"); - return null; - } - -diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/Messages.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/Messages.java -index 0bc0256..c96bcb1 100644 ---- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/Messages.java -+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/Messages.java -@@ -48,8 +48,6 @@ public class Messages extends NLS { - - public static String ArchetypeCatalogFactory_internal; - -- public static String ArchetypeCatalogFactory_local; -- - public static String ArchetypeCatalogFactory_remote; - - public static String ArchetypeCatalogsWriter_error_parse; -diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/archetype/ArchetypeCatalogFactory.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/archetype/ArchetypeCatalogFactory.java -index b1c7d78..f422344 100644 ---- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/archetype/ArchetypeCatalogFactory.java -+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/archetype/ArchetypeCatalogFactory.java -@@ -11,13 +11,6 @@ - - package org.eclipse.m2e.core.internal.archetype; - --import java.io.BufferedInputStream; --import java.io.InputStream; --import java.net.URL; --import java.util.ArrayList; --import java.util.List; --import java.util.Properties; -- - import org.slf4j.Logger; - import org.slf4j.LoggerFactory; - -@@ -28,10 +21,13 @@ import org.eclipse.osgi.util.NLS; - - import org.apache.maven.archetype.ArchetypeManager; - import org.apache.maven.archetype.catalog.ArchetypeCatalog; --import org.apache.maven.archetype.catalog.io.xpp3.ArchetypeCatalogXpp3Reader; - import org.apache.maven.archetype.source.ArchetypeDataSource; - import org.apache.maven.archetype.source.ArchetypeDataSourceException; -+import org.apache.maven.project.ProjectBuildingRequest; - -+import org.eclipse.m2e.core.MavenPlugin; -+import org.eclipse.m2e.core.embedder.IMaven; -+import org.eclipse.m2e.core.embedder.IMavenExecutionContext; - import org.eclipse.m2e.core.internal.IMavenConstants; - import org.eclipse.m2e.core.internal.MavenPluginActivator; - import org.eclipse.m2e.core.internal.Messages; -@@ -104,8 +100,12 @@ public abstract class ArchetypeCatalogFactory { - - public ArchetypeCatalog getArchetypeCatalog() throws CoreException { - try { -+ final IMaven maven = MavenPlugin.getMaven(); -+ IMavenExecutionContext context = maven.createExecutionContext(); -+ ProjectBuildingRequest buildingReq = context.newProjectBuildingRequest(); -+ - ArchetypeDataSource source = MavenPluginActivator.getDefault().getIndexManager().getArchetypeCatalog(); -- return source.getArchetypeCatalog(new Properties()); -+ return source.getArchetypeCatalog(buildingReq); - } catch(ArchetypeDataSourceException ex) { - String msg = NLS.bind(Messages.ArchetypeCatalogFactory_error_missing_catalog, ex.getMessage()); - log.error(msg, ex); -@@ -140,159 +140,11 @@ public abstract class ArchetypeCatalogFactory { - super(ID, Messages.ArchetypeCatalogFactory_default_local, false); - } - -- public ArchetypeCatalog getArchetypeCatalog() { -- return getArchetyper().getDefaultLocalCatalog(); -- } -- } -- -- /** -- * Factory for local ArchetypeCatalog -- */ -- public static class LocalCatalogFactory extends ArchetypeCatalogFactory { -- -- public LocalCatalogFactory(String path, String description, boolean editable) { -- this(path, description, editable, true); -- } -- -- public LocalCatalogFactory(String path, String description, boolean editable, boolean enabled) { -- super(path, description == null || description.trim().length() == 0 -- ? NLS.bind(Messages.ArchetypeCatalogFactory_local, path) -- : description, editable, enabled); -- } -- - public ArchetypeCatalog getArchetypeCatalog() throws CoreException { -- ArchetypeCatalog catalog = getEmbeddedCatalog(); -- if(catalog == null) { -- //local but not embedded catalog -- catalog = getArchetyper().getLocalCatalog(getId()); -- } -- return catalog; -- } -- -- private ArchetypeCatalog getEmbeddedCatalog() throws CoreException { -- URL url = getEmbeddedUrl(); -- if(url == null) { -- //Not an embedded catalog, nothing else to do -- return null; -- } -- try (InputStream is = new BufferedInputStream(url.openStream())) { -- return new ArchetypeCatalogXpp3Reader().read(is); -- } catch(Exception ex) { -- String msg = NLS.bind(Messages.ArchetypeCatalogFactory_error_missing_catalog, ex.getMessage()); -- log.error(msg, ex); -- throw new CoreException(new Status(IStatus.ERROR, IMavenConstants.PLUGIN_ID, -1, msg, ex)); -- } -- } -- -- private URL getEmbeddedUrl() { -- String path = getId(); -- if(path != null && path.startsWith("bundleentry://")) { -- try { -- return new URL(path); -- } catch(Exception ex) { -- log.error(ex.getMessage(), ex); -- } -- } -- return null; -- } -- } -- -- /** -- * Factory for remote ArchetypeCatalog -- */ -- public static class RemoteCatalogFactory extends ArchetypeCatalogFactory { -- -- private String repositoryUrl = null; -- -- public RemoteCatalogFactory(String url, String description, boolean editable) { -- this(url, description, editable, true); -- } -- -- public RemoteCatalogFactory(String url, String description, boolean editable, boolean enabled) { -- super(url, description == null || description.trim().length() == 0 -- ? NLS.bind(Messages.ArchetypeCatalogFactory_remote, url) -- : description, editable, enabled); -- repositoryUrl = parseCatalogUrl(url); -- } -- -- /** -- * @param url -- * @return -- */ -- private String parseCatalogUrl(String url) { -- if(url == null) { -- return null; -- } -- int length = url.length(); -- if(length > 1 && url.endsWith("/")) //$NON-NLS-1$ -- { -- return url.substring(0, url.length() - 1); -- } -- int idx = url.lastIndexOf("/"); //$NON-NLS-1$ -- idx = (idx > 0) ? idx : 0; -- if(url.lastIndexOf(".") >= idx) { //$NON-NLS-1$ -- //Assume last fragment of the url is a file, let's keep its parent folder -- return url.substring(0, idx); -- } -- return url; -- } -- -- public ArchetypeCatalog getArchetypeCatalog() { -- String url = getId(); -- int idx = url.lastIndexOf("/archetype-catalog.xml"); -- if(idx > -1) { -- url = url.substring(0, idx); -- } -- final ArchetypeCatalog catalog = getArchetyper().getRemoteCatalog(url); -- final String remoteUrl = url; -- @SuppressWarnings("serial") -- ArchetypeCatalog catalogWrapper = new ArchetypeCatalog() { -- public void addArchetype(org.apache.maven.archetype.catalog.Archetype archetype) { -- catalog.addArchetype(archetype); -- } -- -- @SuppressWarnings({"rawtypes", "unchecked"}) -- public List getArchetypes() { -- List archetypes = new ArrayList( -- catalog.getArchetypes()); -- for(org.apache.maven.archetype.catalog.Archetype arch : archetypes) { -- if(arch.getRepository() == null || arch.getRepository().trim().isEmpty()) { -- arch.setRepository(remoteUrl); -- } -- } -- return archetypes; -- } -- -- public String getModelEncoding() { -- return catalog.getModelEncoding(); -- } -- -- public void removeArchetype(org.apache.maven.archetype.catalog.Archetype archetype) { -- catalog.removeArchetype(archetype); -- } -- -- public void setModelEncoding(String modelEncoding) { -- catalog.setModelEncoding(modelEncoding); -- } -- -- public void setArchetypes(List archetypes) { -- catalog.setArchetypes(archetypes); -- } -- -- public String toString() { -- return catalog.toString(); -- } -- }; -- -- return catalogWrapper; -- } -- -- /** -- * @return the url of the remote repository hosting the catalog -- */ -- public String getRepositoryUrl() { -- return repositoryUrl; -+ final IMaven maven = MavenPlugin.getMaven(); -+ IMavenExecutionContext context = maven.createExecutionContext(); -+ ProjectBuildingRequest buildingReq = context.newProjectBuildingRequest(); -+ return getArchetyper().getLocalCatalog(buildingReq); - } - } -- - } -diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/archetype/ArchetypeCatalogsWriter.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/archetype/ArchetypeCatalogsWriter.java -index 4d5a95c..45c3f6b 100644 ---- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/archetype/ArchetypeCatalogsWriter.java -+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/archetype/ArchetypeCatalogsWriter.java -@@ -43,8 +43,6 @@ import org.xml.sax.helpers.XMLFilterImpl; - import org.eclipse.osgi.util.NLS; - - import org.eclipse.m2e.core.internal.Messages; --import org.eclipse.m2e.core.internal.archetype.ArchetypeCatalogFactory.LocalCatalogFactory; --import org.eclipse.m2e.core.internal.archetype.ArchetypeCatalogFactory.RemoteCatalogFactory; - - - /** -@@ -61,14 +59,8 @@ public class ArchetypeCatalogsWriter { - - private static final String ATT_CATALOG_TYPE = "type"; //$NON-NLS-1$ - -- private static final String ATT_CATALOG_LOCATION = "location"; //$NON-NLS-1$ -- - public static final String ATT_CATALOG_DESCRIPTION = "description"; //$NON-NLS-1$ - -- private static final String TYPE_LOCAL = "local"; //$NON-NLS-1$ -- -- private static final String TYPE_REMOTE = "remote"; //$NON-NLS-1$ -- - private static final String TYPE_SYSTEM = "system"; //$NON-NLS-1$ - - public static final String ATT_CATALOG_ID = "id"; -@@ -125,20 +117,8 @@ public class ArchetypeCatalogsWriter { - - for(ArchetypeCatalogFactory factory : this.catalogs) { - AttributesImpl attrs = new AttributesImpl(); -- if(factory.isEditable()) { -- if(factory instanceof LocalCatalogFactory) { -- attrs.addAttribute(null, ATT_CATALOG_TYPE, ATT_CATALOG_TYPE, null, TYPE_LOCAL); -- attrs.addAttribute(null, ATT_CATALOG_LOCATION, ATT_CATALOG_LOCATION, null, factory.getId()); -- attrs.addAttribute(null, ATT_CATALOG_DESCRIPTION, ATT_CATALOG_DESCRIPTION, null, factory.getDescription()); -- } else if(factory instanceof RemoteCatalogFactory) { -- attrs.addAttribute(null, ATT_CATALOG_TYPE, ATT_CATALOG_TYPE, null, TYPE_REMOTE); -- attrs.addAttribute(null, ATT_CATALOG_LOCATION, ATT_CATALOG_LOCATION, null, factory.getId()); -- attrs.addAttribute(null, ATT_CATALOG_DESCRIPTION, ATT_CATALOG_DESCRIPTION, null, factory.getDescription()); -- } -- } else { -- attrs.addAttribute(null, ATT_CATALOG_TYPE, ATT_CATALOG_TYPE, null, TYPE_SYSTEM); -- attrs.addAttribute(null, ATT_CATALOG_ID, ATT_CATALOG_ID, null, factory.getId()); -- } -+ attrs.addAttribute(null, ATT_CATALOG_TYPE, ATT_CATALOG_TYPE, null, TYPE_SYSTEM); -+ attrs.addAttribute(null, ATT_CATALOG_ID, ATT_CATALOG_ID, null, factory.getId()); - attrs.addAttribute(null, ATT_CATALOG_ENABLED, ATT_CATALOG_ENABLED, null, Boolean.toString(factory.isEnabled())); - handler.startElement(null, ELEMENT_CATALOG, ELEMENT_CATALOG, attrs); - handler.endElement(null, ELEMENT_CATALOG, ELEMENT_CATALOG); -@@ -163,28 +143,13 @@ public class ArchetypeCatalogsWriter { - - public void startElement(String uri, String localName, String qName, Attributes attributes) { - if(ELEMENT_CATALOG.equals(qName) && attributes != null) { -- String type = attributes.getValue(ATT_CATALOG_TYPE); - String enabledStr = attributes.getValue(ATT_CATALOG_ENABLED); - boolean enabled = enabledStr==null||Boolean.parseBoolean(enabledStr); -- if(TYPE_LOCAL.equals(type)) { -- String path = attributes.getValue(ATT_CATALOG_LOCATION); -- if(path != null) { -- String description = attributes.getValue(ATT_CATALOG_DESCRIPTION); -- catalogs.add(new LocalCatalogFactory(path, description, true, enabled)); -- } -- } else if(TYPE_REMOTE.equals(type)) { -- String url = attributes.getValue(ATT_CATALOG_LOCATION); -- if(url != null) { -- String description = attributes.getValue(ATT_CATALOG_DESCRIPTION); -- catalogs.add(new RemoteCatalogFactory(url, description, true, enabled)); -- } -- } else { -- String id = attributes.getValue(ATT_CATALOG_ID); -- if(id != null && !id.isEmpty()) { -- ArchetypeCatalogFactory catalog = existingCatalogs.get(id); -- if(catalog != null) { -- catalog.setEnabled(enabled); -- } -+ String id = attributes.getValue(ATT_CATALOG_ID); -+ if(id != null && !id.isEmpty()) { -+ ArchetypeCatalogFactory catalog = existingCatalogs.get(id); -+ if(catalog != null) { -+ catalog.setEnabled(enabled); - } - } - } -diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/archetype/ArchetypeManager.java b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/archetype/ArchetypeManager.java -index b77e90e..c7a084d 100644 ---- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/archetype/ArchetypeManager.java -+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/archetype/ArchetypeManager.java -@@ -181,11 +181,12 @@ public class ArchetypeManager { - return maven.execute(new ICallable>() { - public List call(IMavenExecutionContext context, IProgressMonitor monitor) { - ArtifactRepository localRepository = context.getLocalRepository(); -- if(aaMgr.isFileSetArchetype(groupId, artifactId, version, null, localRepository, repositories)) { -+ if(aaMgr.isFileSetArchetype(groupId, artifactId, version, null, localRepository, repositories, -+ context.newProjectBuildingRequest())) { - ArchetypeDescriptor descriptor; - try { - descriptor = aaMgr.getFileSetArchetypeDescriptor(groupId, artifactId, version, null, localRepository, -- repositories); -+ repositories, context.newProjectBuildingRequest()); - } catch(UnknownArchetype ex) { - throw new WrappedUnknownArchetype(ex); - } -diff --git a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/messages.properties b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/messages.properties -index d091a3a..105b4b1 100644 ---- a/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/messages.properties -+++ b/org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/messages.properties -@@ -14,7 +14,6 @@ ArchetypeCatalogFactory_default_local=Default Local - ArchetypeCatalogFactory_error_missing_catalog=Error looking up archetype catalog; {0} - ArchetypeCatalogFactory_indexer_catalog=Nexus Indexer - ArchetypeCatalogFactory_internal=Internal --ArchetypeCatalogFactory_local=Local {0} - ArchetypeCatalogFactory_remote=Remote {0} - ArchetypeCatalogsWriter_error_parse=Unable to parse Archetype catalogs list; {0} - ArchetypeCatalogsWriter_error_write=Unable to write Archetype catalogs; {0} --- -2.20.1 - diff --git a/eclipse-m2e-core.spec b/eclipse-m2e-core.spec index dc49867..ebd3337 100644 --- a/eclipse-m2e-core.spec +++ b/eclipse-m2e-core.spec @@ -1,17 +1,16 @@ -%global release_dir m2e-core-c5392da6bab9893bcbf5b43f651abe48d5819bea +%global release_dir m2e-core-acf8703b40fd6aebecd9a00ef2c57536cdb55ac5 Name: eclipse-m2e-core -Version: 1.11.0 -Release: 8%{?dist} +Version: 1.14.0 +Release: 1%{?dist} Summary: Maven integration for Eclipse # Most of components are under EPL, but some of them are licensed under # ASL 2.0 license. -License: EPL-1.0 and ASL 2.0 +License: EPL-2.0 and ASL 2.0 URL: https://eclipse.org/m2e/ Source0: https://git.eclipse.org/c/m2e/m2e-core.git/snapshot/%{release_dir}.tar.xz -Source1: http://www.eclipse.org/legal/epl-v10.html # Allow building against the Fedora shipped guava version Patch0: 0001-Fix-manifests-for-guava-and-use-OSGi-fied-archetypes.patch @@ -22,17 +21,12 @@ Patch1: 0002-Port-to-latest-versions-of-maven-indexer-and-lucene.patch # API change in aether (remove once implemented) Patch2: 0003-Adapt-to-API-change-in-aether.patch -# Port tests to latest Jetty -Patch3: 0004-Port-tests-to-latest-versionof-jetty.patch - # Remove "mandatory" attirbutes from OSGi manifests, which cause problems with P2. # See https://dev.eclipse.org/mhonarc/lists/p2-dev/msg05465.html -Patch4: 0005-Remove-mandatory-attirbutes-from-OSGi-manifests-whic.patch - -# See: https://bugs.eclipse.org/bugs/show_bug.cgi?id=547760 -Patch5: 0006-Bug-547760-Errors-in-the-log-Failed-to-evaluate-Refe.patch +Patch3: 0005-Remove-mandatory-attirbutes-from-OSGi-manifests-whic.patch -Patch6: 0007-Port-to-latest-version-of-maven-archetypes.patch +# Use latest version of maven-archetypes +Patch4: 0006-Port-to-latest-version-of-maven-archetypes.patch BuildArch: noarch @@ -238,13 +232,6 @@ additional Maven plugins (e.g. Android, web development, etc.), and facilitates the distribution of those extensions through the m2e marketplace. -%package tests -Summary: Eclipse M2E testing helpers - -%description tests -This package contains common code used by tests for Eclipse M2E. - - %package javadoc Summary: API documentation for %{name} @@ -259,14 +246,16 @@ This package contains %{summary}. %patch2 -p1 %patch3 -p1 %patch4 -p1 -%patch5 -p1 -%patch6 -p1 +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 + +# Remove unnecessary parent pom +%pom_remove_parent m2e-maven-runtime find -name '*.class' -delete find -name '*.jar' -delete # Copy license files so they can be installed more easily. -cp -p %{SOURCE1} . cp -p org.eclipse.m2e.core/about_files/LICENSE-2.0.txt . # These don't currently build, but don't seem to be absolutely necessary @@ -280,8 +269,12 @@ do rm -rf $mod done -# Test bundle goes to its own subpackage. -%mvn_package ":*.tests*::{}:" tests +# Don't ship tests +%pom_disable_module org.eclipse.m2e.tests.common +%pom_disable_module org.eclipse.m2e.core.tests +%pom_disable_module org.eclipse.m2e.importer.tests +%pom_disable_module org.eclipse.m2e.binaryproject.tests +%mvn_package ":*.tests*::{}:" __noinstall %mvn_package ":::{}:" # Ensure all necessary resolver deps are present @@ -307,12 +300,6 @@ done # Not needed for RPM builds %pom_remove_plugin ":jacoco-maven-plugin" -# Fix BSN of annotations -sed -i -e 's/>javax.annotationjavax.annotation-api20.0' \ m2e-maven-runtime/org.eclipse.m2e.maven.runtime/pom.xml @@ -321,6 +308,10 @@ sed -i -e '/com.google.guava/a20.0' \ sed -i -e '/org.slf4j/s|^\(.*\)|\1,org.apache.lucene.analysis,org.apache.lucene.analysis.standard,org.apache.lucene.analysis.util,org.apache.lucene.document,org.apache.lucene.index,org.apache.lucene.queryparser.classic,org.apache.lucene.search,org.apache.lucene.search.highlight,org.apache.lucene.store,org.apache.lucene.util|' \ org.eclipse.m2e.core/META-INF/MANIFEST.MF org.eclipse.m2e.core.ui/META-INF/MANIFEST.MF +# Maven 3.6.2 API +sed -i -e 's/DefaultProjectBuilder\.DISABLE_GLOBAL_MODEL_CACHE_SYSTEM_PROPERTY/"maven.defaultProjectBuilder.disableGlobalModelCache"/' \ + org.eclipse.m2e.core/src/org/eclipse/m2e/core/internal/MavenPluginActivator.java + %build # Building m2e is a two step process. See upstream documentation: # http://wiki.eclipse.org/M2E_Development_Environment#Building_m2e_on_command_line @@ -358,14 +349,16 @@ done xmvn-subst -s $(find %{buildroot}%{_datadir}/eclipse/droplets/m2e-core -name jars) %files -f .mfiles -%license epl-v10.html LICENSE-2.0.txt - -%files tests -f .mfiles-tests +%license LICENSE-2.0.txt %files javadoc -f .mfiles-javadoc -%license epl-v10.html LICENSE-2.0.txt +%license LICENSE-2.0.txt %changelog +* Fri Dec 20 2019 Mat Booth - 1.14.0-1 +- Update to latest upstream release +- Don't build and ship tests + * Thu Aug 01 2019 Mat Booth - 1.11.0-8 - Rebuild against new maven-archetype and regenerate runtime requires diff --git a/epl-v10.html b/epl-v10.html deleted file mode 100644 index 3998fce..0000000 --- a/epl-v10.html +++ /dev/null @@ -1,261 +0,0 @@ - - - - - - -Eclipse Public License - Version 1.0 - - - - - - -

Eclipse Public License - v 1.0

- -

THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE -PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR -DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS -AGREEMENT.

- -

1. DEFINITIONS

- -

"Contribution" means:

- -

a) in the case of the initial Contributor, the initial -code and documentation distributed under this Agreement, and

-

b) in the case of each subsequent Contributor:

-

i) changes to the Program, and

-

ii) additions to the Program;

-

where such changes and/or additions to the Program -originate from and are distributed by that particular Contributor. A -Contribution 'originates' from a Contributor if it was added to the -Program by such Contributor itself or anyone acting on such -Contributor's behalf. Contributions do not include additions to the -Program which: (i) are separate modules of software distributed in -conjunction with the Program under their own license agreement, and (ii) -are not derivative works of the Program.

- -

"Contributor" means any person or entity that distributes -the Program.

- -

"Licensed Patents" mean patent claims licensable by a -Contributor which are necessarily infringed by the use or sale of its -Contribution alone or when combined with the Program.

- -

"Program" means the Contributions distributed in accordance -with this Agreement.

- -

"Recipient" means anyone who receives the Program under -this Agreement, including all Contributors.

- -

2. GRANT OF RIGHTS

- -

a) Subject to the terms of this Agreement, each -Contributor hereby grants Recipient a non-exclusive, worldwide, -royalty-free copyright license to reproduce, prepare derivative works -of, publicly display, publicly perform, distribute and sublicense the -Contribution of such Contributor, if any, and such derivative works, in -source code and object code form.

- -

b) Subject to the terms of this Agreement, each -Contributor hereby grants Recipient a non-exclusive, worldwide, -royalty-free patent license under Licensed Patents to make, use, sell, -offer to sell, import and otherwise transfer the Contribution of such -Contributor, if any, in source code and object code form. This patent -license shall apply to the combination of the Contribution and the -Program if, at the time the Contribution is added by the Contributor, -such addition of the Contribution causes such combination to be covered -by the Licensed Patents. The patent license shall not apply to any other -combinations which include the Contribution. No hardware per se is -licensed hereunder.

- -

c) Recipient understands that although each Contributor -grants the licenses to its Contributions set forth herein, no assurances -are provided by any Contributor that the Program does not infringe the -patent or other intellectual property rights of any other entity. Each -Contributor disclaims any liability to Recipient for claims brought by -any other entity based on infringement of intellectual property rights -or otherwise. As a condition to exercising the rights and licenses -granted hereunder, each Recipient hereby assumes sole responsibility to -secure any other intellectual property rights needed, if any. For -example, if a third party patent license is required to allow Recipient -to distribute the Program, it is Recipient's responsibility to acquire -that license before distributing the Program.

- -

d) Each Contributor represents that to its knowledge it -has sufficient copyright rights in its Contribution, if any, to grant -the copyright license set forth in this Agreement.

- -

3. REQUIREMENTS

- -

A Contributor may choose to distribute the Program in object code -form under its own license agreement, provided that:

- -

a) it complies with the terms and conditions of this -Agreement; and

- -

b) its license agreement:

- -

i) effectively disclaims on behalf of all Contributors -all warranties and conditions, express and implied, including warranties -or conditions of title and non-infringement, and implied warranties or -conditions of merchantability and fitness for a particular purpose;

- -

ii) effectively excludes on behalf of all Contributors -all liability for damages, including direct, indirect, special, -incidental and consequential damages, such as lost profits;

- -

iii) states that any provisions which differ from this -Agreement are offered by that Contributor alone and not by any other -party; and

- -

iv) states that source code for the Program is available -from such Contributor, and informs licensees how to obtain it in a -reasonable manner on or through a medium customarily used for software -exchange.

- -

When the Program is made available in source code form:

- -

a) it must be made available under this Agreement; and

- -

b) a copy of this Agreement must be included with each -copy of the Program.

- -

Contributors may not remove or alter any copyright notices contained -within the Program.

- -

Each Contributor must identify itself as the originator of its -Contribution, if any, in a manner that reasonably allows subsequent -Recipients to identify the originator of the Contribution.

- -

4. COMMERCIAL DISTRIBUTION

- -

Commercial distributors of software may accept certain -responsibilities with respect to end users, business partners and the -like. While this license is intended to facilitate the commercial use of -the Program, the Contributor who includes the Program in a commercial -product offering should do so in a manner which does not create -potential liability for other Contributors. Therefore, if a Contributor -includes the Program in a commercial product offering, such Contributor -("Commercial Contributor") hereby agrees to defend and -indemnify every other Contributor ("Indemnified Contributor") -against any losses, damages and costs (collectively "Losses") -arising from claims, lawsuits and other legal actions brought by a third -party against the Indemnified Contributor to the extent caused by the -acts or omissions of such Commercial Contributor in connection with its -distribution of the Program in a commercial product offering. The -obligations in this section do not apply to any claims or Losses -relating to any actual or alleged intellectual property infringement. In -order to qualify, an Indemnified Contributor must: a) promptly notify -the Commercial Contributor in writing of such claim, and b) allow the -Commercial Contributor to control, and cooperate with the Commercial -Contributor in, the defense and any related settlement negotiations. The -Indemnified Contributor may participate in any such claim at its own -expense.

- -

For example, a Contributor might include the Program in a commercial -product offering, Product X. That Contributor is then a Commercial -Contributor. If that Commercial Contributor then makes performance -claims, or offers warranties related to Product X, those performance -claims and warranties are such Commercial Contributor's responsibility -alone. Under this section, the Commercial Contributor would have to -defend claims against the other Contributors related to those -performance claims and warranties, and if a court requires any other -Contributor to pay any damages as a result, the Commercial Contributor -must pay those damages.

- -

5. NO WARRANTY

- -

EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS -PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS -OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, -ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY -OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely -responsible for determining the appropriateness of using and -distributing the Program and assumes all risks associated with its -exercise of rights under this Agreement , including but not limited to -the risks and costs of program errors, compliance with applicable laws, -damage to or loss of data, programs or equipment, and unavailability or -interruption of operations.

- -

6. DISCLAIMER OF LIABILITY

- -

EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT -NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING -WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR -DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED -HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

- -

7. GENERAL

- -

If any provision of this Agreement is invalid or unenforceable under -applicable law, it shall not affect the validity or enforceability of -the remainder of the terms of this Agreement, and without further action -by the parties hereto, such provision shall be reformed to the minimum -extent necessary to make such provision valid and enforceable.

- -

If Recipient institutes patent litigation against any entity -(including a cross-claim or counterclaim in a lawsuit) alleging that the -Program itself (excluding combinations of the Program with other -software or hardware) infringes such Recipient's patent(s), then such -Recipient's rights granted under Section 2(b) shall terminate as of the -date such litigation is filed.

- -

All Recipient's rights under this Agreement shall terminate if it -fails to comply with any of the material terms or conditions of this -Agreement and does not cure such failure in a reasonable period of time -after becoming aware of such noncompliance. If all Recipient's rights -under this Agreement terminate, Recipient agrees to cease use and -distribution of the Program as soon as reasonably practicable. However, -Recipient's obligations under this Agreement and any licenses granted by -Recipient relating to the Program shall continue and survive.

- -

Everyone is permitted to copy and distribute copies of this -Agreement, but in order to avoid inconsistency the Agreement is -copyrighted and may only be modified in the following manner. The -Agreement Steward reserves the right to publish new versions (including -revisions) of this Agreement from time to time. No one other than the -Agreement Steward has the right to modify this Agreement. The Eclipse -Foundation is the initial Agreement Steward. The Eclipse Foundation may -assign the responsibility to serve as the Agreement Steward to a -suitable separate entity. Each new version of the Agreement will be -given a distinguishing version number. The Program (including -Contributions) may always be distributed subject to the version of the -Agreement under which it was received. In addition, after a new version -of the Agreement is published, Contributor may elect to distribute the -Program (including its Contributions) under the new version. Except as -expressly stated in Sections 2(a) and 2(b) above, Recipient receives no -rights or licenses to the intellectual property of any Contributor under -this Agreement, whether expressly, by implication, estoppel or -otherwise. All rights in the Program not expressly granted under this -Agreement are reserved.

- -

This Agreement is governed by the laws of the State of New York and -the intellectual property laws of the United States of America. No party -to this Agreement will bring a legal action under this Agreement more -than one year after the cause of action arose. Each party waives its -rights to a jury trial in any resulting litigation.

- - - - \ No newline at end of file diff --git a/sources b/sources index 34c44da..128ef59 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (m2e-core-c5392da6bab9893bcbf5b43f651abe48d5819bea.tar.xz) = f518d1fe323b3c64e26ca15c71ad31c2a074e1c0e4ee2bc886a915a50a7eb9c9dc1b4064d94b28db05850b1da2b80715bb7a05da0adf3f21d8984f24b581b97b +SHA512 (m2e-core-acf8703b40fd6aebecd9a00ef2c57536cdb55ac5.tar.xz) = 539729e29c0c9d5b77cd7d878ba57420ce6e0bcdcf9d4c7b27d2db0835d138f30870eb465487894d31e6fa9afba6e8aa881b324211cfc0ed7229706a4e72b2d7