[karaf] branch main updated: KARAF-7710 - Update BouncyCastle to 1.75
This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/karaf.git The following commit(s) were added to refs/heads/main by this push: new 7a5ff94052 KARAF-7710 - Update BouncyCastle to 1.75 new 997a909f5f Merge pull request #1726 from coheigea/coheigea/KARAF-7710 7a5ff94052 is described below commit 7a5ff94052c6963a65b9cc5469d2f83f0cd5bf51 Author: Colm O hEigeartaigh AuthorDate: Wed Jul 19 10:02:18 2023 +0100 KARAF-7710 - Update BouncyCastle to 1.75 --- assemblies/features/standard/pom.xml | 6 +++--- assemblies/features/standard/src/main/feature/feature.xml | 8 itests/test/pom.xml | 4 ++-- itests/test/src/test/filtered-resources/etc/feature.xml | 4 ++-- jaas/spring-security-crypto/pom.xml | 2 +- pom.xml | 2 +- shell/ssh/pom.xml | 4 ++-- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/assemblies/features/standard/pom.xml b/assemblies/features/standard/pom.xml index 8c7d6d6114..65dc4e4aeb 100644 --- a/assemblies/features/standard/pom.xml +++ b/assemblies/features/standard/pom.xml @@ -316,19 +316,19 @@ org.bouncycastle -bcprov-jdk15on +bcprov-jdk18on ${bouncycastle.version} provided org.bouncycastle -bcpkix-jdk15on +bcpkix-jdk18on ${bouncycastle.version} provided org.bouncycastle -bcutil-jdk15on +bcutil-jdk18on ${bouncycastle.version} provided diff --git a/assemblies/features/standard/src/main/feature/feature.xml b/assemblies/features/standard/src/main/feature/feature.xml index 0d07990190..c1ac1889b6 100644 --- a/assemblies/features/standard/src/main/feature/feature.xml +++ b/assemblies/features/standard/src/main/feature/feature.xml @@ -998,9 +998,9 @@ role=admin mvn:org.apache.sshd/sshd-osgi/${sshd.version} mvn:org.apache.sshd/sshd-scp/${sshd.version} mvn:org.apache.sshd/sshd-sftp/${sshd.version} - mvn:org.bouncycastle/bcutil-jdk15on/${bouncycastle.version} -mvn:org.bouncycastle/bcprov-jdk15on/${bouncycastle.version} -mvn:org.bouncycastle/bcpkix-jdk15on/${bouncycastle.version} + mvn:org.bouncycastle/bcutil-jdk18on/${bouncycastle.version} +mvn:org.bouncycastle/bcprov-jdk18on/${bouncycastle.version} +mvn:org.bouncycastle/bcpkix-jdk18on/${bouncycastle.version} mvn:org.apache.karaf.shell/org.apache.karaf.shell.ssh/${project.version} @@ -1455,7 +1455,7 @@ org.apache.felix.eventadmin.AddSubject=true jaas -mvn:org.bouncycastle/bcprov-jdk15on/${bouncycastle.version} +mvn:org.bouncycastle/bcprov-jdk18on/${bouncycastle.version} mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-security-crypto/${spring.security53.version} mvn:org.apache.karaf.jaas/org.apache.karaf.jaas.spring-security-crypto/${project.version} diff --git a/itests/test/pom.xml b/itests/test/pom.xml index 86a70ef59a..5a2c823672 100644 --- a/itests/test/pom.xml +++ b/itests/test/pom.xml @@ -185,13 +185,13 @@ org.bouncycastle -bcprov-jdk15on +bcprov-jdk18on test ${bouncycastle.version} org.bouncycastle -bcpkix-jdk15on +bcpkix-jdk18on test ${bouncycastle.version} diff --git a/itests/test/src/test/filtered-resources/etc/feature.xml b/itests/test/src/test/filtered-resources/etc/feature.xml index f827ff6184..dc68377ab8 100644 --- a/itests/test/src/test/filtered-resources/etc/feature.xml +++ b/itests/test/src/test/filtered-resources/etc/feature.xml @@ -629,8 +629,8 @@ mvn:org.apache.sshd/sshd-osgi/${sshd.version} mvn:org.apache.sshd/sshd-scp/${sshd.version} mvn:org.apache.sshd/sshd-sftp/${sshd.version} -mvn:org.bouncycastle/bcprov-jdk15on/${bouncycastle.version} -mvn:org.bouncycastle/bcpkix-jdk15on/${bouncycastle.version} +mvn:org.bouncycastle/bcprov-jdk18on/${bouncycastle.version} +mvn:org.bouncycastle/bcpkix-jdk18on/${bouncycastle.version} mvn:org.apache.karaf.shell/org.apache.karaf.shell.ssh/${project.version} diff --git a/jaas/spring-security-crypto/pom.xml b/jaas/spring-security-crypto/pom.xml index 5b9100955e..55de1b74ba 100644 --- a/jaas/spring-security-crypto/pom.xml +++ b/jaas/spring-security-crypto/pom.xml @@ -131,7 +131,7 @@ org.bouncycastle -bcprov-jdk15on +bcprov-jdk18on test
[GitHub] [karaf] jbonofre merged pull request #1726: KARAF-7710 - Update BouncyCastle to 1.75
jbonofre merged PR #1726: URL: https://github.com/apache/karaf/pull/1726 -- 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-unsubscr...@karaf.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[karaf] branch main updated: KARAF-7708 Add example and test for JSON configuration (#1725)
This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/karaf.git The following commit(s) were added to refs/heads/main by this push: new eeb44b80ef KARAF-7708 Add example and test for JSON configuration (#1725) eeb44b80ef is described below commit eeb44b80efd1577fcd1fa55c3c17911f1f409e95 Author: paulsp AuthorDate: Fri Jul 21 01:57:05 2023 -0400 KARAF-7708 Add example and test for JSON configuration (#1725) * KARAF-7708 Add example and test for JSON configuration - Co-authored-by: Paul Spencer --- examples/karaf-config-example/README.md| 30 +++- .../src/main/feature/feature.xml | 24 +++- .../karaf/example/config/scr/MyComponent.java | 7 - .../karaf/itests/examples/ConfigExampleTest.java | 32 ++ 4 files changed, 90 insertions(+), 3 deletions(-) diff --git a/examples/karaf-config-example/README.md b/examples/karaf-config-example/README.md index bceb216456..bc8e6a3b99 100644 --- a/examples/karaf-config-example/README.md +++ b/examples/karaf-config-example/README.md @@ -40,6 +40,7 @@ The configuration uses `etc/org.apache.karaf.example.config.cfg` configuration f * **karaf-config-example-listener** listens for any change in any configuration. * **karaf-config-example-blueprint** uses configuration within a blueprint container. * **karaf-config-example-scr** uses configuration within a scr component. +* **karaf-config-example-scr-json** uses JSON configuration within a scr component. * **karaf-config-example-features** contains a Apache Karaf features repository used for deployment. ## Build @@ -209,4 +210,31 @@ felix.fileinstall.filename = file:/home/jbonofre/Workspace/karaf/assemblies/apac component.id = 1 foo = bar test = other -``` \ No newline at end of file +``` + +### SCR-JSON + +SCR natively supports json configuration. This feature uses the same `karaf-config-example-scr` bundle to display the configuration, but the feature defines the configuration is in JSON format. + +It's what `karaf-config-example-scr-json` feature is using: + +``` +karaf@root()> karaf-config-example-scr-json +``` + +At installation time, we can see the configuration display: + +``` +service.pid = org.apache.karaf.example.config +hello = world +org.apache.karaf.features.configKey = org.apache.karaf.example.config +component.name = my-component +felix.fileinstall.filename = file:/home/jbonofre/Workspace/karaf/assemblies/apache-karaf/target/apache-karaf-4.2.3-SNAPSHOT/etc/org.apache.karaf.example.config.cfg +component.id = 1 +foo = bar +complex = {"a":1,"b":"two"} +port = 300 +an_Integer_collection = [2, 3, 4] +an_int_array = [2, 3, 4] +``` + diff --git a/examples/karaf-config-example/karaf-config-example-features/src/main/feature/feature.xml b/examples/karaf-config-example/karaf-config-example-features/src/main/feature/feature.xml index 1897474e89..e9fbf66306 100644 --- a/examples/karaf-config-example/karaf-config-example-features/src/main/feature/feature.xml +++ b/examples/karaf-config-example/karaf-config-example-features/src/main/feature/feature.xml @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. --> -http://karaf.apache.org/xmlns/features/v1.4.0; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.4.0;> +http://karaf.apache.org/xmlns/features/v1.4.0; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.4.0 http://karaf.apache.org/xmlns/features/v1.4.0;> @@ -25,6 +25,22 @@ + + +{ + "hello": "world", + "foo": "bar", + "port:Integer" : 300, + "an_int_array:int[]" : [2, 3, 4], + "an_Integer_collection:CollectionInteger" : [2, 3, 4], + "complex": { + "a" : 1, + "b" : "two" + } + } + + + karaf-config-example-common mvn:org.apache.karaf.examples/karaf-config-example-static/${project.version} @@ -54,4 +70,10 @@ mvn:org.apache.karaf.examples/karaf-config-example-scr/${project.version} + +scr +karaf-config-example-common-json + mvn:org.apache.karaf.examples/karaf-config-example-scr/${project.version} + + diff --git a/examples/karaf-config-example/karaf-config-example-scr/src/main/java/org/apache/karaf/example/config/scr/MyComponent.java b/examples/karaf-config-example/karaf-config-example-scr/src/main/java/org/apache/karaf/example/config/scr/MyComponent.java index 47b50c983c..9421f65c5b 100644 ---
[GitHub] [karaf] jbonofre merged pull request #1725: KARAF-7708 Add example and test for JSON configuration
jbonofre merged PR #1725: URL: https://github.com/apache/karaf/pull/1725 -- 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-unsubscr...@karaf.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [karaf] jbonofre commented on pull request #1725: KARAF-7708 Add example and test for JSON configuration
jbonofre commented on PR #1725: URL: https://github.com/apache/karaf/pull/1725#issuecomment-1645019540 I'm merging manually in order to cleanly squash the two commits in one. Thanks ! -- 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-unsubscr...@karaf.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[BUILD-FAILURE]: Job 'Karaf/karaf-runtime/main [main] [405]'
BUILD-FAILURE: Job 'Karaf/karaf-runtime/main [main] [405]': Check console output at "https://ci-builds.apache.org/job/Karaf/job/karaf-runtime/job/main/405/;>Karaf/karaf-runtime/main [main] [405]"
[BUILD-FAILURE]: Job 'Karaf/karaf-runtime/karaf-4.3.x [karaf-4.3.x] [277]'
BUILD-FAILURE: Job 'Karaf/karaf-runtime/karaf-4.3.x [karaf-4.3.x] [277]': Check console output at "https://ci-builds.apache.org/job/Karaf/job/karaf-runtime/job/karaf-4.3.x/277/;>Karaf/karaf-runtime/karaf-4.3.x [karaf-4.3.x] [277]"
[karaf] branch karaf-4.3.x updated: Ensure jre and eecap config.properties properties can be computed for modern jvms
This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a commit to branch karaf-4.3.x in repository https://gitbox.apache.org/repos/asf/karaf.git The following commit(s) were added to refs/heads/karaf-4.3.x by this push: new d38d9bcb6f Ensure jre and eecap config.properties properties can be computed for modern jvms d38d9bcb6f is described below commit d38d9bcb6f51e6378fe8af1a53b7a7f0e84be10a Author: Romain Manni-Bucau AuthorDate: Wed Jun 14 21:09:02 2023 +0200 Ensure jre and eecap config.properties properties can be computed for modern jvms (cherry picked from commit 045165cdae3d7099bc2f892487f23d1a66e1d6df) --- .../apache/karaf/util/config/PropertiesLoader.java | 93 ++ 1 file changed, 79 insertions(+), 14 deletions(-) diff --git a/util/src/main/java/org/apache/karaf/util/config/PropertiesLoader.java b/util/src/main/java/org/apache/karaf/util/config/PropertiesLoader.java index cab78fb031..9c9d979dae 100644 --- a/util/src/main/java/org/apache/karaf/util/config/PropertiesLoader.java +++ b/util/src/main/java/org/apache/karaf/util/config/PropertiesLoader.java @@ -18,17 +18,19 @@ */ package org.apache.karaf.util.config; +import org.apache.felix.utils.properties.InterpolationHelper; +import org.apache.felix.utils.properties.Properties; + import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.util.Enumeration; - -import org.apache.felix.utils.properties.InterpolationHelper; -import org.apache.felix.utils.properties.Properties; import java.util.StringTokenizer; +import java.util.stream.IntStream; +import static java.util.stream.Collectors.joining; import static org.apache.felix.utils.properties.InterpolationHelper.substVars; public class PropertiesLoader { @@ -63,15 +65,23 @@ public class PropertiesLoader { URL configPropURL; try { configPropURL = file.toURI().toURL(); -} -catch (MalformedURLException ex) { +} catch (MalformedURLException ex) { System.err.print("Main: " + ex); return null; } Properties configProps = loadPropertiesFile(configPropURL, false); copySystemProperties(configProps); -configProps.substitute(); +configProps.substitute(new InterpolationHelper.BundleContextSubstitutionCallback(null) { +@Override +public String getValue(final String key) { +final String value = super.getValue(key); +if (value == null) { +return lookupVirtualProperty(configProps, key); +} +return value; +} +}); // Perform variable substitution for system properties. //for (Enumeration e = configProps.propertyNames(); e.hasMoreElements();) { @@ -103,16 +113,15 @@ public class PropertiesLoader { public static void loadSystemProperties(File file) throws IOException { Properties props = null; try { - URL configPropURL = file.toURI().toURL(); - props = loadPropertiesFile(configPropURL, true); -} -catch (Exception ex) { - // Ignore - return; +URL configPropURL = file.toURI().toURL(); +props = loadPropertiesFile(configPropURL, true); +} catch (Exception ex) { +// Ignore +return; } InterpolationHelper.SubstitutionCallback callback = new InterpolationHelper.BundleContextSubstitutionCallback(null); -for (Enumeration e = props.propertyNames(); e.hasMoreElements();) { +for (Enumeration e = props.propertyNames(); e.hasMoreElements(); ) { String name = (String) e.nextElement(); if (name.startsWith(OVERRIDE_PREFIX)) { String overrideName = name.substring(OVERRIDE_PREFIX.length()); @@ -127,7 +136,7 @@ public class PropertiesLoader { public static void copySystemProperties(Properties configProps) { for (Enumeration e = System.getProperties().propertyNames(); - e.hasMoreElements();) { + e.hasMoreElements(); ) { String key = (String) e.nextElement(); if (key.startsWith("felix.") || key.startsWith("karaf.") || @@ -238,4 +247,60 @@ public class PropertiesLoader { return retVal; } +private static String lookupVirtualProperty(final Properties properties, final Object key) { +final String keyString = String.valueOf(key); +if (keyString.startsWith("jre-")) { +final String versionString = keyString.substring("jre-".length()); +final Integer versionInt = toJavaIntVersion(properties, versionString); +if (versionInt == null) { +return null; +} + +// for now
[karaf] branch main updated: Ensure jre and eecap config.properties properties can be computed for modern jvms
This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/karaf.git The following commit(s) were added to refs/heads/main by this push: new 045165cdae Ensure jre and eecap config.properties properties can be computed for modern jvms new 0f2158af3a Merge pull request #1724 from rmannibucau/7696_dynamic-jre-and-eecap-props 045165cdae is described below commit 045165cdae3d7099bc2f892487f23d1a66e1d6df Author: Romain Manni-Bucau AuthorDate: Wed Jun 14 21:09:02 2023 +0200 Ensure jre and eecap config.properties properties can be computed for modern jvms --- .../apache/karaf/util/config/PropertiesLoader.java | 93 ++ 1 file changed, 79 insertions(+), 14 deletions(-) diff --git a/util/src/main/java/org/apache/karaf/util/config/PropertiesLoader.java b/util/src/main/java/org/apache/karaf/util/config/PropertiesLoader.java index cab78fb031..9c9d979dae 100644 --- a/util/src/main/java/org/apache/karaf/util/config/PropertiesLoader.java +++ b/util/src/main/java/org/apache/karaf/util/config/PropertiesLoader.java @@ -18,17 +18,19 @@ */ package org.apache.karaf.util.config; +import org.apache.felix.utils.properties.InterpolationHelper; +import org.apache.felix.utils.properties.Properties; + import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.util.Enumeration; - -import org.apache.felix.utils.properties.InterpolationHelper; -import org.apache.felix.utils.properties.Properties; import java.util.StringTokenizer; +import java.util.stream.IntStream; +import static java.util.stream.Collectors.joining; import static org.apache.felix.utils.properties.InterpolationHelper.substVars; public class PropertiesLoader { @@ -63,15 +65,23 @@ public class PropertiesLoader { URL configPropURL; try { configPropURL = file.toURI().toURL(); -} -catch (MalformedURLException ex) { +} catch (MalformedURLException ex) { System.err.print("Main: " + ex); return null; } Properties configProps = loadPropertiesFile(configPropURL, false); copySystemProperties(configProps); -configProps.substitute(); +configProps.substitute(new InterpolationHelper.BundleContextSubstitutionCallback(null) { +@Override +public String getValue(final String key) { +final String value = super.getValue(key); +if (value == null) { +return lookupVirtualProperty(configProps, key); +} +return value; +} +}); // Perform variable substitution for system properties. //for (Enumeration e = configProps.propertyNames(); e.hasMoreElements();) { @@ -103,16 +113,15 @@ public class PropertiesLoader { public static void loadSystemProperties(File file) throws IOException { Properties props = null; try { - URL configPropURL = file.toURI().toURL(); - props = loadPropertiesFile(configPropURL, true); -} -catch (Exception ex) { - // Ignore - return; +URL configPropURL = file.toURI().toURL(); +props = loadPropertiesFile(configPropURL, true); +} catch (Exception ex) { +// Ignore +return; } InterpolationHelper.SubstitutionCallback callback = new InterpolationHelper.BundleContextSubstitutionCallback(null); -for (Enumeration e = props.propertyNames(); e.hasMoreElements();) { +for (Enumeration e = props.propertyNames(); e.hasMoreElements(); ) { String name = (String) e.nextElement(); if (name.startsWith(OVERRIDE_PREFIX)) { String overrideName = name.substring(OVERRIDE_PREFIX.length()); @@ -127,7 +136,7 @@ public class PropertiesLoader { public static void copySystemProperties(Properties configProps) { for (Enumeration e = System.getProperties().propertyNames(); - e.hasMoreElements();) { + e.hasMoreElements(); ) { String key = (String) e.nextElement(); if (key.startsWith("felix.") || key.startsWith("karaf.") || @@ -238,4 +247,60 @@ public class PropertiesLoader { return retVal; } +private static String lookupVirtualProperty(final Properties properties, final Object key) { +final String keyString = String.valueOf(key); +if (keyString.startsWith("jre-")) { +final String versionString = keyString.substring("jre-".length()); +final Integer versionInt = toJavaIntVersion(properties, versionString); +if (versionInt == null) { +return null; +} + +// for now
[GitHub] [karaf] jbonofre merged pull request #1724: Ensure jre and eecap config.properties properties can be computed for modern jvms
jbonofre merged PR #1724: URL: https://github.com/apache/karaf/pull/1724 -- 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-unsubscr...@karaf.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[BUILD-FAILURE]: Job 'Karaf/karaf-runtime/karaf-4.3.x [karaf-4.3.x] [276]'
BUILD-FAILURE: Job 'Karaf/karaf-runtime/karaf-4.3.x [karaf-4.3.x] [276]': Check console output at "https://ci-builds.apache.org/job/Karaf/job/karaf-runtime/job/karaf-4.3.x/276/;>Karaf/karaf-runtime/karaf-4.3.x [karaf-4.3.x] [276]"
[karaf] branch karaf-4.3.x updated: [#7696] Add JDK 19/20/21 support
This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a commit to branch karaf-4.3.x in repository https://gitbox.apache.org/repos/asf/karaf.git The following commit(s) were added to refs/heads/karaf-4.3.x by this push: new bd600ed27d [#7696] Add JDK 19/20/21 support bd600ed27d is described below commit bd600ed27d1bc33005eb2aa2d2272b1b290fde29 Author: Matt Pavlovich AuthorDate: Wed Jun 14 10:11:09 2023 -0500 [#7696] Add JDK 19/20/21 support (cherry picked from commit f20d9c03fd35a93d5a8a2ea5e2441392062a2c53) --- Jenkinsfile| 33 -- .../resources/etc/config.properties| 18 .../resources/etc/jre.properties | 2 ++ 3 files changed, 51 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 99ce976ffe..48e91c29c8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -69,9 +69,38 @@ pipeline { } } -stage('Build') { +stage('Build JDK 20') { +tools { +jdk "jdk_20_latest" +} +steps { +echo 'Building JDK 20' +sh 'java -version' +sh 'mvn -version' +sh 'mvn -U -B -e clean install -DskipTests' +} +} + +stage('Build JDK 17') { +tools { +jdk "jdk_17_latest" +} +steps { +echo 'Building JDK 17' +sh 'java -version' +sh 'mvn -version' +sh 'mvn -U -B -e clean install -DskipTests' +} +} + +stage('Build JDK 11') { +tools { +jdk "jdk_11_latest" +} steps { -echo 'Building' +echo 'Building JDK 11' +sh 'java -version' +sh 'mvn -version' sh 'mvn -U -B -e clean install -DskipTests -Dinvoker.skip=true -Prat' } } diff --git a/assemblies/features/base/src/main/filtered-resources/resources/etc/config.properties b/assemblies/features/base/src/main/filtered-resources/resources/etc/config.properties index 74629feaf3..1cdb141d99 100644 --- a/assemblies/features/base/src/main/filtered-resources/resources/etc/config.properties +++ b/assemblies/features/base/src/main/filtered-resources/resources/etc/config.properties @@ -125,6 +125,24 @@ equinox-capabilities= \ osgi.service;objectClass:List=org.eclipse.osgi.service.security.TrustEngine;osgi.signedcontent.trust.engine=org.eclipse.osgi, \ osgi.service;objectClass:List=org.eclipse.osgi.service.urlconversion.URLConverter;protocol:List="bundleentry,bundleresource" +eecap-21 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ + osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0", \ + osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ + osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0", \ + osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0", \ + osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0" +eecap-20 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ + osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0", \ + osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ + osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0", \ + osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0", \ + osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0" +eecap-19 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ + osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0", \ + osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ + osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0", \ + osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0", \ + osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0" eecap-18 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0", \ osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ diff --git a/assemblies/features/base/src/main/filtered-resources/resources/etc/jre.properties
[karaf] branch main updated: [#7696] Add JDK 19/20/21 support
This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/karaf.git The following commit(s) were added to refs/heads/main by this push: new f20d9c03fd [#7696] Add JDK 19/20/21 support new ef2a12142b Merge pull request #1723 from mattrpav/KARAF-7696 f20d9c03fd is described below commit f20d9c03fd35a93d5a8a2ea5e2441392062a2c53 Author: Matt Pavlovich AuthorDate: Wed Jun 14 10:11:09 2023 -0500 [#7696] Add JDK 19/20/21 support --- Jenkinsfile| 33 -- .../resources/etc/config.properties| 18 .../resources/etc/jre.properties | 2 ++ 3 files changed, 51 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 53dfbd23dc..76deecb42d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -69,9 +69,38 @@ pipeline { } } -stage('Build') { +stage('Build JDK 20') { +tools { +jdk "jdk_20_latest" +} +steps { +echo 'Building JDK 20' +sh 'java -version' +sh 'mvn -version' +sh 'mvn -U -B -e clean install -DskipTests' +} +} + +stage('Build JDK 17') { +tools { +jdk "jdk_17_latest" +} +steps { +echo 'Building JDK 17' +sh 'java -version' +sh 'mvn -version' +sh 'mvn -U -B -e clean install -DskipTests' +} +} + +stage('Build JDK 11') { +tools { +jdk "jdk_11_latest" +} steps { -echo 'Building' +echo 'Building JDK 11' +sh 'java -version' +sh 'mvn -version' sh 'mvn -U -B -e clean install -DskipTests -Dinvoker.skip=true -Prat' } } diff --git a/assemblies/features/base/src/main/filtered-resources/resources/etc/config.properties b/assemblies/features/base/src/main/filtered-resources/resources/etc/config.properties index 7a3a81b1fd..e012e02ace 100644 --- a/assemblies/features/base/src/main/filtered-resources/resources/etc/config.properties +++ b/assemblies/features/base/src/main/filtered-resources/resources/etc/config.properties @@ -125,6 +125,24 @@ equinox-capabilities= \ osgi.service;objectClass:List=org.eclipse.osgi.service.security.TrustEngine;osgi.signedcontent.trust.engine=org.eclipse.osgi, \ osgi.service;objectClass:List=org.eclipse.osgi.service.urlconversion.URLConverter;protocol:List="bundleentry,bundleresource" +eecap-21 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ + osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0", \ + osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ + osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0", \ + osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0", \ + osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0,21.0" +eecap-20 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ + osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0", \ + osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ + osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0", \ + osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0", \ + osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0,20.0" +eecap-19 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ + osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0", \ + osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ + osgi.ee; osgi.ee="JavaSE/compact1"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0", \ + osgi.ee; osgi.ee="JavaSE/compact2"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0", \ + osgi.ee; osgi.ee="JavaSE/compact3"; version:List="1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0,19.0" eecap-18 = osgi.ee; osgi.ee="OSGi/Minimum"; version:List="1.0,1.1,1.2", \ osgi.ee; osgi.ee="JavaSE"; version:List="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9.0,10.0,11.0,13.0,14.0,15.0,16.0,17.0,18.0", \ osgi.ee; osgi.ee="JRE"; version:List="1.0,1.1", \ diff --git a/assemblies/features/base/src/main/filtered-resources/resources/etc/jre.properties
[GitHub] [karaf] jbonofre merged pull request #1723: [#7696] Add JDK 19/20/21 support
jbonofre merged PR #1723: URL: https://github.com/apache/karaf/pull/1723 -- 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-unsubscr...@karaf.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[BUILD-FAILURE]: Job 'Karaf/karaf-runtime/karaf-4.3.x [karaf-4.3.x] [275]'
BUILD-FAILURE: Job 'Karaf/karaf-runtime/karaf-4.3.x [karaf-4.3.x] [275]': Check console output at "https://ci-builds.apache.org/job/Karaf/job/karaf-runtime/job/karaf-4.3.x/275/;>Karaf/karaf-runtime/karaf-4.3.x [karaf-4.3.x] [275]"
[karaf] branch main updated: [KARAF-6074] Prevent duplicate PIDs from factory PID defined in feature config
This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/karaf.git The following commit(s) were added to refs/heads/main by this push: new f5ee79652d [KARAF-6074] Prevent duplicate PIDs from factory PID defined in feature config new ee957b83af Merge pull request #1720 from grgrzybek/KARAF-6074 f5ee79652d is described below commit f5ee79652dfc3f8d8c25620abce60910b63c55da Author: Grzegorz Grzybek AuthorDate: Thu Jun 1 11:48:14 2023 +0200 [KARAF-6074] Prevent duplicate PIDs from factory PID defined in feature config --- .../karaf/features/internal/service/FeatureConfigInstaller.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/service/FeatureConfigInstaller.java b/features/core/src/main/java/org/apache/karaf/features/internal/service/FeatureConfigInstaller.java index a4e99668f6..7d530ae4e6 100644 --- a/features/core/src/main/java/org/apache/karaf/features/internal/service/FeatureConfigInstaller.java +++ b/features/core/src/main/java/org/apache/karaf/features/internal/service/FeatureConfigInstaller.java @@ -68,9 +68,7 @@ public class FeatureConfigInstaller { if (n > 0) { cid.isFactoryPid = true; cid.factoryPid = pid.substring(0, n); -if (pid.contains("~")) { -cid.name = pid.substring(n + 1); -} +cid.name = pid.substring(n + 1); } return cid; }
[GitHub] [karaf] jbonofre merged pull request #1720: [KARAF-6074] Prevent duplicate PIDs from factory PID defined in featu…
jbonofre merged PR #1720: URL: https://github.com/apache/karaf/pull/1720 -- 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-unsubscr...@karaf.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[karaf] branch karaf-4.3.x updated: [KARAF-6074] Prevent duplicate PIDs from factory PID defined in feature config
This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a commit to branch karaf-4.3.x in repository https://gitbox.apache.org/repos/asf/karaf.git The following commit(s) were added to refs/heads/karaf-4.3.x by this push: new 7343183127 [KARAF-6074] Prevent duplicate PIDs from factory PID defined in feature config 7343183127 is described below commit 73431831273b1e3383d9885ac36945126645e011 Author: Grzegorz Grzybek AuthorDate: Thu Jun 1 11:48:14 2023 +0200 [KARAF-6074] Prevent duplicate PIDs from factory PID defined in feature config (cherry picked from commit f5ee79652dfc3f8d8c25620abce60910b63c55da) --- .../karaf/features/internal/service/FeatureConfigInstaller.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/service/FeatureConfigInstaller.java b/features/core/src/main/java/org/apache/karaf/features/internal/service/FeatureConfigInstaller.java index a4e99668f6..7d530ae4e6 100644 --- a/features/core/src/main/java/org/apache/karaf/features/internal/service/FeatureConfigInstaller.java +++ b/features/core/src/main/java/org/apache/karaf/features/internal/service/FeatureConfigInstaller.java @@ -68,9 +68,7 @@ public class FeatureConfigInstaller { if (n > 0) { cid.isFactoryPid = true; cid.factoryPid = pid.substring(0, n); -if (pid.contains("~")) { -cid.name = pid.substring(n + 1); -} +cid.name = pid.substring(n + 1); } return cid; }
[BUILD-FAILURE]: Job 'Karaf/karaf-runtime/main [main] [401]'
BUILD-FAILURE: Job 'Karaf/karaf-runtime/main [main] [401]': Check console output at "https://ci-builds.apache.org/job/Karaf/job/karaf-runtime/job/main/401/;>Karaf/karaf-runtime/main [main] [401]"
[BUILD-FAILURE]: Job 'Karaf/karaf-runtime/karaf-4.3.x [karaf-4.3.x] [274]'
BUILD-FAILURE: Job 'Karaf/karaf-runtime/karaf-4.3.x [karaf-4.3.x] [274]': Check console output at "https://ci-builds.apache.org/job/Karaf/job/karaf-runtime/job/karaf-4.3.x/274/;>Karaf/karaf-runtime/karaf-4.3.x [karaf-4.3.x] [274]"
[karaf] branch karaf-4.3.x updated: [KARAF-7678] Fix ShellTable multiline clipping
This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a commit to branch karaf-4.3.x in repository https://gitbox.apache.org/repos/asf/karaf.git The following commit(s) were added to refs/heads/karaf-4.3.x by this push: new bd812bd0f9 [KARAF-7678] Fix ShellTable multiline clipping bd812bd0f9 is described below commit bd812bd0f9aab0fd3e02b76a55837276a59ddd6a Author: Ciprian Ciubotariu AuthorDate: Tue Feb 28 02:27:03 2023 +0200 [KARAF-7678] Fix ShellTable multiline clipping Account for multi-line cell contents when calculating cell width and clipping the text to maxSize. The cell contents might be either wrapped or originally split by the caller with \n characters (cherry picked from commit 78222c0ae567b5b504327cbce8cbabd0904e6edf) --- .../org/apache/karaf/shell/support/table/Col.java | 44 ++ 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/shell/core/src/main/java/org/apache/karaf/shell/support/table/Col.java b/shell/core/src/main/java/org/apache/karaf/shell/support/table/Col.java index 410de81283..442e94da11 100644 --- a/shell/core/src/main/java/org/apache/karaf/shell/support/table/Col.java +++ b/shell/core/src/main/java/org/apache/karaf/shell/support/table/Col.java @@ -21,6 +21,7 @@ import java.util.List; import java.util.function.Function; import java.util.regex.Matcher; import java.util.regex.Pattern; +import java.util.stream.Collectors; import org.apache.karaf.shell.support.ansi.SimpleAnsi; @@ -148,8 +149,14 @@ public class Col { if (fullContent.length() == 0) { return ""; } -String finalContent = cut(fullContent, getClippedSize(fullContent.length())); -updateSize(finalContent.length()); +if (wrap && size < fullContent.length()) { +// make sure splitLines will have an estimate cell size if wrap is true +updateSize(fullContent.length()); +} +List lines = splitLines(fullContent); +int maxLineSize = lines.stream().mapToInt(String::length).max().getAsInt(); // at least one line exists due to test above +updateSize(maxLineSize); // calls getClippedSize() +String finalContent = lines.stream().map(line -> cut(line, getClippedSize(line.length(.collect(Collectors.joining("\n")); return finalContent; } @@ -158,14 +165,7 @@ public class Col { } String getContent(String content) { -List lines = new ArrayList<>(Arrays.asList(content.split("\n"))); -if (wrap) { -List wrapped = new ArrayList<>(); -for (String line : lines) { -wrapped.addAll(wrap(line)); -} -lines = wrapped; -} +List lines = splitLines(content); String color = null; if(colorProvider != null) { @@ -182,17 +182,29 @@ public class Col { line = SimpleAnsi.INTENSITY_BOLD + line + SimpleAnsi.INTENSITY_NORMAL; } -if(color != null) - sb.append(color); - +if (color != null) +sb.append(color); + sb.append(line); - -if(color != null) - sb.append(SimpleAnsi.COLOR_DEFAULT); + +if (color != null) +sb.append(SimpleAnsi.COLOR_DEFAULT); } return sb.toString(); } +private List splitLines(String content) { +List lines = new ArrayList<>(Arrays.asList(content.split("\n"))); +if (wrap) { +List wrapped = new ArrayList<>(); +for (String line : lines) { +wrapped.addAll(wrap(line)); +} +lines = wrapped; +} +return lines; +} + protected String cut(String content, int size) { if (content.length() <= size) { return content;
[karaf] branch main updated: [KARAF-7678] Fix ShellTable multiline clipping
This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/karaf.git The following commit(s) were added to refs/heads/main by this push: new 78222c0ae5 [KARAF-7678] Fix ShellTable multiline clipping new 4281542e82 Merge pull request #1716 from CMoH/karaf-7678-fix-shelltable-multiline-clipping 78222c0ae5 is described below commit 78222c0ae567b5b504327cbce8cbabd0904e6edf Author: Ciprian Ciubotariu AuthorDate: Tue Feb 28 02:27:03 2023 +0200 [KARAF-7678] Fix ShellTable multiline clipping Account for multi-line cell contents when calculating cell width and clipping the text to maxSize. The cell contents might be either wrapped or originally split by the caller with \n characters --- .../org/apache/karaf/shell/support/table/Col.java | 44 ++ 1 file changed, 28 insertions(+), 16 deletions(-) diff --git a/shell/core/src/main/java/org/apache/karaf/shell/support/table/Col.java b/shell/core/src/main/java/org/apache/karaf/shell/support/table/Col.java index 410de81283..442e94da11 100644 --- a/shell/core/src/main/java/org/apache/karaf/shell/support/table/Col.java +++ b/shell/core/src/main/java/org/apache/karaf/shell/support/table/Col.java @@ -21,6 +21,7 @@ import java.util.List; import java.util.function.Function; import java.util.regex.Matcher; import java.util.regex.Pattern; +import java.util.stream.Collectors; import org.apache.karaf.shell.support.ansi.SimpleAnsi; @@ -148,8 +149,14 @@ public class Col { if (fullContent.length() == 0) { return ""; } -String finalContent = cut(fullContent, getClippedSize(fullContent.length())); -updateSize(finalContent.length()); +if (wrap && size < fullContent.length()) { +// make sure splitLines will have an estimate cell size if wrap is true +updateSize(fullContent.length()); +} +List lines = splitLines(fullContent); +int maxLineSize = lines.stream().mapToInt(String::length).max().getAsInt(); // at least one line exists due to test above +updateSize(maxLineSize); // calls getClippedSize() +String finalContent = lines.stream().map(line -> cut(line, getClippedSize(line.length(.collect(Collectors.joining("\n")); return finalContent; } @@ -158,14 +165,7 @@ public class Col { } String getContent(String content) { -List lines = new ArrayList<>(Arrays.asList(content.split("\n"))); -if (wrap) { -List wrapped = new ArrayList<>(); -for (String line : lines) { -wrapped.addAll(wrap(line)); -} -lines = wrapped; -} +List lines = splitLines(content); String color = null; if(colorProvider != null) { @@ -182,17 +182,29 @@ public class Col { line = SimpleAnsi.INTENSITY_BOLD + line + SimpleAnsi.INTENSITY_NORMAL; } -if(color != null) - sb.append(color); - +if (color != null) +sb.append(color); + sb.append(line); - -if(color != null) - sb.append(SimpleAnsi.COLOR_DEFAULT); + +if (color != null) +sb.append(SimpleAnsi.COLOR_DEFAULT); } return sb.toString(); } +private List splitLines(String content) { +List lines = new ArrayList<>(Arrays.asList(content.split("\n"))); +if (wrap) { +List wrapped = new ArrayList<>(); +for (String line : lines) { +wrapped.addAll(wrap(line)); +} +lines = wrapped; +} +return lines; +} + protected String cut(String content, int size) { if (content.length() <= size) { return content;
[GitHub] [karaf] jbonofre commented on a diff in pull request #1716: [KARAF-7678] Fix ShellTable multiline clipping
jbonofre commented on code in PR #1716: URL: https://github.com/apache/karaf/pull/1716#discussion_r1270231790 ## shell/core/src/main/java/org/apache/karaf/shell/support/table/Col.java: ## @@ -148,8 +149,14 @@ String format(Object cellData) { if (fullContent.length() == 0) { return ""; } -String finalContent = cut(fullContent, getClippedSize(fullContent.length())); -updateSize(finalContent.length()); +if (wrap && size < fullContent.length()) { +// make sure splitLines will have an estimate cell size if wrap is true +updateSize(fullContent.length()); +} +List lines = splitLines(fullContent); +int maxLineSize = lines.stream().mapToInt(String::length).max().getAsInt(); // at least one line exists due to test above +updateSize(maxLineSize); // calls getClippedSize() +String finalContent = lines.stream().map(line -> cut(line, getClippedSize(line.length(.collect(Collectors.joining("\n")); Review Comment: I would address the split line separator in another PR. Anyway I don't think it's a big deal :) -- 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-unsubscr...@karaf.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [karaf] jbonofre merged pull request #1716: [KARAF-7678] Fix ShellTable multiline clipping
jbonofre merged PR #1716: URL: https://github.com/apache/karaf/pull/1716 -- 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-unsubscr...@karaf.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[BUILD-FAILURE]: Job 'Karaf/karaf-runtime/karaf-4.3.x [karaf-4.3.x] [273]'
BUILD-FAILURE: Job 'Karaf/karaf-runtime/karaf-4.3.x [karaf-4.3.x] [273]': Check console output at "https://ci-builds.apache.org/job/Karaf/job/karaf-runtime/job/karaf-4.3.x/273/;>Karaf/karaf-runtime/karaf-4.3.x [karaf-4.3.x] [273]"
[karaf] branch karaf-4.3.x updated: [KARAF-7677] Improve failure report of karaf assembly
This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a commit to branch karaf-4.3.x in repository https://gitbox.apache.org/repos/asf/karaf.git The following commit(s) were added to refs/heads/karaf-4.3.x by this push: new e82533a10f [KARAF-7677] Improve failure report of karaf assembly e82533a10f is described below commit e82533a10ff54ccc41973bb961a422fb4237cae1 Author: Ciprian Ciubotariu AuthorDate: Tue Feb 28 01:45:19 2023 +0200 [KARAF-7677] Improve failure report of karaf assembly Log the offending bundle if a bundle refresh occurs during assembly (cherry picked from commit cc437bfc5365e158f2714a7cf80fb368d0cfc508) --- .../apache/karaf/features/internal/service/StaticInstallSupport.java| 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/service/StaticInstallSupport.java b/features/core/src/main/java/org/apache/karaf/features/internal/service/StaticInstallSupport.java index 54607d26bc..032d791f79 100644 --- a/features/core/src/main/java/org/apache/karaf/features/internal/service/StaticInstallSupport.java +++ b/features/core/src/main/java/org/apache/karaf/features/internal/service/StaticInstallSupport.java @@ -45,7 +45,7 @@ public abstract class StaticInstallSupport implements BundleInstallSupport { @Override public void updateBundle(Bundle bundle, String uri, InputStream is) throws BundleException { -System.err.println("Update bundle is not supported in the static installer"); +System.err.printf("Update bundle is not supported in the static installer: bundle %s, uri %s%n", bundle == null ? "null" : bundle.getSymbolicName(), uri); if (failOnUpdate) { throw new UnsupportedOperationException(); }
[karaf] branch main updated: [KARAF-7677] Improve failure report of karaf assembly
This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/karaf.git The following commit(s) were added to refs/heads/main by this push: new cc437bfc53 [KARAF-7677] Improve failure report of karaf assembly new f42bceed1a Merge pull request #1715 from CMoH/karaf-7677-log-assembly-failure-cause cc437bfc53 is described below commit cc437bfc5365e158f2714a7cf80fb368d0cfc508 Author: Ciprian Ciubotariu AuthorDate: Tue Feb 28 01:45:19 2023 +0200 [KARAF-7677] Improve failure report of karaf assembly Log the offending bundle if a bundle refresh occurs during assembly --- .../apache/karaf/features/internal/service/StaticInstallSupport.java| 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/service/StaticInstallSupport.java b/features/core/src/main/java/org/apache/karaf/features/internal/service/StaticInstallSupport.java index 54607d26bc..032d791f79 100644 --- a/features/core/src/main/java/org/apache/karaf/features/internal/service/StaticInstallSupport.java +++ b/features/core/src/main/java/org/apache/karaf/features/internal/service/StaticInstallSupport.java @@ -45,7 +45,7 @@ public abstract class StaticInstallSupport implements BundleInstallSupport { @Override public void updateBundle(Bundle bundle, String uri, InputStream is) throws BundleException { -System.err.println("Update bundle is not supported in the static installer"); +System.err.printf("Update bundle is not supported in the static installer: bundle %s, uri %s%n", bundle == null ? "null" : bundle.getSymbolicName(), uri); if (failOnUpdate) { throw new UnsupportedOperationException(); }
[GitHub] [karaf] jbonofre merged pull request #1715: [KARAF-7677] Improve failure report of karaf assembly
jbonofre merged PR #1715: URL: https://github.com/apache/karaf/pull/1715 -- 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-unsubscr...@karaf.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[BUILD-FAILURE]: Job 'Karaf/karaf-runtime/karaf-4.3.x [karaf-4.3.x] [272]'
BUILD-FAILURE: Job 'Karaf/karaf-runtime/karaf-4.3.x [karaf-4.3.x] [272]': Check console output at "https://ci-builds.apache.org/job/Karaf/job/karaf-runtime/job/karaf-4.3.x/272/;>Karaf/karaf-runtime/karaf-4.3.x [karaf-4.3.x] [272]"
[karaf] branch karaf-4.3.x updated: KARAF-7670 - use LATEST version in README instructions
This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a commit to branch karaf-4.3.x in repository https://gitbox.apache.org/repos/asf/karaf.git The following commit(s) were added to refs/heads/karaf-4.3.x by this push: new f9e49e346a KARAF-7670 - use LATEST version in README instructions f9e49e346a is described below commit f9e49e346a779b10a04cb3e14f0c7692e364ec59 Author: Aleksy Wróblewski AuthorDate: Mon Feb 13 22:45:50 2023 +0100 KARAF-7670 - use LATEST version in README instructions (cherry picked from commit 7192de9cca07c475468c0d7dc8dd531b4adb2452) --- examples/karaf-config-example/README.md | 2 +- examples/karaf-war-example/README.md| 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/karaf-config-example/README.md b/examples/karaf-config-example/README.md index 8161e173d0..bceb216456 100644 --- a/examples/karaf-config-example/README.md +++ b/examples/karaf-config-example/README.md @@ -55,7 +55,7 @@ mvn clean install On a running Karaf instance, register the features repository using: ``` -karaf@root()> feature:repo-add mvn:org.apache.karaf.examples/karaf-config-example-features/4.2.3-SNAPSHOT/xml +karaf@root()> feature:repo-add mvn:org.apache.karaf.examples/karaf-config-example-features/LATEST/xml ``` ## Usage diff --git a/examples/karaf-war-example/README.md b/examples/karaf-war-example/README.md index bac8bb4699..53feadb364 100644 --- a/examples/karaf-war-example/README.md +++ b/examples/karaf-war-example/README.md @@ -88,7 +88,7 @@ karaf@root()> feature:install war Then, we can directly install a war from any location, for instance: ``` -karaf@root()> bundle:install -s webbundle:mvn:org.apache.karaf.examples/karaf-war-example-webapp/4.3.0-SNAPSHOT/war?Web-ContextPath=example +karaf@root()> bundle:install -s webbundle:mvn:org.apache.karaf.examples/karaf-war-example-webapp/LATEST/war?Web-ContextPath=example ``` You can see the war deployed using `web:list` command: @@ -113,7 +113,7 @@ Then, you simply have to add this features repository and directly install the ` First, you add the features repository: ``` -karaf@root()> feature:repo-add mvn:org.apache.karaf.examples/karaf-war-example-features/4.3.0-SNAPSHOT/xml +karaf@root()> feature:repo-add mvn:org.apache.karaf.examples/karaf-war-example-features/LATEST/xml Adding feature url mvn:org.apache.karaf.examples/karaf-war-example-features/4.3.0-SNAPSHOT/xml ```
[karaf] branch main updated: KARAF-7670 - use LATEST version in README instructions
This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/karaf.git The following commit(s) were added to refs/heads/main by this push: new 7192de9cca KARAF-7670 - use LATEST version in README instructions new b49a3736b5 Merge pull request #1714 from awrb/KARAF-7670 7192de9cca is described below commit 7192de9cca07c475468c0d7dc8dd531b4adb2452 Author: Aleksy Wróblewski AuthorDate: Mon Feb 13 22:45:50 2023 +0100 KARAF-7670 - use LATEST version in README instructions --- examples/karaf-config-example/README.md | 2 +- examples/karaf-war-example/README.md| 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/karaf-config-example/README.md b/examples/karaf-config-example/README.md index 8161e173d0..bceb216456 100644 --- a/examples/karaf-config-example/README.md +++ b/examples/karaf-config-example/README.md @@ -55,7 +55,7 @@ mvn clean install On a running Karaf instance, register the features repository using: ``` -karaf@root()> feature:repo-add mvn:org.apache.karaf.examples/karaf-config-example-features/4.2.3-SNAPSHOT/xml +karaf@root()> feature:repo-add mvn:org.apache.karaf.examples/karaf-config-example-features/LATEST/xml ``` ## Usage diff --git a/examples/karaf-war-example/README.md b/examples/karaf-war-example/README.md index bac8bb4699..53feadb364 100644 --- a/examples/karaf-war-example/README.md +++ b/examples/karaf-war-example/README.md @@ -88,7 +88,7 @@ karaf@root()> feature:install war Then, we can directly install a war from any location, for instance: ``` -karaf@root()> bundle:install -s webbundle:mvn:org.apache.karaf.examples/karaf-war-example-webapp/4.3.0-SNAPSHOT/war?Web-ContextPath=example +karaf@root()> bundle:install -s webbundle:mvn:org.apache.karaf.examples/karaf-war-example-webapp/LATEST/war?Web-ContextPath=example ``` You can see the war deployed using `web:list` command: @@ -113,7 +113,7 @@ Then, you simply have to add this features repository and directly install the ` First, you add the features repository: ``` -karaf@root()> feature:repo-add mvn:org.apache.karaf.examples/karaf-war-example-features/4.3.0-SNAPSHOT/xml +karaf@root()> feature:repo-add mvn:org.apache.karaf.examples/karaf-war-example-features/LATEST/xml Adding feature url mvn:org.apache.karaf.examples/karaf-war-example-features/4.3.0-SNAPSHOT/xml ```
[GitHub] [karaf] jbonofre merged pull request #1714: KARAF-7670 - use LATEST version in README instructions
jbonofre merged PR #1714: URL: https://github.com/apache/karaf/pull/1714 -- 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-unsubscr...@karaf.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[BUILD-FAILURE]: Job 'Karaf/karaf-runtime/karaf-4.3.x [karaf-4.3.x] [271]'
BUILD-FAILURE: Job 'Karaf/karaf-runtime/karaf-4.3.x [karaf-4.3.x] [271]': Check console output at "https://ci-builds.apache.org/job/Karaf/job/karaf-runtime/job/karaf-4.3.x/271/;>Karaf/karaf-runtime/karaf-4.3.x [karaf-4.3.x] [271]"
[karaf] branch karaf-4.3.x updated: KARAF-6538 - add commands for executing groovy code
This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a commit to branch karaf-4.3.x in repository https://gitbox.apache.org/repos/asf/karaf.git The following commit(s) were added to refs/heads/karaf-4.3.x by this push: new 5f28017bd0 KARAF-6538 - add commands for executing groovy code 5f28017bd0 is described below commit 5f28017bd003277356fe98f8e60709295820b123 Author: Aleksy Wróblewski AuthorDate: Tue Feb 7 00:02:55 2023 +0100 KARAF-6538 - add commands for executing groovy code (cherry picked from commit 737eab789f4fedb36d3aafb02ef02f7eee97694d) --- .../features/specs/src/main/feature/feature.xml| 44 ++--- .../features/standard/src/main/feature/feature.xml | 4 ++ .../src/test/filtered-resources/etc/feature.xml| 4 ++ .../java/org/apache/karaf/itests/GroovyTest.java | 66 +++ .../org/apache/karaf/itests/groovy/script.groovy | 22 +++ .../developer-guide/developer-commands.adoc| 48 ++ pom.xml| 1 + shell/groovy/pom.xml | 74 ++ .../groovy/commands/ExecGroovyCodeAction.java | 69 .../groovy/commands/ExecGroovyFileAction.java | 41 .../org.apache.karaf.shell.groovy/commands | 18 ++ shell/pom.xml | 1 + 12 files changed, 370 insertions(+), 22 deletions(-) diff --git a/assemblies/features/specs/src/main/feature/feature.xml b/assemblies/features/specs/src/main/feature/feature.xml index 3f0d1c6952..b111415c69 100644 --- a/assemblies/features/specs/src/main/feature/feature.xml +++ b/assemblies/features/specs/src/main/feature/feature.xml @@ -148,29 +148,29 @@ - + spifly -mvn:org.codehaus.groovy/groovy/3.0.3 -mvn:org.codehaus.groovy/groovy-ant/3.0.3 -mvn:org.codehaus.groovy/groovy-cli-commons/3.0.3 -mvn:org.codehaus.groovy/groovy-cli-picocli/3.0.3 -mvn:org.codehaus.groovy/groovy-console/3.0.3 -mvn:org.codehaus.groovy/groovy-datetime/3.0.3 -mvn:org.codehaus.groovy/groovy-docgenerator/3.0.3 -mvn:org.codehaus.groovy/groovy-groovydoc/3.0.3 -mvn:org.codehaus.groovy/groovy-groovysh/3.0.3 -mvn:org.codehaus.groovy/groovy-jmx/3.0.3 -mvn:org.codehaus.groovy/groovy-json/3.0.3 -mvn:org.codehaus.groovy/groovy-macro/3.0.3 -mvn:org.codehaus.groovy/groovy-nio/3.0.3 -mvn:org.codehaus.groovy/groovy-servlet/3.0.3 -mvn:org.codehaus.groovy/groovy-sql/3.0.3 -mvn:org.codehaus.groovy/groovy-swing/3.0.3 -mvn:org.codehaus.groovy/groovy-templates/3.0.3 -mvn:org.codehaus.groovy/groovy-test/3.0.3 -mvn:org.codehaus.groovy/groovy-test-junit5/3.0.3 -mvn:org.codehaus.groovy/groovy-testng/3.0.3 -mvn:org.codehaus.groovy/groovy-xml/3.0.3 +mvn:org.codehaus.groovy/groovy/${groovy.version} +mvn:org.codehaus.groovy/groovy-ant/${groovy.version} + mvn:org.codehaus.groovy/groovy-cli-commons/${groovy.version} + mvn:org.codehaus.groovy/groovy-cli-picocli/${groovy.version} + mvn:org.codehaus.groovy/groovy-console/${groovy.version} + mvn:org.codehaus.groovy/groovy-datetime/${groovy.version} + mvn:org.codehaus.groovy/groovy-docgenerator/${groovy.version} + mvn:org.codehaus.groovy/groovy-groovydoc/${groovy.version} + mvn:org.codehaus.groovy/groovy-groovysh/${groovy.version} +mvn:org.codehaus.groovy/groovy-jmx/${groovy.version} +mvn:org.codehaus.groovy/groovy-json/${groovy.version} +mvn:org.codehaus.groovy/groovy-macro/${groovy.version} +mvn:org.codehaus.groovy/groovy-nio/${groovy.version} + mvn:org.codehaus.groovy/groovy-servlet/${groovy.version} +mvn:org.codehaus.groovy/groovy-sql/${groovy.version} +mvn:org.codehaus.groovy/groovy-swing/${groovy.version} + mvn:org.codehaus.groovy/groovy-templates/${groovy.version} +mvn:org.codehaus.groovy/groovy-test/${groovy.version} + mvn:org.codehaus.groovy/groovy-test-junit5/${groovy.version} + mvn:org.codehaus.groovy/groovy-testng/${groovy.version} +mvn:org.codehaus.groovy/groovy-xml/${groovy.version} diff --git a/assemblies/features/standard/src/main/feature/feature.xml b/assemblies/features/standard/src/main/feature/feature.xml index 0317bf1fa0..8c8fbe 100644 --- a/assemblies/features/standard/src/main/feature/feature.xml +++ b/assemblies/features/standard/src/main/feature/feature.xml @@ -378,6 +378,10 @@ disableEofExit = false jline mvn:org.apache.karaf.shell/org.apache.karaf.shell.core/${project.version} mvn:org.apache.karaf.shell/org.apache.karaf.shell.commands/${project.version} + +groovy +mvn:org.apache.karaf.shell/org.apache.karaf.shell.groovy/${project.version} +
[karaf] branch main updated: KARAF-6538 - add commands for executing groovy code
This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/karaf.git The following commit(s) were added to refs/heads/main by this push: new 737eab789f KARAF-6538 - add commands for executing groovy code new 62289e8909 Merge pull request #1712 from awrb/KARAF-6538 737eab789f is described below commit 737eab789f4fedb36d3aafb02ef02f7eee97694d Author: Aleksy Wróblewski AuthorDate: Tue Feb 7 00:02:55 2023 +0100 KARAF-6538 - add commands for executing groovy code --- .../features/specs/src/main/feature/feature.xml| 44 ++--- .../features/standard/src/main/feature/feature.xml | 4 ++ .../src/test/filtered-resources/etc/feature.xml| 4 ++ .../java/org/apache/karaf/itests/GroovyTest.java | 66 +++ .../org/apache/karaf/itests/groovy/script.groovy | 22 +++ .../developer-guide/developer-commands.adoc| 48 ++ pom.xml| 1 + shell/groovy/pom.xml | 74 ++ .../groovy/commands/ExecGroovyCodeAction.java | 69 .../groovy/commands/ExecGroovyFileAction.java | 41 .../org.apache.karaf.shell.groovy/commands | 18 ++ shell/pom.xml | 1 + 12 files changed, 370 insertions(+), 22 deletions(-) diff --git a/assemblies/features/specs/src/main/feature/feature.xml b/assemblies/features/specs/src/main/feature/feature.xml index 2dd39d631e..3134ad9484 100644 --- a/assemblies/features/specs/src/main/feature/feature.xml +++ b/assemblies/features/specs/src/main/feature/feature.xml @@ -150,29 +150,29 @@ - + spifly -mvn:org.codehaus.groovy/groovy/3.0.3 -mvn:org.codehaus.groovy/groovy-ant/3.0.3 -mvn:org.codehaus.groovy/groovy-cli-commons/3.0.3 -mvn:org.codehaus.groovy/groovy-cli-picocli/3.0.3 -mvn:org.codehaus.groovy/groovy-console/3.0.3 -mvn:org.codehaus.groovy/groovy-datetime/3.0.3 -mvn:org.codehaus.groovy/groovy-docgenerator/3.0.3 -mvn:org.codehaus.groovy/groovy-groovydoc/3.0.3 -mvn:org.codehaus.groovy/groovy-groovysh/3.0.3 -mvn:org.codehaus.groovy/groovy-jmx/3.0.3 -mvn:org.codehaus.groovy/groovy-json/3.0.3 -mvn:org.codehaus.groovy/groovy-macro/3.0.3 -mvn:org.codehaus.groovy/groovy-nio/3.0.3 -mvn:org.codehaus.groovy/groovy-servlet/3.0.3 -mvn:org.codehaus.groovy/groovy-sql/3.0.3 -mvn:org.codehaus.groovy/groovy-swing/3.0.3 -mvn:org.codehaus.groovy/groovy-templates/3.0.3 -mvn:org.codehaus.groovy/groovy-test/3.0.3 -mvn:org.codehaus.groovy/groovy-test-junit5/3.0.3 -mvn:org.codehaus.groovy/groovy-testng/3.0.3 -mvn:org.codehaus.groovy/groovy-xml/3.0.3 +mvn:org.codehaus.groovy/groovy/${groovy.version} +mvn:org.codehaus.groovy/groovy-ant/${groovy.version} + mvn:org.codehaus.groovy/groovy-cli-commons/${groovy.version} + mvn:org.codehaus.groovy/groovy-cli-picocli/${groovy.version} + mvn:org.codehaus.groovy/groovy-console/${groovy.version} + mvn:org.codehaus.groovy/groovy-datetime/${groovy.version} + mvn:org.codehaus.groovy/groovy-docgenerator/${groovy.version} + mvn:org.codehaus.groovy/groovy-groovydoc/${groovy.version} + mvn:org.codehaus.groovy/groovy-groovysh/${groovy.version} +mvn:org.codehaus.groovy/groovy-jmx/${groovy.version} +mvn:org.codehaus.groovy/groovy-json/${groovy.version} +mvn:org.codehaus.groovy/groovy-macro/${groovy.version} +mvn:org.codehaus.groovy/groovy-nio/${groovy.version} + mvn:org.codehaus.groovy/groovy-servlet/${groovy.version} +mvn:org.codehaus.groovy/groovy-sql/${groovy.version} +mvn:org.codehaus.groovy/groovy-swing/${groovy.version} + mvn:org.codehaus.groovy/groovy-templates/${groovy.version} +mvn:org.codehaus.groovy/groovy-test/${groovy.version} + mvn:org.codehaus.groovy/groovy-test-junit5/${groovy.version} + mvn:org.codehaus.groovy/groovy-testng/${groovy.version} +mvn:org.codehaus.groovy/groovy-xml/${groovy.version} diff --git a/assemblies/features/standard/src/main/feature/feature.xml b/assemblies/features/standard/src/main/feature/feature.xml index 0d07990190..512cdd0ada 100644 --- a/assemblies/features/standard/src/main/feature/feature.xml +++ b/assemblies/features/standard/src/main/feature/feature.xml @@ -379,6 +379,10 @@ disableEofExit = false jline mvn:org.apache.karaf.shell/org.apache.karaf.shell.core/${project.version} mvn:org.apache.karaf.shell/org.apache.karaf.shell.commands/${project.version} + +groovy +mvn:org.apache.karaf.shell/org.apache.karaf.shell.groovy/${project.version} + diff --git
[GitHub] [karaf] jbonofre merged pull request #1712: KARAF-6538 - add commands for executing groovy code
jbonofre merged PR #1712: URL: https://github.com/apache/karaf/pull/1712 -- 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-unsubscr...@karaf.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[karaf] branch karaf-4.3.x updated: KARAF-5421 - add user friendly error when installing non OSGi bundle via bundle:install
This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a commit to branch karaf-4.3.x in repository https://gitbox.apache.org/repos/asf/karaf.git The following commit(s) were added to refs/heads/karaf-4.3.x by this push: new 3708a97672 KARAF-5421 - add user friendly error when installing non OSGi bundle via bundle:install 3708a97672 is described below commit 3708a97672e898455a1914b4812a02b04974c8e9 Author: Aleksy Wróblewski AuthorDate: Tue Feb 7 22:50:39 2023 +0100 KARAF-5421 - add user friendly error when installing non OSGi bundle via bundle:install (cherry picked from commit a310779708e7df59bd9be1026411bce4f918966f) --- .../org/apache/karaf/bundle/command/Install.java | 22 -- .../java/org/apache/karaf/itests/BundleTest.java | 12 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/bundle/core/src/main/java/org/apache/karaf/bundle/command/Install.java b/bundle/core/src/main/java/org/apache/karaf/bundle/command/Install.java index 1a8701faeb..7af1474c59 100644 --- a/bundle/core/src/main/java/org/apache/karaf/bundle/command/Install.java +++ b/bundle/core/src/main/java/org/apache/karaf/bundle/command/Install.java @@ -49,13 +49,13 @@ public class Install implements Action { @Option(name = "-l", aliases={"--start-level"}, description="Sets the start level of the bundles", required = false, multiValued = false) Integer level; - + @Option(name = "--force", aliases = {"-f"}, description = "Forces the command to execute", required = false, multiValued = false) boolean force; @Option(name = "--r3-bundles", description = "Allow OSGi R3 bundles") boolean allowR3; - + @Reference Session session; @@ -82,15 +82,26 @@ public class Install implements Action { 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) { +error = "The provided URL is not a valid OSGi bundle. Consider using Karaf " ++ "wrap feature, e.g. `install wrap:mvn:groupId/artifactId/version`. See more here:" ++ " https://karaf.apache.org/manual/latest/#_wrap_deployer;; +} else { +error = "OSGi R3 bundle not supported"; +} + bundle.uninstall(); -throw new BundleException("OSGi R3 bundle not supported"); +throw new BundleException(error); } } bundles.add(bundle); @@ -118,7 +129,7 @@ public class Install implements Action { } } } - + // print the installed bundles if (bundles.size() == 1) { System.out.println("Bundle ID: " + bundles.get(0).getBundleId()); @@ -131,5 +142,4 @@ public class Install implements Action { MultiException.throwIf("Error installing bundles", exceptions); return null; } - } diff --git a/itests/test/src/test/java/org/apache/karaf/itests/BundleTest.java b/itests/test/src/test/java/org/apache/karaf/itests/BundleTest.java index 529efc6fa0..9e96a19295 100644 --- a/itests/test/src/test/java/org/apache/karaf/itests/BundleTest.java +++ b/itests/test/src/test/java/org/apache/karaf/itests/BundleTest.java @@ -18,6 +18,7 @@ package org.apache.karaf.itests; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; import javax.management.MBeanServer; import javax.management.ObjectName; @@ -122,6 +123,17 @@ public class BundleTest extends BaseTest { assertBundleNotInstalled("org.apache.servicemix.bundles.commons-lang"); } +@Test +public void installNonOsgiBundle() throws Exception { +try { +executeCommand("bundle:install mvn:junit/junit/4.13.2", ADMIN_ROLES); +fail(); +} catch (Exception e) { +assertContains("The provided URL is not a valid OSGi bundle." ++ " Consider using Karaf wrap feature", e.getMessage()); +} +} + @Test public void showTreeCommand() throws Exception { String
[karaf] branch main updated: KARAF-5421 - add user friendly error when installing non OSGi bundle via bundle:install
This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/karaf.git The following commit(s) were added to refs/heads/main by this push: new a310779708 KARAF-5421 - add user friendly error when installing non OSGi bundle via bundle:install new df7ac38397 Merge pull request #1713 from awrb/KARAF-5421 a310779708 is described below commit a310779708e7df59bd9be1026411bce4f918966f Author: Aleksy Wróblewski AuthorDate: Tue Feb 7 22:50:39 2023 +0100 KARAF-5421 - add user friendly error when installing non OSGi bundle via bundle:install --- .../org/apache/karaf/bundle/command/Install.java | 22 -- .../java/org/apache/karaf/itests/BundleTest.java | 12 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/bundle/core/src/main/java/org/apache/karaf/bundle/command/Install.java b/bundle/core/src/main/java/org/apache/karaf/bundle/command/Install.java index 1a8701faeb..7af1474c59 100644 --- a/bundle/core/src/main/java/org/apache/karaf/bundle/command/Install.java +++ b/bundle/core/src/main/java/org/apache/karaf/bundle/command/Install.java @@ -49,13 +49,13 @@ public class Install implements Action { @Option(name = "-l", aliases={"--start-level"}, description="Sets the start level of the bundles", required = false, multiValued = false) Integer level; - + @Option(name = "--force", aliases = {"-f"}, description = "Forces the command to execute", required = false, multiValued = false) boolean force; @Option(name = "--r3-bundles", description = "Allow OSGi R3 bundles") boolean allowR3; - + @Reference Session session; @@ -82,15 +82,26 @@ public class Install implements Action { 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) { +error = "The provided URL is not a valid OSGi bundle. Consider using Karaf " ++ "wrap feature, e.g. `install wrap:mvn:groupId/artifactId/version`. See more here:" ++ " https://karaf.apache.org/manual/latest/#_wrap_deployer;; +} else { +error = "OSGi R3 bundle not supported"; +} + bundle.uninstall(); -throw new BundleException("OSGi R3 bundle not supported"); +throw new BundleException(error); } } bundles.add(bundle); @@ -118,7 +129,7 @@ public class Install implements Action { } } } - + // print the installed bundles if (bundles.size() == 1) { System.out.println("Bundle ID: " + bundles.get(0).getBundleId()); @@ -131,5 +142,4 @@ public class Install implements Action { MultiException.throwIf("Error installing bundles", exceptions); return null; } - } diff --git a/itests/test/src/test/java/org/apache/karaf/itests/BundleTest.java b/itests/test/src/test/java/org/apache/karaf/itests/BundleTest.java index 529efc6fa0..9e96a19295 100644 --- a/itests/test/src/test/java/org/apache/karaf/itests/BundleTest.java +++ b/itests/test/src/test/java/org/apache/karaf/itests/BundleTest.java @@ -18,6 +18,7 @@ package org.apache.karaf.itests; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; import javax.management.MBeanServer; import javax.management.ObjectName; @@ -122,6 +123,17 @@ public class BundleTest extends BaseTest { assertBundleNotInstalled("org.apache.servicemix.bundles.commons-lang"); } +@Test +public void installNonOsgiBundle() throws Exception { +try { +executeCommand("bundle:install mvn:junit/junit/4.13.2", ADMIN_ROLES); +fail(); +} catch (Exception e) { +assertContains("The provided URL is not a valid OSGi bundle." ++ " Consider using Karaf wrap feature", e.getMessage()); +} +} + @Test public void showTreeCommand() throws Exception { String bundleTreeOutput =
[GitHub] [karaf] jbonofre merged pull request #1713: KARAF-5421 - add user friendly error when installing non OSGi bundle …
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-unsubscr...@karaf.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[GitHub] [karaf] jbonofre commented on pull request #1729: KARAF-7713 - Update SSHD to 2.10.0
jbonofre commented on PR #1729: URL: https://github.com/apache/karaf/pull/1729#issuecomment-1644985397 I will merge manually to fix the commit message (using the right Jira ID). -- 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-unsubscr...@karaf.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org
[karaf-jclouds] branch dependabot/maven/org.codehaus.groovy-groovy-2.4.21 created (now 35a9272)
This is an automated email from the ASF dual-hosted git repository. github-bot pushed a change to branch dependabot/maven/org.codehaus.groovy-groovy-2.4.21 in repository https://gitbox.apache.org/repos/asf/karaf-jclouds.git at 35a9272 Bump org.codehaus.groovy:groovy from 2.4.4 to 2.4.21 No new revisions were added by this update.
[karaf-jclouds] branch dependabot/maven/junit-junit-4.13.1 created (now fd3b134)
This is an automated email from the ASF dual-hosted git repository. github-bot pushed a change to branch dependabot/maven/junit-junit-4.13.1 in repository https://gitbox.apache.org/repos/asf/karaf-jclouds.git at fd3b134 Bump junit:junit from 4.8.2 to 4.13.1 No new revisions were added by this update.
[karaf-jclouds] branch dependabot/maven/org.bouncycastle-bcprov-ext-jdk15on-1.67 created (now d451c9d)
This is an automated email from the ASF dual-hosted git repository. github-bot pushed a change to branch dependabot/maven/org.bouncycastle-bcprov-ext-jdk15on-1.67 in repository https://gitbox.apache.org/repos/asf/karaf-jclouds.git at d451c9d Bump org.bouncycastle:bcprov-ext-jdk15on from 1.51 to 1.67 No new revisions were added by this update.
[GitHub] [karaf] jbonofre commented on pull request #1729: KARAF-7713 - Update SSHD to 2.10.0
jbonofre commented on PR #1729: URL: https://github.com/apache/karaf/pull/1729#issuecomment-1643301086 @coheigea no, no problem ! Thanks ! -- 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-unsubscr...@karaf.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org