我使用Maven Cargo (1.2.1) 配置和启动 Glassfish 3.1.2 进行集成测试。我能够配置数据源并启动服务器。但我还需要配置 JDBC 安全领域以及 Java 邮件会话。
但是我不知道如何使用 maven cargo 配置安全领域和 Java 邮件会话,有人知道吗?
一种方法可能是使用asadmin
,但我不知道如何从货物中使用它。
到目前为止我所拥有的:
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>start-container</id>
<phase>pre-integration-test</phase>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>stop-container</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
<configuration>
<container>
<type>installed</type>
<containerId>glassfish3x</containerId>
<artifactInstaller>
<groupId>org.glassfish.main.distributions</groupId>
<artifactId>glassfish</artifactId>
<version>3.1.2</version>
<type>zip</type>
</artifactInstaller>
<output>${project.build.directory}/glassfish/container.log</output>
<log>${project.build.directory}/glassfish/cargo.log</log>
<append>false</append>
<dependencies>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc</artifactId>
</dependency>
</dependencies>
</container>
<configuration>
<home>${project.build.directory}/cargo/configurations/glassfish</home>
<properties>
<cargo.servlet.port>8082</cargo.servlet.port>
<cargo.datasource.datasource>
cargo.datasource.jndi=jdbc/tecisplus|
cargo.datasource.type=javax.sql.DataSource|
cargo.datasource.driver=oracle.jdbc.OracleDriver|
cargo.datasource.url=${it-database.url}|
cargo.datasource.username=$[it-database.username}|
cargo.datasource.password=${it-database.password}
</cargo.datasource.datasource>
</properties>
<deployables>
<deployable>
<groupId>de.test</groupId>
<artifactId>test-ear</artifactId>
<type>ear</type>
</deployable>
</deployables>
</configuration>
</configuration>
</plugin>