Skip to content

Commit

Permalink
Add workaround for latest maven-install plugin
Browse files Browse the repository at this point in the history
(cherry picked from commit afcfd26)
  • Loading branch information
laeubi committed Jan 27, 2024
1 parent 39c622a commit 9902cff
Showing 1 changed file with 24 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<Category> loadCategories(final ReactorProject project) {
Expand All @@ -83,7 +98,8 @@ public List<Category> 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<Category> loadCategories(final File categoriesDirectory) {
Expand Down Expand Up @@ -130,10 +146,11 @@ private List<File> 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<File> getProductFiles(final ReactorProject project) {
Expand All @@ -144,7 +161,8 @@ public List<File> 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<File> getProductFiles(final File basedir) {
Expand Down

0 comments on commit 9902cff

Please sign in to comment.