You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by "awrb (via GitHub)" <gi...@apache.org> on 2023/02/07 21:51:25 UTC
[GitHub] [karaf] awrb opened a new pull request, #1713: KARAF-5421 - add user friendly error when installing non OSGi bundle …
awrb opened a new pull request, #1713:
URL: https://github.com/apache/karaf/pull/1713
…via bundle:install
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@karaf.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [karaf] jbonofre commented on pull request #1713: KARAF-5421 - add user friendly error when installing non OSGi bundle …
Posted by "jbonofre (via GitHub)" <gi...@apache.org>.
jbonofre commented on PR #1713:
URL: https://github.com/apache/karaf/pull/1713#issuecomment-1422146917
Yes I think blueprint installer is creating a bundle on the fly. So that's why it works.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@karaf.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [karaf] jbonofre commented on pull request #1713: KARAF-5421 - add user friendly error when installing non OSGi bundle …
Posted by "jbonofre (via GitHub)" <gi...@apache.org>.
jbonofre commented on PR #1713:
URL: https://github.com/apache/karaf/pull/1713#issuecomment-1423000318
@awrb that's blueprint bundles, I mean that it's possible to directly deploy blueprint XML in Karaf:
```
bundle:install blueprint:mvn:...
```
I will test myself later today or tomorrow.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@karaf.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [karaf] awrb commented on pull request #1713: KARAF-5421 - add user friendly error when installing non OSGi bundle …
Posted by "awrb (via GitHub)" <gi...@apache.org>.
awrb commented on PR #1713:
URL: https://github.com/apache/karaf/pull/1713#issuecomment-1422155593
> Yes I think blueprint installer is creating a bundle on the fly. So that's why it works.
The docs say it does https://karaf.apache.org/manual/latest/#_blueprint_deployer
```
The generated OSGi MANIFEST will contain the following headers:
Manifest-Version: 2
Bundle-SymbolicName: [name of the file]
Bundle-Version: [version of the file]
Import-Package: [required packages]
DynamicImport-Package: *
```
but I am not sure when this happens compared to bundle:install.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@karaf.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [karaf] awrb commented on a diff in pull request #1713: KARAF-5421 - add user friendly error when installing non OSGi bundle …
Posted by "awrb (via GitHub)" <gi...@apache.org>.
awrb commented on code in PR #1713:
URL: https://github.com/apache/karaf/pull/1713#discussion_r1099753821
##########
bundle/core/src/main/java/org/apache/karaf/bundle/command/Install.java:
##########
@@ -82,15 +82,26 @@ public Object execute() throws Exception {
for (URI url : urls) {
try {
Bundle bundle = bundleContext.installBundle(url.toString(), null);
- if (!"2".equals(bundle.getHeaders().get(Constants.BUNDLE_MANIFESTVERSION))) {
+ String manifestVersion = bundle.getHeaders().get(Constants.BUNDLE_MANIFESTVERSION);
+
+ if (!"2".equals(manifestVersion)) {
if (allowR3) {
if (!r3warned) {
System.err.println("WARNING: use of OSGi r3 bundles is discouraged");
r3warned = true;
}
} else {
+ String error;
+ if (manifestVersion == null) {
Review Comment:
Actually this needs to be checked independently of `allowR3` because with --allowR3 this will let non-OSGi bundles through.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@karaf.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [karaf] awrb commented on pull request #1713: KARAF-5421 - add user friendly error when installing non OSGi bundle …
Posted by "awrb (via GitHub)" <gi...@apache.org>.
awrb commented on PR #1713:
URL: https://github.com/apache/karaf/pull/1713#issuecomment-1422136798
Good point @jbonofre, I will check in the evening. If it doesn't work then I'll add a test since the current ones did not detect it if it broke. Although the previous code looks like it wouldn't work too, because it was either manifest version == "2" or exception (unless --r3-bundles is passed).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@karaf.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [karaf] awrb commented on pull request #1713: KARAF-5421 - add user friendly error when installing non OSGi bundle …
Posted by "awrb (via GitHub)" <gi...@apache.org>.
awrb commented on PR #1713:
URL: https://github.com/apache/karaf/pull/1713#issuecomment-1422983268
@jbonofre I just tried manually and it looks like the blueprint bundles install fine, e.g. the bundles of mvn:org.apache.karaf.examples/karaf-blueprint-example-* (as confirmed by karaf/itests/test/src/test/java/org/apache/karaf/itests/examples/BlueprintExampleTest.java passing in the pipeline).
But they are already bundles because of `<packaging>bundle</packaging>` and `maven-bundle-plugin`. Blueprint just handles service dynamics. Am I missing something?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@karaf.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [karaf] awrb commented on pull request #1713: KARAF-5421 - add user friendly error when installing non OSGi bundle …
Posted by "awrb (via GitHub)" <gi...@apache.org>.
awrb commented on PR #1713:
URL: https://github.com/apache/karaf/pull/1713#issuecomment-1423004224

after `bundle:install -s blueprint:file:...` it generates Bundle-ManifestVersion automatically for me. But I'm just testing one use case so if you can test too that's great.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@karaf.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [karaf] jbonofre commented on pull request #1713: KARAF-5421 - add user friendly error when installing non OSGi bundle …
Posted by "jbonofre (via GitHub)" <gi...@apache.org>.
jbonofre commented on PR #1713:
URL: https://github.com/apache/karaf/pull/1713#issuecomment-1422069331
Did you check if you directly install a blueprint xml ? The blueprint xml doesn't contain manifest so I think your change will block it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@karaf.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [karaf] jbonofre merged pull request #1713: KARAF-5421 - add user friendly error when installing non OSGi bundle …
Posted by "jbonofre (via GitHub)" <gi...@apache.org>.
jbonofre merged PR #1713:
URL: https://github.com/apache/karaf/pull/1713
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@karaf.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org