From 2474b6a8d17021395c8ffd02ccec8a11e1ca5e66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20L=C3=A4ubrich?= Date: Tue, 11 Jun 2024 05:51:19 +0200 Subject: [PATCH] Update to 2024-06 release --- p2-maven-plugin/pom.xml | 26 +++++++++---------- pom.xml | 2 +- tycho-api/pom.xml | 2 +- tycho-apitools-plugin/pom.xml | 2 +- tycho-build/pom.xml | 6 ++--- tycho-core/pom.xml | 2 +- .../MavenTargetDefinitionContent.java | 4 +-- .../target/FileArtifactRepository.java | 8 +++--- .../tycho/p2/resolver/BundlePublisher.java | 8 +++--- .../tycho/p2/resolver/FeaturePublisher.java | 5 ++-- .../resolver/FileTargetDefinitionContent.java | 20 +++++++------- .../PomDependencyCollectorImpl.java | 9 ++++--- .../p2resolver/RepositoryLocationContent.java | 6 ++--- .../p2resolver/TargetPlatformFactoryImpl.java | 2 +- tycho-eclipse-plugin/pom.xml | 2 +- .../tycho-document-bundle-plugin/pom.xml | 2 +- .../pom.xml | 2 +- 17 files changed, 58 insertions(+), 50 deletions(-) diff --git a/p2-maven-plugin/pom.xml b/p2-maven-plugin/pom.xml index 2187f7f8ac..952ab69d67 100644 --- a/p2-maven-plugin/pom.xml +++ b/p2-maven-plugin/pom.xml @@ -37,7 +37,7 @@ org.eclipse.platform org.eclipse.equinox.p2.publisher - 1.9.100 + 1.9.200 org.eclipse.platform @@ -47,7 +47,7 @@ org.eclipse.platform org.eclipse.equinox.p2.engine - 2.10.0 + 2.10.200 org.eclipse.platform @@ -70,12 +70,12 @@ org.eclipse.platform org.eclipse.equinox.frameworkadmin - 2.3.100 + 2.3.200 org.eclipse.platform org.eclipse.equinox.preferences - 3.11.0 + 3.11.100 org.apache.maven @@ -96,7 +96,7 @@ org.eclipse.platform org.eclipse.equinox.p2.metadata.repository - 1.5.300 + 1.5.400 org.eclipse.platform @@ -123,27 +123,27 @@ org.eclipse.platform org.eclipse.equinox.p2.jarprocessor - 1.3.300 + 1.3.400 org.eclipse.platform org.eclipse.equinox.p2.touchpoint.natives - 1.5.200 + 1.5.300 org.eclipse.platform org.eclipse.equinox.p2.touchpoint.eclipse - 2.4.200 + 2.4.300 org.eclipse.platform org.eclipse.equinox.p2.garbagecollector - 1.3.200 + 1.3.300 org.eclipse.platform org.eclipse.equinox.p2.director.app - 1.3.300 + 1.3.400 org.eclipse.platform @@ -154,12 +154,12 @@ org.eclipse.platform org.eclipse.equinox.concurrent - 1.3.0 + 1.3.100 org.eclipse.platform org.eclipse.equinox.simpleconfigurator - 1.5.200 + 1.5.300 org.eclipse.platform @@ -169,7 +169,7 @@ org.eclipse.platform org.eclipse.equinox.frameworkadmin.equinox - 1.3.100 + 1.3.200 org.eclipse.platform diff --git a/pom.xml b/pom.xml index e040024d98..4f95f95b3f 100644 --- a/pom.xml +++ b/pom.xml @@ -302,7 +302,7 @@ org.eclipse.platform org.eclipse.equinox.p2.publisher.eclipse - 1.6.0 + 1.6.100 org.eclipse.platform diff --git a/tycho-api/pom.xml b/tycho-api/pom.xml index e19514f122..f8293eb956 100644 --- a/tycho-api/pom.xml +++ b/tycho-api/pom.xml @@ -33,7 +33,7 @@ org.eclipse.platform org.eclipse.equinox.p2.publisher - 1.9.100 + 1.9.200 diff --git a/tycho-apitools-plugin/pom.xml b/tycho-apitools-plugin/pom.xml index 48abd8f00e..d6b4e2613c 100644 --- a/tycho-apitools-plugin/pom.xml +++ b/tycho-apitools-plugin/pom.xml @@ -50,7 +50,7 @@ org.eclipse.pde org.eclipse.pde.core - 3.18.0 + 3.18.100 jar diff --git a/tycho-build/pom.xml b/tycho-build/pom.xml index 8ce67e670d..9f2a138dae 100644 --- a/tycho-build/pom.xml +++ b/tycho-build/pom.xml @@ -59,7 +59,7 @@ org.eclipse.platform org.eclipse.equinox.p2.publisher - 1.9.100 + 1.9.200 @@ -71,7 +71,7 @@ org.eclipse.platform org.eclipse.equinox.p2.engine - 2.10.0 + 2.10.200 @@ -123,7 +123,7 @@ org.eclipse.platform org.eclipse.equinox.p2.metadata.repository - 1.5.300 + 1.5.400 org.eclipse.tycho diff --git a/tycho-core/pom.xml b/tycho-core/pom.xml index c31cb09264..0c69461f87 100644 --- a/tycho-core/pom.xml +++ b/tycho-core/pom.xml @@ -319,7 +319,7 @@ org.eclipse.pde org.eclipse.pde.core - 3.18.0 + 3.18.100 test diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/MavenTargetDefinitionContent.java b/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/MavenTargetDefinitionContent.java index 8e2d18ce07..c0737c86ec 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/MavenTargetDefinitionContent.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/MavenTargetDefinitionContent.java @@ -350,7 +350,7 @@ public MavenTargetDefinitionContent(MavenGAVLocation location, MavenDependencies throw new TargetDefinitionResolutionException("feature generation failed!", e); } } - FeaturePublisher.publishFeatures(features, repositoryContent::put, logger); + FeaturePublisher.publishFeatures(features, repositoryContent::put, artifactRepository, logger); } } @@ -396,7 +396,7 @@ private IInstallableUnit publish(BundleDescription bundleDescription, File bundl private IInstallableUnit publish(BundleDescription bundleDescription, File bundleLocation, IPropertyAdvice advice) { IArtifactKey key = BundlesAction.createBundleArtifactKey(bundleDescription.getSymbolicName(), bundleDescription.getVersion().toString()); - IArtifactDescriptor descriptor = FileArtifactRepository.forFile(bundleLocation, key); + IArtifactDescriptor descriptor = FileArtifactRepository.forFile(bundleLocation, key, artifactRepository); PublisherInfo publisherInfo = new PublisherInfo(); publisherInfo.addAdvice(advice); publisherInfo.addAdvice(new MavenChecksumAdvice(bundleLocation)); diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/target/FileArtifactRepository.java b/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/target/FileArtifactRepository.java index 5197d7cc6f..735ed33390 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/target/FileArtifactRepository.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/resolver/target/FileArtifactRepository.java @@ -39,6 +39,7 @@ import org.eclipse.equinox.p2.query.IQueryResult; import org.eclipse.equinox.p2.query.IQueryable; import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor; +import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository; import org.eclipse.equinox.p2.repository.artifact.IArtifactRequest; import org.eclipse.equinox.p2.repository.artifact.IFileArtifactRepository; import org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository; @@ -222,17 +223,18 @@ private static boolean matches(IArtifactKey key, IArtifactDescriptor descriptor) && key.getVersion().equals(descriptorKey.getVersion())); } - public static IArtifactDescriptor forFile(File file, IArtifactKey key) { - return new FileArtifactDescriptor(file, key); + public static IArtifactDescriptor forFile(File file, IArtifactKey key, IArtifactRepository repository) { + return new FileArtifactDescriptor(file, key, repository); } private static final class FileArtifactDescriptor extends ArtifactDescriptor { private File file; - private FileArtifactDescriptor(File file, IArtifactKey key) { + private FileArtifactDescriptor(File file, IArtifactKey key, IArtifactRepository repository) { super(key); this.file = file; + setRepository(repository); } } diff --git a/tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/BundlePublisher.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/BundlePublisher.java index 14610aab4a..1e620ccfff 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/BundlePublisher.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/BundlePublisher.java @@ -33,12 +33,12 @@ import org.eclipse.equinox.p2.publisher.Publisher; import org.eclipse.equinox.p2.publisher.PublisherInfo; import org.eclipse.equinox.p2.publisher.actions.IPropertyAdvice; -import org.eclipse.tycho.p2maven.tmp.BundlesAction; import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor; import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository; import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository; import org.eclipse.osgi.service.resolver.BundleDescription; import org.eclipse.tycho.core.resolver.target.FileArtifactRepository; +import org.eclipse.tycho.p2maven.tmp.BundlesAction; import org.osgi.framework.BundleException; public class BundlePublisher extends BundlesAction { @@ -47,8 +47,8 @@ private BundlePublisher(BundleDescription bundleDescription) { super(new BundleDescription[] { bundleDescription }); } - public static Optional getBundleIU(File bundleLocation, IPublisherAdvice... advices) - throws IOException, BundleException { + public static Optional getBundleIU(File bundleLocation, IArtifactRepository repository, + IPublisherAdvice... advices) throws IOException, BundleException { BundleDescription bundleDescription = BundlesAction.createBundleDescription(bundleLocation); if (bundleDescription == null) { //seems it is not a bundle @@ -65,7 +65,7 @@ public static Optional getBundleIU(File bundleLocation, IPubli } IArtifactKey key = BundlesAction.createBundleArtifactKey(symbolicName, bundleDescription.getVersion().toString()); - IArtifactDescriptor descriptor = FileArtifactRepository.forFile(bundleLocation, key); + IArtifactDescriptor descriptor = FileArtifactRepository.forFile(bundleLocation, key, repository); return Optional.ofNullable(publishBundle(bundleDescription, descriptor, publisherInfo)); } diff --git a/tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/FeaturePublisher.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/FeaturePublisher.java index 42b1a92fc6..28bf4445fb 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/FeaturePublisher.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/FeaturePublisher.java @@ -42,7 +42,8 @@ public class FeaturePublisher { public static void publishFeatures(List features, - BiConsumer consumer, MavenLogger logger) { + BiConsumer consumer, IArtifactRepository artifactRepository, + MavenLogger logger) { if (features.isEmpty()) { return; } @@ -85,7 +86,7 @@ protected IInstallableUnit generateFeatureJarIU(Feature feature, IPublisherInfo //The actual published feature... for (IArtifactKey key : artifacts) { IArtifactDescriptor fileDescriptor = FileArtifactRepository - .forFile(new File(publishedFeature.getLocation()), key); + .forFile(new File(publishedFeature.getLocation()), key, artifactRepository); consumer.accept(fileDescriptor, unit); } } diff --git a/tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/FileTargetDefinitionContent.java b/tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/FileTargetDefinitionContent.java index 91421cb09b..9dbcf61c56 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/FileTargetDefinitionContent.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2/resolver/FileTargetDefinitionContent.java @@ -27,7 +27,6 @@ import org.eclipse.equinox.p2.metadata.IInstallableUnit; import org.eclipse.equinox.p2.publisher.IPublisherInfo; import org.eclipse.equinox.p2.publisher.PublisherInfo; -import org.eclipse.tycho.p2maven.tmp.BundlesAction; import org.eclipse.equinox.p2.publisher.eclipse.Feature; import org.eclipse.equinox.p2.query.IQuery; import org.eclipse.equinox.p2.query.IQueryResult; @@ -37,6 +36,7 @@ import org.eclipse.osgi.service.resolver.BundleDescription; import org.eclipse.tycho.core.resolver.target.FileArtifactRepository; import org.eclipse.tycho.core.resolver.target.SupplierMetadataRepository; +import org.eclipse.tycho.p2maven.tmp.BundlesAction; import org.eclipse.tycho.targetplatform.TargetDefinitionContent; import org.eclipse.tycho.targetplatform.TargetDefinitionResolutionException; import org.osgi.framework.BundleException; @@ -85,14 +85,16 @@ public synchronized void preload(IProgressMonitor monitor) { boolean hasPlugins = pluginsPath.isDirectory(); boolean hasFeatures = featurePath.isDirectory(); if (hasPlugins) { - readBundles(pluginsPath, repositoryContent::put, hasFeatures ? subMonitor.split(100) : subMonitor); + readBundles(pluginsPath, repositoryContent::put, hasFeatures ? subMonitor.split(100) : subMonitor, + artifactRepository); } if (hasFeatures) { - readFeatures(featurePath, repositoryContent::put, hasPlugins ? subMonitor.split(100) : subMonitor); + readFeatures(featurePath, repositoryContent::put, artifactRepository, + hasPlugins ? subMonitor.split(100) : subMonitor); } if (!hasFeatures && !hasPlugins) { - readBundles(location, repositoryContent::put, subMonitor.split(100)); - readFeatures(location, repositoryContent::put, subMonitor.split(100)); + readBundles(location, repositoryContent::put, subMonitor.split(100), artifactRepository); + readFeatures(location, repositoryContent::put, artifactRepository, subMonitor.split(100)); } } catch (ResolverException e) { throw new TargetDefinitionResolutionException("resolving location " + location + " failed", e); @@ -112,7 +114,7 @@ private Map getRepositoryContent() { } private static void readFeatures(File path, BiConsumer consumer, - IProgressMonitor monitor) { + IArtifactRepository artifactRepository, IProgressMonitor monitor) { PublisherInfo publisherInfo = new PublisherInfo(); publisherInfo.setArtifactOptions(IPublisherInfo.A_INDEX); if (path.isDirectory()) { @@ -132,7 +134,7 @@ private static void readFeatures(File path, BiConsumer consumer, - IProgressMonitor monitor) throws ResolverException { + IProgressMonitor monitor, IArtifactRepository artifactRepository) throws ResolverException { PublisherInfo publisherInfo = new PublisherInfo(); publisherInfo.setArtifactOptions(IPublisherInfo.A_INDEX); if (path.isDirectory()) { @@ -163,7 +165,7 @@ private static void readBundles(File path, BiConsumer fileDescriptors = new ArrayList<>(); private FileRepositoryArtifactProvider fileRepositoryArtifactProvider; + private FileArtifactRepository artifactRepository; + public PomDependencyCollectorImpl(Logger logger, ReactorProject project, IProvisioningAgent agent) { this.logger = logger; this.project = project; + artifactRepository = new FileArtifactRepository(agent, fileDescriptors::iterator); fileRepositoryArtifactProvider = new FileRepositoryArtifactProvider( - Collections.singletonList(new FileArtifactRepository(agent, fileDescriptors::iterator)), - ArtifactTransferPolicies.forLocalArtifacts()); + Collections.singletonList(artifactRepository), ArtifactTransferPolicies.forLocalArtifacts()); } public File getProjectLocation() { @@ -85,7 +87,8 @@ public Entry addMavenArtifact(IArtifactFacade for (IArtifactKey key : unit.getArtifacts()) { ArtifactKey artifactKey = ArtifactTypeHelper.toTychoArtifactKey(unit, key); if (artifactKey != null) { - IArtifactDescriptor descriptor = FileArtifactRepository.forFile(artifact.getLocation(), key); + IArtifactDescriptor descriptor = FileArtifactRepository.forFile(artifact.getLocation(), key, + artifactRepository); fileDescriptors.add(descriptor); descriptorMap.put(artifact, descriptor); resultArtifactKey = new SimpleEntry<>(artifactKey, descriptor); diff --git a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/RepositoryLocationContent.java b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/RepositoryLocationContent.java index 8a0768ca84..2b3414102c 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/RepositoryLocationContent.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/RepositoryLocationContent.java @@ -32,7 +32,6 @@ import org.eclipse.equinox.p2.metadata.IInstallableUnit; import org.eclipse.equinox.p2.publisher.IPublisherInfo; import org.eclipse.equinox.p2.publisher.PublisherInfo; -import org.eclipse.tycho.p2maven.tmp.BundlesAction; import org.eclipse.equinox.p2.publisher.eclipse.Feature; import org.eclipse.equinox.p2.repository.artifact.IArtifactDescriptor; import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository; @@ -43,6 +42,7 @@ import org.eclipse.tycho.core.shared.MavenLogger; import org.eclipse.tycho.p2.resolver.BundlePublisher; import org.eclipse.tycho.p2.resolver.FeaturePublisher; +import org.eclipse.tycho.p2maven.tmp.BundlesAction; import org.eclipse.tycho.p2maven.transport.TychoRepositoryTransport; import org.eclipse.tycho.targetplatform.TargetDefinitionContent; import org.eclipse.tycho.targetplatform.TargetDefinitionResolutionException; @@ -106,13 +106,13 @@ public RepositoryLocationContent(URI uri, Collection requirements, throw new TargetDefinitionResolutionException("Can't fetch resource from " + url, e); } } - FeaturePublisher.publishFeatures(features, repositoryContent::put, logger); + FeaturePublisher.publishFeatures(features, repositoryContent::put, artifactRepository, logger); } private void publish(BundleDescription bundleDescription, File bundleLocation) { IArtifactKey key = BundlesAction.createBundleArtifactKey(bundleDescription.getSymbolicName(), bundleDescription.getVersion().toString()); - IArtifactDescriptor descriptor = FileArtifactRepository.forFile(bundleLocation, key); + IArtifactDescriptor descriptor = FileArtifactRepository.forFile(bundleLocation, key, artifactRepository); PublisherInfo publisherInfo = new PublisherInfo(); publisherInfo.setArtifactOptions(IPublisherInfo.A_INDEX); IInstallableUnit iu = BundlePublisher.publishBundle(bundleDescription, descriptor, publisherInfo); diff --git a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/TargetPlatformFactoryImpl.java b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/TargetPlatformFactoryImpl.java index 51570d6cb3..d266804e59 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/TargetPlatformFactoryImpl.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/p2resolver/TargetPlatformFactoryImpl.java @@ -242,7 +242,7 @@ public P2TargetPlatform createTargetPlatform(TargetPlatformConfigurationStub tpC try { MavenPropertiesAdvice advice = new MavenPropertiesAdvice(mavenArtifactKey.getGroupId(), mavenArtifactKey.getArtifactId(), key.getVersion()); - Optional iu = BundlePublisher.getBundleIU(bundleFile, advice); + Optional iu = BundlePublisher.getBundleIU(bundleFile, null, advice); IInstallableUnit unit = iu.orElse(null); if (unit != null) { InstallableUnitDescription description = new InstallableUnitDescription(); diff --git a/tycho-eclipse-plugin/pom.xml b/tycho-eclipse-plugin/pom.xml index e9f2051c73..1b0160aa10 100644 --- a/tycho-eclipse-plugin/pom.xml +++ b/tycho-eclipse-plugin/pom.xml @@ -39,7 +39,7 @@ org.eclipse.pde org.eclipse.pde.core - 3.18.0 + 3.18.100 jar diff --git a/tycho-extras/tycho-document-bundle-plugin/pom.xml b/tycho-extras/tycho-document-bundle-plugin/pom.xml index c13a59d0ba..b799c18945 100644 --- a/tycho-extras/tycho-document-bundle-plugin/pom.xml +++ b/tycho-extras/tycho-document-bundle-plugin/pom.xml @@ -64,7 +64,7 @@ org.eclipse.pde org.eclipse.pde.core - 3.18.0 + 3.18.100 diff --git a/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/pom.xml b/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/pom.xml index b756e35e5a..d706c7154c 100644 --- a/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/pom.xml +++ b/tycho-surefire/org.eclipse.tycho.surefire.osgibooter/pom.xml @@ -38,7 +38,7 @@ org.eclipse.platform org.eclipse.e4.ui.workbench3 - 0.17.300 + 0.17.400 *