Pack of dependency updates
- eclipse parent 1.0.7
- OSGI and Felix to latest
- excluded scr, promise, function, cmpn
- hibernate-validator from 7 to 8
- jline from 2.14.5 to 3.21.0
Signed-off-by: David Matějček <dmatej@seznam.cz>
diff --git a/appserver/extras/embedded/common/bootstrap/pom.xml b/appserver/extras/embedded/common/bootstrap/pom.xml
index 5e07ddd..0dd36c7 100644
--- a/appserver/extras/embedded/common/bootstrap/pom.xml
+++ b/appserver/extras/embedded/common/bootstrap/pom.xml
@@ -78,11 +78,6 @@
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.osgi</groupId>
- <artifactId>osgi.cmpn</artifactId>
- <scope>provided</scope>
- </dependency>
- <dependency>
<groupId>org.glassfish.main.core</groupId>
<artifactId>glassfish</artifactId>
<version>${project.version}</version>
diff --git a/appserver/featuresets/debug/pom.xml b/appserver/featuresets/debug/pom.xml
index c16799d..03e577a 100644
--- a/appserver/featuresets/debug/pom.xml
+++ b/appserver/featuresets/debug/pom.xml
@@ -47,22 +47,22 @@
<dependencies>
<dependency>
<groupId>org.osgi</groupId>
+ <artifactId>osgi.core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
<artifactId>org.osgi.service.resolver</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.resolver</artifactId>
- <version>2.0.4</version>
</dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.framework</artifactId>
- <version>7.0.3</version>
</dependency>
-
-
-
+
<dependency>
<groupId>org.glassfish.main.featuresets</groupId>
<artifactId>glassfish</artifactId>
diff --git a/appserver/osgi-platforms/felix-webconsole-extension/pom.xml b/appserver/osgi-platforms/felix-webconsole-extension/pom.xml
index e9134f5..a135cf2 100644
--- a/appserver/osgi-platforms/felix-webconsole-extension/pom.xml
+++ b/appserver/osgi-platforms/felix-webconsole-extension/pom.xml
@@ -55,18 +55,17 @@
<dependencies>
<dependency>
- <groupId>org.osgi</groupId>
- <artifactId>osgi.core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>osgi.cmpn</artifactId>
- </dependency>
- <dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.webconsole</artifactId>
</dependency>
- <!-- TangYong's contribution towards Glassfish-12975 begins -->
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>osgi.enterprise</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>osgi.core</artifactId>
+ </dependency>
<dependency>
<groupId>org.glassfish.main.security</groupId>
<artifactId>security-services</artifactId>
@@ -77,6 +76,5 @@
<artifactId>simple-glassfish-api</artifactId>
<version>${project.version}</version>
</dependency>
- <!-- TangYong's contribution towards Glassfish-12975 ends -->
</dependencies>
</project>
diff --git a/appserver/osgi-platforms/felix-webconsole-extension/src/main/java/org/glassfish/osgi/felixwebconsoleextension/FelixWebConsoleExtensionActivator.java b/appserver/osgi-platforms/felix-webconsole-extension/src/main/java/org/glassfish/osgi/felixwebconsoleextension/FelixWebConsoleExtensionActivator.java
index be9da19..4307b1f 100644
--- a/appserver/osgi-platforms/felix-webconsole-extension/src/main/java/org/glassfish/osgi/felixwebconsoleextension/FelixWebConsoleExtensionActivator.java
+++ b/appserver/osgi-platforms/felix-webconsole-extension/src/main/java/org/glassfish/osgi/felixwebconsoleextension/FelixWebConsoleExtensionActivator.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -16,18 +17,21 @@
package org.glassfish.osgi.felixwebconsoleextension;
-import org.apache.felix.webconsole.BrandingPlugin;
-import org.apache.felix.webconsole.WebConsoleSecurityProvider;
-import org.osgi.framework.*;
-import org.osgi.service.cm.ConfigurationAdmin;
-import org.osgi.util.tracker.ServiceTracker;
-
import java.io.IOException;
import java.util.Dictionary;
import java.util.Hashtable;
import java.util.logging.Level;
import java.util.logging.Logger;
+import org.apache.felix.webconsole.BrandingPlugin;
+import org.apache.felix.webconsole.WebConsoleSecurityProvider;
+import org.osgi.framework.BundleActivator;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.cm.ConfigurationAdmin;
+import org.osgi.util.tracker.ServiceTracker;
+
/**
*
* This activator servers following purposes:
@@ -41,7 +45,7 @@
*/
public class FelixWebConsoleExtensionActivator implements BundleActivator {
- private Logger logger = Logger.getLogger(getClass().getPackage().getName());
+ private final Logger logger = Logger.getLogger(getClass().getPackage().getName());
private BundleContext context;
private static final String WEBCONSOLE_PID = "org.apache.felix.webconsole.internal.servlet.OsgiManager";
private static final String PROP_HTTP_SERVICE_SELECTOR = "http.service.filter";
diff --git a/docs/pom.xml b/docs/pom.xml
index dc50857..92ec0a6 100644
--- a/docs/pom.xml
+++ b/docs/pom.xml
@@ -22,7 +22,7 @@
<parent>
<groupId>org.eclipse.ee4j</groupId>
<artifactId>project</artifactId>
- <version>1.0.6</version>
+ <version>1.0.7</version>
<relativePath />
</parent>
<version>7.0.0-SNAPSHOT</version>
diff --git a/nucleus/common/common-util/pom.xml b/nucleus/common/common-util/pom.xml
index 7e9bcd0..8152ae8 100755
--- a/nucleus/common/common-util/pom.xml
+++ b/nucleus/common/common-util/pom.xml
@@ -63,13 +63,11 @@
<artifactId>logging-annotation-processor</artifactId>
<optional>true</optional>
</dependency>
- <!-- Needed to have a bundle activator to set up a different serialization policy -->
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.core</artifactId>
<scope>provided</scope>
</dependency>
- <!-- Needed to have a bundle activator to set up a different serialization policy -->
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.enterprise</artifactId>
diff --git a/nucleus/core/bootstrap/pom.xml b/nucleus/core/bootstrap/pom.xml
index 670fde6..139847a 100755
--- a/nucleus/core/bootstrap/pom.xml
+++ b/nucleus/core/bootstrap/pom.xml
@@ -63,11 +63,6 @@
<artifactId>osgi.core</artifactId>
<scope>provided</scope>
</dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>osgi.cmpn</artifactId>
- <scope>provided</scope>
- </dependency>
<!-- Although we package simple-glassfish-api bundle's content in glassfish.jar, in standalone mode, we have to create
a launcher classloader that has the launching APIs and OSGi APIs in same level. SO, we need this jar to be part of distribution.
diff --git a/nucleus/core/kernel/osgi.bundle b/nucleus/core/kernel/osgi.bundle
index baa3906..8eee3be 100644
--- a/nucleus/core/kernel/osgi.bundle
+++ b/nucleus/core/kernel/osgi.bundle
@@ -36,5 +36,5 @@
Import-Package: \
com.sun.enterprise.server.logging.*; resolution:=optional, \
org.jvnet.tiger_types;version="${project.version}", \
- org.hibernate.validator.*;resolution:=optional;version="[7.0.0,8.0.0)", \
+ org.hibernate.validator.*;resolution:=optional;version="[8,9)", \
*
diff --git a/nucleus/distributions/nucleus-common/src/main/resources/config/osgi.properties b/nucleus/distributions/nucleus-common/src/main/resources/config/osgi.properties
index 094dc07..0660793 100755
--- a/nucleus/distributions/nucleus-common/src/main/resources/config/osgi.properties
+++ b/nucleus/distributions/nucleus-common/src/main/resources/config/osgi.properties
@@ -1,4 +1,5 @@
#
+# Copyright (c) 2022 Contributors to the Eclipse Foundation
# Copyright (c) 1997-2021 Oracle and/or its affiliates. All rights reserved.
# Copyright 2004 The Apache Software Foundation
#
@@ -18,18 +19,12 @@
# limitations under the License.
#
-
-
-#
-# Framework config properties.
-#
-
# Packages exported by system bundle when framework is Felix.
# Unlike Equinox, Felix requires us to list all packages from felix.jar
# while using org.osgi.framework.system.packages property.
Felix.system.packages=\
- org.osgi.dto; version=1.1, \
- org.osgi.framework; version=1.9, \
+ org.osgi.dto; version=1.1.1, \
+ org.osgi.framework; version=1.10, \
org.osgi.framework.dto; version=1.8, \
org.osgi.framework.hooks.bundle; version=1.1, \
org.osgi.framework.hooks.resolver; version=1.0, \
@@ -41,13 +36,13 @@
org.osgi.framework.startlevel.dto; version=1.0, \
org.osgi.framework.wiring; version=1.2, \
org.osgi.framework.wiring.dto; version=1.3, \
- org.osgi.resource; version=1.0, \
- org.osgi.resource.dto; version=1.0, \
- org.osgi.service.packageadmin; version=1.2, \
- org.osgi.service.resolver; version=1.1, \
- org.osgi.service.startlevel; version=1.1, \
- org.osgi.service.url; version=1.0, \
- org.osgi.util.tracker; version=1.5.2, \
+ org.osgi.resource; version=1.0.1, \
+ org.osgi.resource.dto; version=1.0.1, \
+ org.osgi.service.packageadmin; version=1.2.1, \
+ org.osgi.service.resolver; version=1.1.1, \
+ org.osgi.service.startlevel; version=1.1.1, \
+ org.osgi.service.url; version=1.0.1, \
+ org.osgi.util.tracker; version=1.5.3, \
${extra-system-packages}
@@ -548,38 +543,39 @@
# If we don't set this, when we run our tests in embedded mode, gogo shell stops the framework after running the login command.
gosh.args=--nointeractive
-# New-style generic execution environment capabilities.
-#fix for GLASSFISH-21236
-org.osgi.framework.system.capabilities= \
- ${eecap-${java.specification.version}}
- #we are not adding eecap entries upto 1.7 as GF is supported for JDK>1.7 (?)
-eecap-21= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
+# Generic execution environment capabilities.
+org.osgi.framework.system.capabilities=${eecap-${java.vm.specification.version}}
+
+eecap-21= \
+ osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9,10,11,12,13,14,15,16,17,18,19,20,21"
-eecap-20= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
+eecap-20= \
+ osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9,10,11,12,13,14,15,16,17,18,19,20"
-eecap-19= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
- osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9,10,11,12,13,14,15,16,17,18,19"
-eecap-18= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
- osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9,10,11,12,13,14,15,16,17,18"
-eecap-17= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
+eecap-19= \
+ osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
+ osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9,10,11,12,13,14,15,16,17,18,19",
+eecap-18= \
+ osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
+ osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9,10,11,12,13,14,15,16,17,18",
+eecap-17= \
+ osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9,10,11,12,13,14,15,16,17"
-eecap-16= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
+eecap-16= \
+ osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9,10,11,12,13,14,15,16"
-eecap-15= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
+eecap-15= \
+ osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9,10,11,12,13,14,15"
-eecap-14= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
+eecap-14= \
+ osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9,10,11,12,13,14"
-eecap-13= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
+eecap-13= \
+ osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9,10,11,12,13"
-eecap-12= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
+eecap-12= \
+ osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9,10,11,12"
-eecap-11= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
+eecap-11= \
+ osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9,10,11"
-eecap-10= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
- osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9,10"
-eecap-9= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
- osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,9"
-eecap-1.8= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
- osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8"
-eecap-1.7= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
- osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7"
diff --git a/nucleus/distributions/nucleus/src/main/assembly/nucleus-new.xml b/nucleus/distributions/nucleus/src/main/assembly/nucleus-new.xml
index 56cf120..b64516f 100644
--- a/nucleus/distributions/nucleus/src/main/assembly/nucleus-new.xml
+++ b/nucleus/distributions/nucleus/src/main/assembly/nucleus-new.xml
@@ -141,6 +141,8 @@
<exclude>org.apache.felix.gogo.runtime.jar</exclude>
<exclude>org.apache.felix.gogo.shell.jar</exclude>
<exclude>org.apache.felix.scr.jar</exclude>
+ <exclude>org.osgi.util.function.jar</exclude>
+ <exclude>org.osgi.util.promise.jar</exclude>
<exclude>grizzly-npn-api.jar</exclude>
<exclude>felix.jar</exclude>
<exclude>nucleus-domain.jar</exclude>
diff --git a/nucleus/featuresets/atomic/pom.xml b/nucleus/featuresets/atomic/pom.xml
index 5529b72..08802e3 100644
--- a/nucleus/featuresets/atomic/pom.xml
+++ b/nucleus/featuresets/atomic/pom.xml
@@ -86,7 +86,7 @@
</exclusion>
</exclusions>
</dependency>
- <!-- We install fileinstall bundle which monitors modules dir and autodeploy dir for addition/removal/updation of
+ <!-- We install fileinstall bundle which monitors modules dir and autodeploy dir for addition/removal/updation of
bundles -->
<dependency>
<groupId>org.apache.felix</groupId>
@@ -109,25 +109,6 @@
</exclusion>
</exclusions>
</dependency>
- <!-- Felix SCR always needs to be deployed as 3 bundles since 2.0.12 -->
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.scr</artifactId>
- <exclusions>
- <exclusion>
- <groupId>*</groupId>
- <artifactId>*</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.util.promise</artifactId>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.util.function</artifactId>
- </dependency>
<dependency>
<groupId>org.glassfish.main.osgi-platforms</groupId>
<artifactId>osgi-cli-remote</artifactId>
diff --git a/nucleus/hk2/hk2-config/pom.xml b/nucleus/hk2/hk2-config/pom.xml
index 25062c6..c9ff368 100644
--- a/nucleus/hk2/hk2-config/pom.xml
+++ b/nucleus/hk2/hk2-config/pom.xml
@@ -118,7 +118,7 @@
<instructions>
<Import-Package>
jakarta.validation.*;resolution:=optional;version="${jakarta.validation-api.version}",
- org.hibernate.validator.*;resolution:=optional;version="[7.0.0,8.0.0)",
+ org.hibernate.validator.*;resolution:=optional;version="[8.0.0,9.0.0)",
org.jvnet.tiger_types;version=${project.version},
*
</Import-Package>
diff --git a/nucleus/osgi-platforms/osgi-cli-interactive/pom.xml b/nucleus/osgi-platforms/osgi-cli-interactive/pom.xml
index 92468bc..90972cc 100644
--- a/nucleus/osgi-platforms/osgi-cli-interactive/pom.xml
+++ b/nucleus/osgi-platforms/osgi-cli-interactive/pom.xml
@@ -49,7 +49,7 @@
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>jline</groupId>
+ <groupId>org.jline</groupId>
<artifactId>jline</artifactId>
<scope>provided</scope>
<optional>true</optional>
@@ -71,7 +71,7 @@
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
<artifactItems>
<artifactItem>
- <groupId>jline</groupId>
+ <groupId>org.jline</groupId>
<artifactId>jline</artifactId>
<overWrite>true</overWrite>
</artifactItem>
diff --git a/nucleus/osgi-platforms/osgi-cli-interactive/src/main/java/org/glassfish/osgi/cli/interactive/LocalOSGiShellCommand.java b/nucleus/osgi-platforms/osgi-cli-interactive/src/main/java/org/glassfish/osgi/cli/interactive/LocalOSGiShellCommand.java
index d799c03..2830c98 100644
--- a/nucleus/osgi-platforms/osgi-cli-interactive/src/main/java/org/glassfish/osgi/cli/interactive/LocalOSGiShellCommand.java
+++ b/nucleus/osgi-platforms/osgi-cli-interactive/src/main/java/org/glassfish/osgi/cli/interactive/LocalOSGiShellCommand.java
@@ -1,4 +1,5 @@
/*
+ * Copyright (c) 2022 Contributors to the Eclipse Foundation
* Copyright (c) 2012, 2018 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
@@ -25,6 +26,9 @@
import com.sun.enterprise.admin.cli.remote.RemoteCLICommand;
import com.sun.enterprise.admin.util.CommandModelData;
import com.sun.enterprise.universal.i18n.LocalStringsImpl;
+
+import jakarta.inject.Inject;
+
import java.io.File;
import java.io.FileDescriptor;
import java.io.FileInputStream;
@@ -35,11 +39,7 @@
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
-import jakarta.inject.Inject;
-import jline.console.ConsoleReader;
-import jline.console.completer.Completer;
-import jline.console.completer.NullCompleter;
-import jline.console.completer.StringsCompleter;
+
import org.glassfish.api.I18n;
import org.glassfish.api.Param;
import org.glassfish.api.admin.CommandException;
@@ -52,6 +52,13 @@
import org.glassfish.hk2.api.PerLookup;
import org.glassfish.hk2.api.ServiceLocator;
import org.glassfish.hk2.utilities.BuilderHelper;
+import org.jline.reader.Completer;
+import org.jline.reader.LineReader;
+import org.jline.reader.LineReaderBuilder;
+import org.jline.reader.impl.completer.NullCompleter;
+import org.jline.reader.impl.completer.StringsCompleter;
+import org.jline.terminal.Terminal;
+import org.jline.terminal.TerminalBuilder;
import org.jvnet.hk2.annotations.Service;
/**
@@ -75,6 +82,7 @@
protected static final String SESSION_OPTION_EXECUTE = "execute";
protected static final String SESSION_OPTION_START = "new";
protected static final String SESSION_OPTION_STOP = "stop";
+ private static final LocalStringsImpl STRINGS = new LocalStringsImpl(MultimodeCommand.class);
@Inject
private ServiceLocator locator;
@@ -88,33 +96,33 @@
@Param(name = "printprompt", optional = true)
private Boolean printPromptOpt;
- private boolean printPrompt;
-
@Param(optional = true)
private String encoding;
- private boolean echo; // saved echo flag
- private RemoteCLICommand cmd; // the remote sub-command
+ private boolean echo;
+ private RemoteCLICommand cmd;
private String shellType;
- // re-using existing strings...
- private static final LocalStringsImpl strings =
- new LocalStringsImpl(MultimodeCommand.class);
protected String[] enhanceForTarget(String[] args) {
- if(instance != null) {
- String[] targetArgs = new String[args.length + 2];
- targetArgs[1] = "--instance";
- targetArgs[2] = instance;
- System.arraycopy(args, 0, targetArgs, 0, 1);
- System.arraycopy(args, 1, targetArgs, 3, args.length - 1);
- args = targetArgs;
+ if (instance == null) {
+ return null;
}
- return args;
+ String[] targetArgs = new String[args.length + 2];
+ targetArgs[1] = "--instance";
+ targetArgs[2] = instance;
+ System.arraycopy(args, 0, targetArgs, 0, 1);
+ System.arraycopy(args, 1, targetArgs, 3, args.length - 1);
+ return targetArgs;
}
protected String[] prepareArguments(String sessionId, String[] args) {
- if(sessionId != null) {
+ if (sessionId == null) {
+ String[] osgiArgs = new String[args.length + 1];
+ osgiArgs[0] = REMOTE_COMMAND;
+ System.arraycopy(args, 0, osgiArgs, 1, args.length);
+ args = osgiArgs;
+ } else {
// attach command to remote session...
String[] sessionArgs = new String[args.length + 5];
sessionArgs[0] = REMOTE_COMMAND;
@@ -124,37 +132,24 @@
sessionArgs[4] = sessionId;
System.arraycopy(args, 0, sessionArgs, 5, args.length);
args = sessionArgs;
- } else {
- String[] osgiArgs = new String[args.length + 1];
- osgiArgs[0] = REMOTE_COMMAND;
- System.arraycopy(args, 0, osgiArgs, 1, args.length);
- args = osgiArgs;
}
return args;
}
protected String startSession() throws CommandException {
- String sessionId = null;
- if("gogo".equals(shellType)) {
- // start a remote session...
- String[] args = {REMOTE_COMMAND, SESSION_OPTION,
- SESSION_OPTION_START};
- args = enhanceForTarget(args);
- sessionId = cmd.executeAndReturnOutput(args).trim();
+ if (!"gogo".equals(shellType)) {
+ return null;
}
- return sessionId;
+ String[] args = {REMOTE_COMMAND, SESSION_OPTION, SESSION_OPTION_START};
+ return cmd.executeAndReturnOutput(enhanceForTarget(args)).trim();
}
protected int stopSession(String sessionId) throws CommandException {
- int rc = 0;
- if(sessionId != null) {
- // stop the remote session...
- String[] args = {REMOTE_COMMAND, SESSION_OPTION,
- SESSION_OPTION_STOP, SESSIONID_OPTION, sessionId};
- args = enhanceForTarget(args);
- rc = cmd.execute(args);
+ if (sessionId == null) {
+ return 0;
}
- return rc;
+ String[] args = {REMOTE_COMMAND, SESSION_OPTION, SESSION_OPTION_STOP, SESSIONID_OPTION, sessionId};
+ return cmd.execute(enhanceForTarget(args));
}
/**
@@ -164,18 +159,10 @@
* the environment.
*/
@Override
- protected void validate()
- throws CommandException, CommandValidationException {
- if (printPromptOpt != null) {
- printPrompt = printPromptOpt.booleanValue();
- } else {
- printPrompt = programOpts.isInteractive();
- }
- /*
- * Save value of --echo because CLICommand will reset it
- * before calling our executeCommand method but we want it
- * to also apply to all commands in multimode.
- */
+ protected void validate() throws CommandException, CommandValidationException {
+ // Save value of --echo because CLICommand will reset it
+ // before calling our executeCommand method but we want it
+ // to also apply to all commands in multimode.
echo = programOpts.isEcho();
}
@@ -186,7 +173,7 @@
@Override
protected Collection<ParamModel> usageOptions() {
Collection<ParamModel> opts = commandModel.getParameters();
- Set<ParamModel> uopts = new LinkedHashSet<ParamModel>();
+ Set<ParamModel> uopts = new LinkedHashSet<>();
ParamModel p = new CommandModelData.ParamModelData("printprompt",
boolean.class, true,
Boolean.toString(programOpts.isInteractive()));
@@ -201,76 +188,59 @@
}
@Override
- protected int executeCommand()
- throws CommandException, CommandValidationException {
- ConsoleReader reader = null;
-
- if(cmd == null) {
+ protected int executeCommand() throws CommandException, CommandValidationException {
+ if (cmd == null) {
throw new CommandException("Remote command 'osgi' is not available.");
}
-
programOpts.setEcho(echo); // restore echo flag, saved in validate
- try {
if (encoding != null) {
// see Configuration.getEncoding()...
System.setProperty("input.encoding", encoding);
}
-
- String[] args = new String[] {REMOTE_COMMAND,
- "asadmin-osgi-shell"};
- args = enhanceForTarget(args);
+ final String[] args = enhanceForTarget(new String[] {REMOTE_COMMAND, "asadmin-osgi-shell"});
shellType = cmd.executeAndReturnOutput(args).trim();
-
- if (file == null) {
- System.out.println(strings.get("multimodeIntro"));
- reader = new ConsoleReader(REMOTE_COMMAND,
- new FileInputStream(FileDescriptor.in), System.out,
- null);
- } else {
- printPrompt = false;
- if (!file.canRead()) {
- throw new CommandException("File: " + file
- + " can not be read");
- }
-
- OutputStream out = new OutputStream() {
-
- @Override
- public void write(int b) throws IOException {
- return;
- }
-
- @Override
- public void write(byte[] b) throws IOException {
- return;
- }
-
- @Override
- public void write(byte[] b, int off, int len) throws IOException {
- return;
- }
- };
-
- reader = new ConsoleReader(REMOTE_COMMAND,
- new FileInputStream(file), out,
- null);
- }
-
- reader.setBellEnabled(false);
- reader.addCompleter(getCommandCompleter());
-
+ try (Terminal terminal = createTerminal()) {
+ LineReader reader = LineReaderBuilder.builder().completer(getCommandCompleter()).appName(REMOTE_COMMAND).terminal(terminal).build();
return executeCommands(reader);
} catch (IOException e) {
throw new CommandException(e);
}
}
+
+ private Terminal createTerminal() throws IOException, CommandException {
+ if (file == null) {
+ System.out.println(STRINGS.get("multimodeIntro"));
+ return TerminalBuilder.builder().streams(new FileInputStream(FileDescriptor.in), System.out).build();
+ }
+ if (!file.canRead()) {
+ throw new CommandException("File: " + file + " can not be read");
+ }
+
+ OutputStream out = new OutputStream() {
+
+ @Override
+ public void write(int b) throws IOException {
+ return;
+ }
+
+ @Override
+ public void write(byte[] b) throws IOException {
+ return;
+ }
+
+ @Override
+ public void write(byte[] b, int off, int len) throws IOException {
+ return;
+ }
+ };
+ return TerminalBuilder.builder().streams(new FileInputStream(file), out).build();
+ }
+
+
/**
* Get the command completion.
*
- * TODO: make this non-static!
- * TODO: ask remote for dynamically added commands
- *
* @return The command completer
*/
private Completer getCommandCompleter() {
@@ -352,8 +322,7 @@
*
* @return the exit code of the last command executed
*/
- private int executeCommands(ConsoleReader reader)
- throws CommandException, CommandValidationException, IOException {
+ private int executeCommands(LineReader reader) throws CommandException, CommandValidationException {
String line = null;
int rc = 0;
@@ -368,14 +337,14 @@
try {
for (;;) {
- if (printPrompt) {
+ if (isPromptPrinted()) {
line = reader.readLine(shellType + "$ ");
} else {
line = reader.readLine();
}
if (line == null) {
- if (printPrompt) {
+ if (isPromptPrinted()) {
System.out.println();
}
break;
@@ -457,6 +426,10 @@
return rc;
}
+ private boolean isPromptPrinted() {
+ return file == null;
+ }
+
private static void atomicReplace(ServiceLocator locator, ProgramOptions options) {
DynamicConfigurationService dcs = locator.getService(DynamicConfigurationService.class);
DynamicConfiguration config = dcs.createDynamicConfiguration();
@@ -469,9 +442,9 @@
config.commit();
}
- private String[] getArgs(String line)
- throws ArgumentTokenizer.ArgumentException {
- List<String> args = new ArrayList<String>();
+
+ private String[] getArgs(String line) throws ArgumentTokenizer.ArgumentException {
+ List<String> args = new ArrayList<>();
ArgumentTokenizer t = new ArgumentTokenizer(line);
while (t.hasMoreTokens()) {
args.add(t.nextToken());
diff --git a/nucleus/parent/pom.xml b/nucleus/parent/pom.xml
index 1842b21..ff708ae 100644
--- a/nucleus/parent/pom.xml
+++ b/nucleus/parent/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.eclipse.ee4j</groupId>
<artifactId>project</artifactId>
- <version>1.0.6</version>
+ <version>1.0.7</version>
<relativePath />
</parent>
@@ -81,7 +81,7 @@
<!-- Jakarta Validation -->
<jakarta.validation-api.version>3.0.1</jakarta.validation-api.version>
- <hibernate-validator.version>7.0.3-SNAPSHOT</hibernate-validator.version>
+ <hibernate-validator.version>8.0.0-SNAPSHOT</hibernate-validator.version>
<!-- Jakarta Web Services -->
<!--
@@ -105,7 +105,7 @@
<!-- Jakarta REST -->
<jakarta.rest-api.version>3.1.0</jakarta.rest-api.version>
- <jersey.version>3.1.0-M4</jersey.version>
+ <jersey.version>3.1.0-M5</jersey.version>
<!-- Jakarta Mail -->
<jakarta.mail-api.version>2.1.0</jakarta.mail-api.version>
@@ -333,6 +333,12 @@
<groupId>org.glassfish.corba</groupId>
<artifactId>glassfish-corba-orb</artifactId>
<version>${glassfish-corba.version}</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
<dependency>
<groupId>org.glassfish.corba</groupId>
@@ -429,26 +435,23 @@
<version>${ha-api.version}</version>
</dependency>
-
-
- <!-- OSGi / Felix -->
-
+ <!-- OSGi / Felix -->
<dependency>
<groupId>org.osgi</groupId>
- <artifactId>osgi.cmpn</artifactId>
- <version>7.0.0</version>
+ <artifactId>osgi.promise</artifactId>
+ <version>8.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.annotation</artifactId>
- <version>7.0.0</version>
+ <version>8.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>osgi.core</artifactId>
- <version>7.0.0</version>
+ <version>8.0.0</version>
<scope>provided</scope>
</dependency>
<dependency>
@@ -458,6 +461,17 @@
<scope>provided</scope>
</dependency>
<dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.util.promise</artifactId>
+ <version>1.2.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.util.function</artifactId>
+ <version>1.2.0</version>
+ </dependency>
+
+ <dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.main</artifactId>
<version>7.0.3</version>
@@ -468,16 +482,6 @@
<version>4.7.2</version>
</dependency>
<dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.util.promise</artifactId>
- <version>1.1.1</version>
- </dependency>
- <dependency>
- <groupId>org.osgi</groupId>
- <artifactId>org.osgi.util.function</artifactId>
- <version>1.1.0</version>
- </dependency>
- <dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.eventadmin</artifactId>
<version>1.6.2</version>
@@ -512,29 +516,38 @@
<artifactId>org.apache.felix.configadmin</artifactId>
<version>1.9.22</version>
</dependency>
- <!-- Felix SCR used to include/embed promise, but after 2.0.12 stopped doing that. Since Felix Core doesn't export
- these packages, we have to deploy them together with Felix SCR. -->
- <dependency>
- <groupId>org.apache.felix</groupId>
- <artifactId>org.apache.felix.scr</artifactId>
- <version>2.2.0</version>
- </dependency>
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.bundlerepository</artifactId>
<version>2.0.10</version>
</dependency>
- <!-- This is currently used by osgi-shell cmd, but can be used for others as well -->
<dependency>
- <groupId>jline</groupId>
- <artifactId>jline</artifactId>
- <version>2.14.5</version>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.resolver</artifactId>
+ <version>2.0.4</version>
+ <scope>provided</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>org.osgi</groupId>
+ <artifactId>org.osgi.core</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.framework</artifactId>
+ <version>7.0.3</version>
+ <scope>provided</scope>
</dependency>
-
+ <!-- This is currently used by osgi-shell cmd, but can be used for others as well -->
+ <dependency>
+ <groupId>org.jline</groupId>
+ <artifactId>jline</artifactId>
+ <version>3.21.0</version>
+ </dependency>
<!--3rd party dependencies -->
-
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
diff --git a/snapshots/hibernate-validator/pom.xml b/snapshots/hibernate-validator/pom.xml
index c756519..84bd6bf 100644
--- a/snapshots/hibernate-validator/pom.xml
+++ b/snapshots/hibernate-validator/pom.xml
@@ -31,8 +31,8 @@
<packaging>pom</packaging>
<properties>
- <snapshots.sources.url>https://github.com/omnifaces/hibernate-validator/archive/refs/heads/main.zip</snapshots.sources.url>
- <snapshots.sources.directory>${project.build.directory}/hibernate-validator-main</snapshots.sources.directory>
+ <snapshots.sources.url>https://github.com/dmatej/hibernate-validator/archive/refs/heads/glassfish.zip</snapshots.sources.url>
+ <snapshots.sources.directory>${project.build.directory}/hibernate-validator-glassfish</snapshots.sources.directory>
</properties>
<build>
diff --git a/snapshots/pom.xml b/snapshots/pom.xml
index 4782a95..393a6b8 100644
--- a/snapshots/pom.xml
+++ b/snapshots/pom.xml
@@ -27,7 +27,7 @@
<parent>
<groupId>org.eclipse.ee4j</groupId>
<artifactId>project</artifactId>
- <version>1.0.6</version>
+ <version>1.0.7</version>
<relativePath />
</parent>