Bundle versioning

Hi,

I have modified part of the source of MainUI, because there was a bug fixed I’d rather keep. I build that change with maven and copied the resulting .jar over to my production system in the addons folder. It got picked up and is working as expected.

My question: In the bundle list it is shown as regular -3.0.1 version. I’d prefer it to show something like -3.0.1_PERSONAL to clearly remind me that I’ve switched something out there.

But I did not find a way to do that. Changing the name of the .jar seems not to be the right way to go ;). I’ve not found any doc on this, but that might be me.

What I’ve done:

  • Clone the openhab-webui repo
  • Switched to the 3.0.1 branch
  • Made my changes
  • ‘mvn clean install -DskipChecks’ in the bundle directory
  • Copied the resulting .jar from the target directory

Any help or pointer to the right documentation is very much appreciated :slight_smile:

Version is set in the pom.xml

Hi,

thanks for the info. So I’d need to change this file ( openhab-webui/pom.xml at main · openhab/openhab-webui · GitHub ), change line 9 to whatever I want and also change all lines referring to the ${project.version} to something valid (like 3.0.1)? Or did I get that wrong?

Thanks

Better add a new version tag under the artifactId. And yes, you probably need to change the {project.version} to 3.1.0-SNAPSHOT (or whatever the version of the parent project is).

Sorry I don’t get it. If I add a new version tag under artifactId I’d end up with 2 version tags? Seems wrong. Anyway. I tried changing them and setting the project.version references to something valid and it did not build:

[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-resolvable parent POM for org.openhab.ui.bundles:org.openhab.ui:3.0.1-PERSONAL_21021301: Failure to find org
.openhab.ui.bundles:org.openhab.ui.reactor.bundles:pom:3.0.1-PERSONAL_21021301 in Central Repository: w
as cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed o
r updates are forced and ‘parent.relativePath’ points at wrong local POM @ line 6, column 11

That was with:

  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.openhab.ui.bundles</groupId>
    <artifactId>org.openhab.ui.reactor.bundles</artifactId>
    <version>3.0.1-TEST</version>
  </parent>

And the references changed (example. I changed all of course):

<dependency>
  <groupId>org.openhab.core.bundles</groupId>
  <artifactId>org.openhab.core.ui</artifactId>
  <version>3.0.1</version>
</dependency>

I’m working on 3.0.1. So that should be fine.

EDIT: I only changed the pom.xml in the bundle directory I’m trying to build.

Don’t change anything in the parent section. This will mess up your build. Add a new version tag below the artifactId (below the parent-section). These are different versions. One is the version of the parent-pom and the other is the version of the current artifact. They don’t need to be same same. Generally they are inherited, that’s why it’s missing if they are the same.

Ah I got that wrong. Sadly it still does not work. It is still deriving some dependency/buld target information from that string:

[INFO] ---------------< org.openhab.ui.bundles:org.openhab.ui >----------------
[INFO] Building openHAB UI :: Bundles :: Main UI 3.0.1-PERSONAL_21021301
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The POM for org.openhab.core.bom:org.openhab.core.bom.compile:pom:3.0.1-PERSONAL_21021301 is missing, no dependenc
y information available
[WARNING] The POM for org.openhab.core.bom:org.openhab.core.bom.compile-model:pom:3.0.1-PERSONAL_21021301 is missing, no dep
endency information available
[WARNING] The POM for org.openhab.core.bom:org.openhab.core.bom.test:pom:3.0.1-PERSONAL_21021301 is missing, no dependency i
nformation available

This time put it as you explained:

<artifactId>org.openhab.ui</artifactId>
<version>3.0.1-PERSONAL_21021301</version
<name>openHAB UI :: Bundles :: Main UI</name>

And changed the ${project.version} to 3.0.1 (but that doesn’t seem to matter - same error).

Ok. There are two possibilities:

  1. change ${project.version} in the poms above (i.e. in bundles and probably the root directory) to 3.0.1
  2. revert all pom changes, build the bundle, rename the .jar to .zip, open META-INF/MANIFEST.MF, edit the Bundle-Version, and re-name back to .jar (which is probably easier if you want to do it only once).

I’m no expert on the UI bundles, but in general if starting with SNAPSHOT, the Bundle-Version should be something like 3.1.0.202102121723 (so followed by a time-stamp).

That was an important piece of info I was not aware about. I’ll switch over to SNAPSHOT then. That should solve my problems :wink: Thanks for your patience.