1

我们计划从 Wildfly 8.2.1 迁移到 Wildfly 15。但是,我们在执行 Wildfly Maven 插件时遇到错误。它在抱怨一个

意外元素“{urn:jboss:cli:3.4}jboss-cli”

jboss-cli.xml: ParseError at [row,col]:[6,38]

这是错误:

[ERROR] Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:2.0.0.Final:execute-commands (default-cli) on project jboss-system-properties: Execution default-cli of goal org.wildfly.plugins:wildfly-maven-plugin:2.0.0.Final:execute-commands failed: Failed to initialize CLI context: Failed to parse C:\server\wildfly-15.0.1.Final\bin\jboss-cli.xml: ParseError at [row,col]:[6,38]
[ERROR] Message: Unexpected element '{urn:jboss:cli:3.4}jboss-cli'
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:2.0.0.Final:execute-commands (default-cli) on project jboss-system-properties: Execution default-cli of goal org.wildfly.plugins:wildfly-maven-plugin:2.0.0.Final:execute-commands failed: Failed to initialize CLI context
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
...
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.wildfly.plugins:wildfly-maven-plugin:2.0.0.Final:execute-commands failed: Failed to initialize CLI context
        ... 20 more
Caused by: java.lang.IllegalStateException: Failed to initialize CLI context
        ... 21 more
Caused by: org.jboss.as.cli.CliInitializationException: Failed to parse C:\server\wildfly-15.0.1.Final\bin\jboss-cli.xml
        ... 24 more
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[6,38]
Message: Unexpected element '{urn:jboss:cli:3.4}jboss-cli'
        at org.jboss.staxmapper.XMLMapperImpl.processNested(XMLMapperImpl.java:120)
        at org.jboss.staxmapper.XMLMapperImpl.parseDocument(XMLMapperImpl.java:76)
        at org.jboss.as.cli.impl.CliConfigImpl.parse(CliConfigImpl.java:174)
        ... 29 more

这是我们简单的 pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <groupId>com.xyz.jboss.config.test</groupId>
   <artifactId>jboss-system-properties</artifactId>
   <version>0-SNAPSHOT</version>
   <name>jboss-system-properties</name>
   <url>http://maven.apache.org</url>
   <build>
      <plugins>
         <plugin>
            <groupId>org.wildfly.plugins</groupId>
            <artifactId>wildfly-maven-plugin</artifactId>
            <version>2.0.0.Final</version>
            <configuration>
               <commands>
                  <command>/system-property=test-key:add(value=test-val)</command>
               </commands>
            </configuration>
         </plugin>
      </plugins>
   </build>
</project>

以下是我们的执行方式:mvn wildfly:execute-commands -X -e

4

1 回答 1

1

我能够解决它。在<wildfly dir>\bin\jboss-cli.xml中,我将 xmlns urn 版本从 3.4 降级到 3.3 版本:

<jboss-cli xmlns="urn:jboss:cli:3.3">
于 2019-02-15T16:13:55.583 回答