-
-
Notifications
You must be signed in to change notification settings - Fork 305
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
[bnd-run-maven-plugin][bnd-testing-plugin] specifiy bndrun file in the pom.xml directly #5496
Comments
The same applies to bnd-testing-maven-plugin |
The big issue with this is that bndrun files aren’t just build configuration, they also have content that is usually generated (the runbundles). Maven plugins should not (and possibly cannot) modify the pom file, making inline bndrun content either fairly useless, or having to be merged with a separate file anyway. |
The pom-file cannot be modified but the pom (object) can. Anyways it is bad to rely in a build on modifying an exiting (repository managed) files, so if there is a need for a previous stage to pass data it should:
So in case you described the bnd-resolve (?) plugin could write a file So if you say a static bndrun would be useless, this actually shows a design-flaw here than a requirement as even for a file I would assume this to being "static" while the build runs. |
Using inline bndrun files was discussed and rejected in #4476. The same issues still apply. A bndrun file is input to multiple bnd maven plugins (resolve, testing, run, export). So inlining a bndrun file would require duplication of configuration since maven does not really provide a way for multiple plugins to share some common POM configuration. The resolve plugin writes an output bndrun which can then be input to testing, run, export. So I don't think it is a useful change to support inline bndrun files for the bnd maven plugins which process bndrun files. |
It can be but why should it be required to use all of these?
Why not let the user decide if it is acceptable to "duplicate" things? I think it won't be much of an effort to allow defining it inline so users have a choice. Even the documentation says that a lot of things are inherited from the maven config already, but at the moment the execution is just skipped if there is no bndrun file so one needs to at least provide an empty one so the plugin actually do anything even if one wants it to inherit everything from the pom... |
So would you say that this model is also broken for the npm Either manually or as part of a local build a developer can calculate the run bundles, check that list in, and then get failures in CI if the list is no longer correct. |
As long as the build does not modify the file it does not really matter how it is generated, but a file should either be generated by the build (and not checked in) or stay the same regardless of how often I run the build.
And why should a developer not being allowed to put that file-content into the So if I have computed/created/... the bndrun-file it should be static, and if it is my choice I would like to put this content into the pom.xml ... if that means additional steps if there are changes, this is not the concern of the maven-plugin developer. One reason might be that I have crafted everything carefully, have checked every single license of each bundle and actually want the CI fail if anything changes here, so an automated approach won't reveal that problem. |
This simply isn’t the case. Some files are too hard to write accurately by hand (excluding trivial cases) but can be generated based on analysis by a tool. These files should be generated. If the result of that needs to be used in CI to validate something then you should check it in. This is exactly the
As one of the authors of the bnd-resolver-Maven-plugin I can tell you that it is my concern. That plugin’s job is to calculate the run bundles and add them to the bndrun to save a developer from manual steps.
This is exactly the scenario I used with in my second comment. CI builds do a resolve, compare the result with the run bundles in the bndrun (a checked in file) and fail the build if there are differences.
This would be the bnd-resolver-maven-plugin. So you would like to add another option with worse usability than the current case where the plugin can update the file for you, and that file can be |
Nothing you wrote is wrong, still there is no reason why such generated data must be updated at build time! I can run these tools on my dev maschine and then put the result into my pom. And given you have a smaller library these don't frequently change nor are large chunks. Just use this example from this repository: and if I use the inferred vales from here it even becomes shorter, so there not much left. So the only thing left is now the mentioned run-bundles, I might let me generate that list, but I even might want to maintain it by hand (for whatever demands). An at least @kwin has had such a requirement as well in #4476 so it seems there are (maybe rare) cases where it is useful, but supporting this is nothing complex (you can even write it out to a temp file in target if that makes coding easier). |
I just noticed that the maven-testing-plugin even has parameter:
So I would understand it that in such a case I won't need the |
Correct. But you may also have a run and export plugin configured to use the same bndrun file(s), so having a discrete resolve step is then useful. See also #4464 where it was discussed to remove the resolve configuration option from the testing (and other) plugin. |
But that's the point (and I agree with @njbartlett here) in some setups it might be useful to split this in different phases ad do all kind of sophisticated stuff, but still there are use-cases where just simple invocations are required, so why not support both use-cases? Having split all these mojos over different maven plugins is already quite inconvenient but spreading required tasks over different plugins and goals makes it then really hard to use and one needs a lot of domain-specific (bnd) knowledge and documentation. Just compare this with the maven counterpart https://maven.apache.org/surefire/maven-surefire-plugin/usage.html:
So if one want to encourage users to use bnd more, it should work similar easy with just using good defaults, in case of the bnd-testing plugin that would be:
So by default no |
For the sake of all the "what-if ..." I have here a concrete example: This executes the JDBC TCK test as part of a regular plain maven build and the run file is as trivial as (it is even two lines longer as required due to #5539):
it is never modified as part of the build, but requires me to pollute the repository with an additional file that other developers most likely find irritating and won't assume it is connected to the maven config in any way. |
I am ok with this since I like those options, they simplify the build. However, I will list to @timothyjward, @rotty3000 , etc.. since they heavily use maven. |
My issue with this example is that it is incomplete. A bndrun is supposed to contain the list of bundles to run. In this case the bndrun file doesn't have a The issue with this usage pattern is that is that it is then difficult (possibly impossible?) for me to run/rerun/debug the tests directly in my IDE. I also get no ability to see what bundles are running in the tests as it's hidden in generated files. Currently Bndtools can provide a lot of help, allowing you to |
@timothyjward in 6.4 I added a |
Try it out, it runns the referenced test-cases and bundles mentioned in runrequires :-)
This will depend a bit on the IDE, but often it is sufficient to run things only as part of the build, i.e. in this example no one will ever install Bndtools so one can't run the tests anyways using the bndrun file. But even if, e.g. when the bndrun file is simply written to the |
Currently bnd-run-maven-plugin requires a bndrun file as a file.
bnd-maven-plugin allows to inline a bnd file as CDATA.
it would be good to have such an option for bndrun as well.
The text was updated successfully, but these errors were encountered: