-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[infrastructure] auto-create addons-BOM #5551
Conversation
Fixes #5214 |
bom/openhab-addons/pom.xml
Outdated
</dependency> | ||
<dependency> | ||
<groupId>org.openhab.addons.bundles</groupId> | ||
<artifactId>org.openhab.binding.dlinksmarthome</artifactId> | ||
<version>${project.version}</version> | ||
<version>2.5.0-SNAPSHOT</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we also use the project version some way? It might make releasing harder? What is the plan should this file stay in the repo and be comitted after running the goal manual (like the copyright headers?)
Or is there some other plan?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
version: Not so easy, I'll try. The problem is that maven replaces the place-holder in l. 72 of the pom before replacing the file-content. I don't know how to prevent that.
I would prefer to run it on each clean install
(i.e. re-build it every time) and remove it from the repo. But maven will not start at all if the bom-pom is missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which is strange, because the BOM is not used within this repo and is really just a generated file to be uploaded to bintray.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the culprit. This includes the bom/pom.xml which includes the openhab-addons/pom.xml. If we remove it from the repo this is missing and maven complains.
</dependency> | ||
<dependency> | ||
<groupId>org.openhab.addons.bundles</groupId> | ||
<artifactId>org.openhab.binding.mqtt.homeassistant</artifactId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@davidgraeff is this all expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some bundles where in another ordering (maybe mistake) and some where missing at all. I don't think that was by intention.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not by intention, correct. The BOM is not yet used anywhere afaik, so nobody noticed.
bom/pom.xml
Outdated
<replacevalue><![CDATA[<parent> | ||
<groupId>org.openhab.addons.bom</groupId> | ||
<artifactId>org.openhab.addons.reactor.bom</artifactId> | ||
<version>2.5.0-SNAPSHOT</version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make this dynamic this will make releasing though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be replaced by the project.version, true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's the parent reference so not trivial though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since maven replaces it with the value that is valid during the run, it's easy.
<goals> | ||
<goal>run</goal> | ||
</goals> | ||
<configuration> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we link some phase here to put in the right location of the build cycle or is this a deliberate choice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, we can't run that during our normal build (see above). If we have to execute it manually as seperate task anyway, we don't need a phase. I could add it to generate-sources
, if you think that is useful.
Thanks @J-N-K |
@maggu2810 I think the checked in openhab2-addons bom file is used for bnd to generate the bnd index-something-something repositories? Would it be possible to remove the checked in variant and auto-generate it like in this pr for bnd? |
Please make sure that when removing any files and generate them instead the IDE still works - we should not require a full Maven build before the IDE is usable for add-on development. |
I don't understand why the POM should be removed. If it is just for tooling to update the existing one similar to update the license in front of check in it is another story but as you used "remove"... If it is to update an existing one IMHO you should replace the hard-coded version by Why making the life harder again? |
|
That's why I'm asking for the use-case. At the moment it seems for me that the bom is only used for being uploaded like a build artifact and in that case it can be generated. |
It is also used by the Bnd resolver (not only the explicit called Maven goal, but also in the IDE implicit by the Bndtools). As soon as it is used, it should also be present. |
I suspected that. In contrast to openhab core this repo contains independent bundles, so it makes sense to keep as much bundle specific information (karaf feature definition, maven dependencies etc) in the corresponding bundle directory. Makes it easier for maintainers to review and for new binding PRs to run only a subset of the repo. |
I assume people that would like to develop a new bundle needs to read at least some lines of documentation. You would also like to move the Karaf feature definition to the correspondent bundle directory? |
See https://github.com/openhab/openhab2-addons/issues/5222 and the corresponding PR. The file is merged in the current PR for uploading. The single feature files in each bundle directory are standalone valid though. My goal at the moment is to get travis ci running with full test and checks and feature verification enabled for new binding PRs (#5389). But I cannot check the BOM in a sane way. (Until now: Where I can auto generate and compare it).
That would be wonderful, but you'd be surprised. Not much is read. And I like travis to fail if such basic tasks like the BOM amending are not done. (Or not having the static BOM at all, that's why I asked). |
I assume I get your point to move all bundle specific stuff below one bundle specific directory and all that stuff can be tested on its own.
If the openHAB Addons maintainer would like to use that approach, IMHO:
|
For the feature: we should discuss that in #5555. For here I assume that using it just as a tool for manual re-creation is ok. I'll check what I can do about the {project.version}. My problem here is that maven replaces it in my ant-directives. |
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
Fixed the issue with the version, looks a bit hackish but probably the best way we can do. |
Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
Nobody seems to veto, so I'm going to merge and amend the documentation by that command. |
* auto-create addons-BOM Signed-off-by: Jan N. Klug <jan.n.klug@rub.de>
* auto-create addons-BOM Signed-off-by: Jan N. Klug <jan.n.klug@rub.de> Signed-off-by: Pshatsillo <pshatsillo@gmail.com>
* auto-create addons-BOM Signed-off-by: Jan N. Klug <jan.n.klug@rub.de> Signed-off-by: Maximilian Hess <mail@ne0h.de>
This allows to auto-create the addons-BOM from the bundles-POM.
The problem is that it needs an extra maven-call
mvn antrun:run@create-bom
in front ofmvn clean install
because the bom-POM is otherwise parsed before it is created. Therefore I left it in place.Signed-off-by: Jan N. Klug jan.n.klug@rub.de