通过 wildfly-maven-plugin - 使用 maven 命令添加 JBoss DB 驱动程序连接失败
我们使用在 pom.xml
中配置的 wildfly-maven-plugin
。除此之外,我们尝试安装 Oracle DB 驱动程序并尝试在 JBoss 子系统中配置 DB 连接池。
请找到 wildfly-maven-plugin
的 pom.xml
配置
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>1.2.2.Final</version>
<configuration>
<hostname>${jboss_host}</hostname>
<port>${jboss_port}</port>
</configuration>
<executions>
<!-- Run CLI-scripts -->
<execution>
<id>jboss-config</id>
<phase>process-resources</phase>
<goals>
<goal>execute-commands</goal>
</goals>
<configuration>
<execute-commands>
<scripts>
<script>${basedir}/target/jboss/configuration/jboss-all-script.cli</script>
</scripts>
</execute-commands>
</configuration>
</execution>
</executions>
</plugin>
以下命令成功安装 Oracle DB 驱动程序。
mvn clean install -Pdeploy-oracle-driver,localdev
以下命令应该配置数据库驱动程序连接,但失败了。这是 mvn 命令和相关的错误输出。
mvn clean install -Pjboss,localdev
错误,
[INFO] --- wildfly-maven-plugin:1.2.2.Final:execute-commands (jboss-config) @ csd-servers-jboss ---
WARN: can't find jboss-cli.xml. Using default configuration values.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.382 s
[INFO] Finished at: 2022-03-24T15:14:02+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:1.2.2.Final:execute-commands (jboss-config) on project csd-servers-jboss: Execution jboss-config of goal org.wildfly.plugins:wildfly-maven-plugin:1.2.2.Final:execute-commands failed: Failed to initialize CLI context: Failed to initialize Aesh console: org/fusesource/jansi/WindowsAnsiOutputStream: org.fusesource.jansi.WindowsAnsiOutputStream -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
并且我们在 maven 项目的 jboss
文件夹下有以下文件 - cli-filters-localdev.properties
。
spring_profiles_active=localdevlogging_level=DEBUG oracle_deploy_name=oracle_driver ds_tx_name=${project.parent.artifactId}_db ds_tx_jndi=java:jboss/jdbc/${project.parent.artifactId}/DataSource ds_no_tx_name=${project.parent.artifactId}_db_NoTx ds_no_tx_jndi=java:jboss/jdbc/${project.parent.artifactId}/DataSource_NoTx database_url=jdbc:oracle:thin:@//srv251.srv.pulp.com:11523/jeevee.srv.pulp.com 数据库服务器=srv251.srv.pulp.com 数据库端口=11523 数据库名称=jeevee 数据库用户=bul 数据库密码=showbot database_max_pool_size=20 database_timeout=5000
我在这里做错了什么,为什么这个 mvn
命令失败,- mvn clean install -Pjboss,localdev
我明白这基本上是通过 jboss-cli
发生 - JBoss 命令行界面 - Aesh 控制台
We are using wildfly-maven-plugin
configured in pom.xml
. Over that we are trying to install Oracle DB Driver and trying to configure DB Connection Pool in JBoss subsystem.
Please find the pom.xml
configuration for wildfly-maven-plugin
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>1.2.2.Final</version>
<configuration>
<hostname>${jboss_host}</hostname>
<port>${jboss_port}</port>
</configuration>
<executions>
<!-- Run CLI-scripts -->
<execution>
<id>jboss-config</id>
<phase>process-resources</phase>
<goals>
<goal>execute-commands</goal>
</goals>
<configuration>
<execute-commands>
<scripts>
<script>${basedir}/target/jboss/configuration/jboss-all-script.cli</script>
</scripts>
</execute-commands>
</configuration>
</execution>
</executions>
</plugin>
Following command installs Oracle DB driver sucessfully.
mvn clean install -Pdeploy-oracle-driver,localdev
Following command supposed to configure DB Driver Connection but it is failing. Here is the mvn command and the concerned error output.
mvn clean install -Pjboss,localdev
Error,
[INFO] --- wildfly-maven-plugin:1.2.2.Final:execute-commands (jboss-config) @ csd-servers-jboss ---
WARN: can't find jboss-cli.xml. Using default configuration values.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.382 s
[INFO] Finished at: 2022-03-24T15:14:02+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:1.2.2.Final:execute-commands (jboss-config) on project csd-servers-jboss: Execution jboss-config of goal org.wildfly.plugins:wildfly-maven-plugin:1.2.2.Final:execute-commands failed: Failed to initialize CLI context: Failed to initialize Aesh console: org/fusesource/jansi/WindowsAnsiOutputStream: org.fusesource.jansi.WindowsAnsiOutputStream -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
And we have the following file - cli-filters-localdev.properties
under jboss
folder in the maven project.
spring_profiles_active=localdev logging_level=DEBUG
oracle_deploy_name=oracle_driver
ds_tx_name=${project.parent.artifactId}_db
ds_tx_jndi=java:jboss/jdbc/${project.parent.artifactId}/DataSource
ds_no_tx_name=${project.parent.artifactId}_db_NoTx
ds_no_tx_jndi=java:jboss/jdbc/${project.parent.artifactId}/DataSource_NoTx
database_url=jdbc:oracle:thin:@//srv251.srv.pulp.com:11523/jeevee.srv.pulp.com
database_server=srv251.srv.pulp.com database_port=11523
database_name=jeevee database_user=bul database_password=showbot
database_max_pool_size=20 database_timeout=5000
what is wrong that I am doing over here, why this mvn
command is failing,- mvn clean install -Pjboss,localdev
I understood this is basically happening through jboss-cli
- JBoss Command Line Interface - Aesh console
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论