diff --git a/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/PackagePluginMojo.java b/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/PackagePluginMojo.java index 59b3abbc49..dd34240393 100644 --- a/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/PackagePluginMojo.java +++ b/tycho-packaging-plugin/src/main/java/org/eclipse/tycho/packaging/PackagePluginMojo.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2022 Sonatype Inc. and others. + * Copyright (c) 2008, 2024 Sonatype Inc. and others. * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at @@ -155,6 +155,13 @@ public class PackagePluginMojo extends AbstractTychoPackagingMojo { @Parameter(defaultValue = "true") private boolean deriveHeaderFromSource; + /** + * If {@code true}, it is checked that the explicitly declared OSGi service + * component files exist. + */ + @Parameter(defaultValue = "true") + private boolean checkServiceComponentFilesExist = true; + @Component private SourceReferenceComputer soureReferenceComputer; @@ -259,7 +266,7 @@ private File createPluginJar() throws MojoExecutionException { checkBinIncludesExist(buildProperties, binIncludesIgnoredForValidation.toArray(new String[0])); // 4. check DS files exits... TychoProject facet = getTychoProjectFacet(); - if (facet instanceof OsgiBundleProject bundleProject) { + if (checkServiceComponentFilesExist && facet instanceof OsgiBundleProject bundleProject) { String components = bundleProject.getManifestValue("Service-Component", project); if (components != null) { if (components.contains("*")) {