royteeuwen opened a new pull request, #32:
URL: https://github.com/apache/sling-feature-launcher-maven-plugin/pull/32
## Summary
The `<launch>` element currently accepts exactly one of `<feature>` (Maven
coordinates) or `<featureFile>` (local path), validated as mutually exclusive.
The underlying `org.apache.sling.feature.launcher` CLI has supported multiple
`-f` flags for years — the plugin just never exposed it.
This PR adds four additive `<launch>` configuration fields and relaxes the
existing exclusivity check:
```xml
<launch>
<id>...</id>
<feature>...</feature> <!-- existing, optional -->
<featureFile>...</featureFile> <!-- existing, optional -->
<!-- NEW: additional Maven-coord features to aggregate -->
<features>
<feature>...</feature>
</features>
<!-- NEW: additional local feature files to aggregate -->
<featureFiles>
<featureFile>...</featureFile>
</featureFiles>
<!-- NEW: maps to launcher --osgi-bsn-collision-detection (1.3.6) -->
<osgiBsnCollisionDetection>true</osgiBsnCollisionDetection>
<!-- NEW: maps to launcher -C, e.g. *:*:HIGHEST -->
<artifactClashOverrides>
<artifactClashOverride>*:*:HIGHEST</artifactClashOverride>
</artifactClashOverrides>
</launch>
```
`StartMojo` collects all four feature sources into one ordered list and
emits one `-f` flag per entry, in the order shown. Order matters for the
launcher's `LATEST` / `FIRST` overrides.
`Launch.validate()` is updated:
- Old rule: exactly one of `feature` or `featureFile` is set. **Removed**
(they're additive now).
- New rule: at least one of `feature` / `featureFile` / `features` /
`featureFiles` must be non-empty.
- New rule: each `features[*]` entry must have type `slingosgifeature`.
- New rule: each `featureFiles[*]` path must exist.
Default `featureLauncherVersion` bumped `1.3.4` → `1.3.6` so consumers pick
up `--osgi-bsn-collision-detection` (SLING-13217) out of the box.
## Backward compatibility
The only meaningful semantic change: combining `<feature>` and
`<featureFile>` was previously rejected at validation; now it's accepted as a
two-feature aggregation. Existing single-feature configurations continue to
work unchanged. The new fields are all optional with empty-list / false
defaults.
The previously-failing `LaunchTest.invalidLaunch_bothFeatureAndFeatureFile`
test was renamed and inverted to assert success with this combination. Three
new tests added covering multi-feature, missing-entry-in-`featureFiles`, and
`osgiBsnCollisionDetection=true`.
## Related
- SLING-13197 — `org.apache.sling.feature:2.0.6`:
`BuilderContext.setOsgiBsnCollisionDetection(boolean)`
- SLING-13217 — `org.apache.sling.feature.launcher:1.3.6`:
`--osgi-bsn-collision-detection` CLI flag
## Test plan
- [x] 12 unit tests in `LaunchTest` (was 8), all pass on master
- [x] `mvn install` clean (spotless + tests + invoker ITs)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]