Closed rslemos closed 3 years ago
Found the following documentation on the allowed characters for serverName
, which clearly shows a -
is allowed. The line of code @rslemos referenced should be changed accordingly.
https://openliberty.io/docs/21.0.0.3/reference/command/server-create.html
serverName
A name for the server. If no server is specified, a server called defaultServer is automatically created.
Naming constraints:
Use only Unicode alphanumeric (e.g. 0-9, a-z, A-Z), underscore (_), dash (-), plus (+), and period (.) characters.
Do not begin the with a dash (-) or a period (.).
Be aware that your file system, operating system, or compressed file directory might impose more restrictions.
I believe this regex properly represents the rules listed above: ^[A-Za-z0-9\+_]+[A-Za-z0-9\+_\.-]*$
The '+' repetition operator in your regex is redundant. Better remove it to ^[A-Za-z0-9\+_][A-Za-z0-9\+_\.-]*$
The +
was intended to require at least one character from the first group before allowing any characters from the last group. I'll double check the regex and test it some more.
I've been working with openliberty for a while now, using the following configuration:
But then I tried to introduce integration tests with arquillian, but it choked with (
EchoicChamberIT
is my test case):The culprit is the validation at: https://github.com/OpenLiberty/liberty-arquillian/blob/61fae809561315919b017fcb53a8120dc28e9b94/liberty-managed/src/main/java/io/openliberty/arquillian/managed/WLPManagedContainerConfiguration.java#L78.
As a workaround I removed the
serverName
configuration fromio.openliberty.tools:liberty-maven-plugin
(effectively changingserverName
todefaultServer
, which complies to the validation above).