Skip to content

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

Open

Description

@rwgaj

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:

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?

  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

Activity

  1. jbonofre commented on Nov 12, 2025

    @jbonofre
    Member

    Why not using bundle:update with release version ? A released artifact is changing with its version (from 1.0.0 to 1.1.0 for instance). The purpose of bundle:watch is to watch the file change without version change (SNAPSHOT).

    So I guess your use case is to automatically update bundle when you bump a version ? What would be the trigger ?

  2. rwgaj commented on Nov 12, 2025

    @rwgaj
    Author

    I did not clearly describe the use case, let me elaborate:

    Usually, during development, I change a bundles version to let's say 1.5.0-SNAPSHOT. Once I made some changes, I install it to my local repository and it gets updated in my locally running development application (using bundle:watch *), where I test and verify the changes.

    Basically, that's my development cycle. It works very well.

    Before last week, I didn't even know, that the bundle:watch command only updates snapshot bundles.

    I made some changes in a bundle (let's say version 1.1.0) and installed it to my local repository (overwriting the existing 1.1.0). I know it's bad practice and a release version should not change.

    I then looked into several things, like my Maven configuration and a couple other, because I was wondering, why the bundle did not update.

    It was then, that I discovered, that it only updates snapshot bundles automatically.

    I solved my issue by temporarily changing the bundles version to a snapshot for local development and then changing it to a release once I was done (like I should have from the start).

    So I guess my point is:

    Although it's bad practice to make changes in the release version of a bundle, would there be any harm with allowing auto updates in this case?

    Basically, I see this feature request as a nice to have, even though it's technically based on bad practice (but would not cause any harm, I guess ^^).

    I hope I could get my point across, as English is not my native language.

  3. jbonofre commented on Jan 25, 2026

    @jbonofre
    Member

    Ah, I see. bundle:watch is there primarily for SNAPSHOT during dev cycle.
    I understand your use case. I'm not a big fan to automatically update released versions.
    Also, should we consider any version, or range, or file modification date ? SNAPSHOT is easy because we have the modification time in the metadata.
    I'm not against the use case, but I have to think more what's the best way to do it.

  4. self-assigned this
    on Jan 25, 2026
  5. rwgaj commented on Jan 27, 2026

    @rwgaj
    Author

    Hello JB,

    Thank you for investing time in this issue; I really appreciate it.

    These are my thoughts after reflecting on it:

    In some edge cases, you might not be able to change the version of a bundle - only the source code. For example, another bundle you have no control over might require a specific version. Even in those cases, you could still use bundle:update to update it manually, right?

    You could also create a custom bundle that provides the capability to watch specific release bundles, if you really need it.

    My motivation for creating this issue came from frustration, because I was not aware that only snapshot bundles are watched. That’s on me, though, since it is documented in the user guide and in the command description.

    I still think there’s no problem with adding an option for this, but I also reckon there are far more important issues.

    I would gladly assist if you decide to pursue this issue further, but I’m totally fine with closing it.

    Thanks again 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions