2

In my Cargo Maven Configuration I set up a WildFly server with a DataSource, but how can I add the connection pool properties like max DB connections?

     <plugin>
            <groupId>org.codehaus.cargo</groupId>
            <artifactId>cargo-maven2-plugin</artifactId>
            <version>1.5.0</version>
            <configuration>
                <container>
                    <containerId>wildfly10x</containerId>
                    <zipUrlInstaller>
                        <url>
                            http://nexus:8081/nexus/service/local/repositories/thirdparty/content/org/jboss/wildfly/wildfly/10.1.0.Final/wildfly-10.1.0.Final.tar.gz
                        </url>
                    </zipUrlInstaller>
                    <dependencies>
                        <dependency>
                            <groupId>org.hsqldb</groupId>
                            <artifactId>hsqldb</artifactId>
                        </dependency>
                        <dependency>
                            <groupId>com.oracle</groupId>
                            <artifactId>jdbc6</artifactId>
                        </dependency>
                    </dependencies>
                </container>
                <configuration>
                    <files>
                        <copy>
                            <file>${project.basedir}/src/main/jboss/modules/</file>
                            <todir>../../installs/wildfly-10.1.0.Final/wildfly-10.1.0.Final/modules</todir>
                            <configfile>true</configfile>
                            <overwrite>true</overwrite>
                        </copy>
                    </files>
                    <properties>
                        <cargo.start.jvmargs>
                            -Xdebug
                            -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000
                            -Xnoagent
                            -Djava.compiler=NONE
                            -Dhibernate.hbm2ddl.auto=create
                        </cargo.start.jvmargs>
                        <cargo.datasource.datasource.jf>
                            cargo.datasource.jndi=jf/ds|
                            cargo.datasource.url=jdbc:hsqldb:mem:jfds|
                            cargo.datasource.driver=org.hsqldb.jdbc.JDBCDriver|
                            cargo.datasource.username=SA|
                            cargo.datasource.password=
                        </cargo.datasource.datasource.jf>
                    </properties>
                </configuration>
            </configuration>
        </plugin>

The expected result is like setting the datasource in the standalone.xml:

<datasources>
    <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS">
        <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url>
        <driver>h2</driver>
        <pool>
            <min-pool-size>10</min-pool-size>
            <max-pool-size>20</max-pool-size>
            <prefill>true</prefill>
        </pool>
        <security>
            <user-name>sa</user-name>
            <password>sa</password>
        </security>
    </datasource>
Teg
  • 1,302
  • 13
  • 32
  • Is there something tying you to the cargo plugin? With the wildfly-maven-plugin you can execute CLI commands https://docs.jboss.org/wildfly/plugins/maven/latest/execute-commands-mojo.html – James R. Perkins May 15 '17 at 15:39
  • @JamesR.Perkins we use cargo for portability between application servers, thanks for pointing out the WildFly plugin feature – Teg May 22 '17 at 20:47

0 Answers0