From 9902cff2cf8cc4291e06faeebdfbde3d92625f7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20L=C3=A4ubrich?= Date: Fri, 26 Jan 2024 17:30:08 +0100 Subject: [PATCH] Add workaround for latest maven-install plugin (cherry picked from commit afcfd2621bf96e39873b47d0ec1d193e1b51b9e7) --- .../osgitools/EclipseRepositoryProject.java | 30 +++++++++++++++---- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/EclipseRepositoryProject.java b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/EclipseRepositoryProject.java index 1a2c8648e8..0dd45d280d 100644 --- a/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/EclipseRepositoryProject.java +++ b/tycho-core/src/main/java/org/eclipse/tycho/core/osgitools/EclipseRepositoryProject.java @@ -16,7 +16,10 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; +import java.util.Properties; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.project.MavenProject; import org.codehaus.plexus.component.annotations.Component; import org.eclipse.tycho.ArtifactKey; import org.eclipse.tycho.DefaultArtifactKey; @@ -70,10 +73,22 @@ public void walk(ArtifactDependencyVisitor visitor) { }; } + @Override + public void setupProject(MavenSession session, MavenProject project) { + super.setupProject(session, project); + //This is a hack for install plugin that requires a "main" artifact and otherwise fails + //but a repository project may only attaches additional artifacts, e.g updatesite / products + Properties properties = project.getProperties(); + if (properties.getProperty("allowIncompleteProjects") == null) { + properties.setProperty("allowIncompleteProjects", "true"); + } + } + /** * Parses the category configuration files * - * @param project the project containing the category files + * @param project + * the project containing the category files * @return the parsed category configurations */ public List loadCategories(final ReactorProject project) { @@ -83,7 +98,8 @@ public List loadCategories(final ReactorProject project) { /** * Parses the category configuration files * - * @param categoriesDirectory the directory where the category files are stored + * @param categoriesDirectory + * the directory where the category files are stored * @return the parsed category configurations */ public List loadCategories(final File categoriesDirectory) { @@ -130,10 +146,11 @@ private List getCategoryFiles(final File basedir) { } /** - * Looks for all files at the base of the project that extension is ".product" - * Duplicated in the P2GeneratorImpl + * Looks for all files at the base of the project that extension is ".product" Duplicated in the + * P2GeneratorImpl * - * @param project the project containing the product files + * @param project + * the project containing the product files * @return The list of product files to parse for an eclipse-repository project */ public List getProductFiles(final ReactorProject project) { @@ -144,7 +161,8 @@ public List getProductFiles(final ReactorProject project) { /** * Looks for all files with the extension ".product" under a specific directory. * - * @param basedir the directory containing the product files + * @param basedir + * the directory containing the product files * @return The list of product files to parse for an eclipse-repository project */ public List getProductFiles(final File basedir) {