apache / apache/karaf

Feature: Allow to update non-snapshot bundles via bundle:watch

Open
#2,141 4 comments 0 reactions 1 assignee Claimed by @jbonofre View on GitHub
Dominant language
Java
Stars
712
Forks
664
Avg merge
2d 20m
Merged PRs (30d)
84

Description

## Usecase

For local development, I sometimes use non-snapshot versions, but still want to auto update bundles via `bundle:watch` command.

Only updating bundles with `SNAPSHOT` in the URL is fine as default mode, but I don't see an issue with allowing users to disable this behavior.

## Proposal

- Add option to `bundle:watch` command to enable auto update of non-snapshot bundles
- Adjust `BundleWatcher` interface and `BundleWatcherImpl` implementation to respect the new configuration option

### Notes

I did not really analyze `BundleWatcherImpl` in depth, but I guess the relevant code lines are:

```java
for (Bundle bundle : bundleService.selectBundles(Collections.singletonList(bundleURL), false)) {
if (isMavenSnapshotUrl(getLocation(bundle))) {
watchedBundles.add(bundle);
}
}
```

So I imagine something like the following might work?

```diff
for (Bundle bundle : bundleService.selectBundles(Collections.singletonList(bundleURL), false)) {
- if (isMavenSnapshotUrl(getLocation(bundle))) {
+ if (updateNonSnapshotBundles == true || isMavenSnapshotUrl(getLocation(bundle))) {
watchedBundles.add(bundle);
}
}
```

I wanted to get some feedback from the maintainers. If you consider this as a valid feature, I could try to provide the PR.

Thank you for this awesome project, looking forward to your feedback.

---

Best regards,

Joshua

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.