Skip to content

Commit

Permalink
Add a flag to skip the service-component file check in packaging-plugin
Browse files Browse the repository at this point in the history
This allows to disable the selectively based on property values.
  • Loading branch information
HannesWell committed Sep 16, 2024
1 parent 8462a37 commit 7b28c69
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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("*")) {
Expand Down

0 comments on commit 7b28c69

Please sign in to comment.