【发布时间】:2014-03-20 12:39:06
【问题描述】:
我开始使用 wildfly 8 和 maven,但我遇到了问题。
我需要进行 xa-datasource 部署。为此我使用wildfly maven插件,你可以看到下面的配置:
<profiles>
<profile>
<id>wildfly-deploy-postgres-ds</id>
<build>
<plugins>
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>1.0.1.Final</version>
<executions>
<execution>
<id>deploy-postgresql</id>
<phase>package</phase>
<goals>
<goal>deploy-artifact</goal>
</goals>
<configuration>
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
<name>postgresql.jar</name>
</configuration>
</execution>
<execution>
<id>add-datasource</id>
<phase>install</phase>
<goals>
<goal>add-resource</goal>
</goals>
<configuration>
<address>subsystem=datasources</address>
<resources>
<resource>
<address>xa-data-source=java:jboss/datasources/postgresDS</address>
<properties>
<xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
<jndi-name>java:jboss/datasources/postgresDS</jndi-name>
<enabled>true</enabled>
<driver-name>postgresql.jar</driver-name>
</properties>
</resource>
<resource>
<address>xa-data-source=java:jboss/datasources/postgresDS,xa-datasource-properties=DatabaseName</address>
<properties>
<value>logrdb</value>
</properties>
</resource>
<resource>
<address>xa-data-source=java:jboss/datasources/postgresDS,xa-datasource-properties=ServerName</address>
<properties>
<value>localhost</value>
</properties>
</resource>
<resource>
<address>xa-data-source=java:jboss/datasources/postgresDS,xa-datasource-properties=User</address>
<properties>
<value>logr</value>
</properties>
</resource>
<resource>
<address>xa-data-source=java:jboss/datasources/postgresDS,xa-datasource-properties=Password</address>
<properties>
<value>logr</value>
</properties>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
在 shell 中执行配置文件:
mvn clean install -X -P wildfly-deploy-postgres-ds
收到此错误:
[ERROR] Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:1.0.1.Final:add-resource (add-datasource) on project xya: Could not execute goal add-resource. Reason: null: IllegalArgumentException -> [Help 1]
您可以在此处查看完整的调试日志 > http://pastebin.com/QhvHUnc0
有人知道这个问题的根源吗?谢谢!
【问题讨论】:
标签: java maven datasource wildfly xa