通过maven exec插件启动hsqldb服务器失败

Ant*_*ine 4 hsqldb maven-3

我尝试启动hsqldb服务器以进行开发使用.我有hsqldb依赖:

<dependency>
   <groupId>org.hsqldb</groupId>
   <artifactId>hsqldb</artifactId>
   <version>2.2.4</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)

我有构建exec-maven-build:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <version>1.2.1</version>
    <executions>
        <execution>
            <goals>
                <goal>java</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <mainClass>org.hsqldb.server.Server</mainClass>
        <arguments>
            <argument>--database.0 file:target/monitoring</argument>
        </arguments>
    </configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)

我启动mvn exec:java,服务器启动,我有这个错误:

[Server@6e9770a3]: [Thread[org.hsqldb.server.Server.main(),5,org.hsqldb.server.Server]]: Failed to set properties
org.hsqldb.HsqlException: no valid database paths: maformed database enumerator: server.database.0 mem:monitoring
Run Code Online (Sandbox Code Playgroud)

我搜索代码,这个错误意味着什么,我在hsqldb代码中发现此页面上的错误=> http://hsqldb.svn.sourceforge.net/viewvc/hsqldb/base/tags/2.2.5/src/组织/ HSQLDB /服务器/ Server.java?修订= 4369&视图=标记

private IntKeyHashMap getDBNameArray() {

    final String  prefix       = ServerProperties.sc_key_dbname + ".";
    final int     prefixLen    = prefix.length();
    IntKeyHashMap idToAliasMap = new IntKeyHashMap();
    Enumeration   en           = serverProperties.propertyNames();

    for (; en.hasMoreElements(); ) {
        String key = (String) en.nextElement();

        if (!key.startsWith(prefix)) {
            continue;
        }

        int dbNumber;

        try {
            dbNumber = Integer.parseInt(key.substring(prefixLen));
        } catch (NumberFormatException e1) {
            **printWithThread("maformed database enumerator: " + key);**

            continue;
        }

        String alias = serverProperties.getProperty(key).toLowerCase();

        if (!aliasSet.add(alias)) {
            printWithThread("duplicate alias: " + alias);
        }

        Object existing = idToAliasMap.put(dbNumber, alias);

        if (existing != null) {
            printWithThread("duplicate database enumerator: " + key);
        }
    }

    return idToAliasMap;
}
Run Code Online (Sandbox Code Playgroud)

所以hsqldb用作关键所有参数:"没有有效的数据库路径:maformed database enumerator:server.database.0 mem:monitoring "

所以它看起来像一个bug,或者我做错了什么?

好的,我找到了解决方案,我改变了我给exec maven插件的参数的方式.

由此 :

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <version>1.2.1</version>
    <executions>
        <execution>
            <goals>
                <goal>java</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <mainClass>org.hsqldb.server.Server</mainClass>
        <arguments>
            <argument>--database.0 file:target/monitoring</argument>
        </arguments>
    </configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)

对此:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <version>1.2.1</version>
    <executions>
        <execution>
            <goals>
                <goal>java</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <mainClass>org.hsqldb.server.Server</mainClass>
        <arguments>
            <argument>--database.0</argument>
            <argument>file:target/monitoring</argument>
        </arguments>
    </configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)

它有效

Ant*_*ine 9

我改变了将参数传递给exec maven插件的方式

由此 :

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <version>1.2.1</version>
    <executions>
        <execution>
            <goals>
                <goal>java</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <mainClass>org.hsqldb.server.Server</mainClass>
        <arguments>
            <argument>--database.0 file:target/monitoring</argument>
        </arguments>
    </configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)

对此:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <version>1.2.1</version>
    <executions>
        <execution>
            <goals>
                <goal>java</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <mainClass>org.hsqldb.server.Server</mainClass>
        <arguments>
            <argument>--database.0</argument>
            <argument>file:target/monitoring</argument>
        </arguments>
    </configuration>
</plugin>
Run Code Online (Sandbox Code Playgroud)

它有效