...
Code Block | ||
---|---|---|
| ||
<dependencies> <dependency> <groupId>org.apache.derby</groupId> <artifactId>derby</artifactId> <version>${derby.version}</version> <scope>test</scope> </dependency> </dependencies> ... <build> <plugins> <plugin> <groupId>org.codehaus.cargo</groupId> <artifactId>cargo-maven2maven3-plugin</artifactId> <version>${cargo.version}</version> <!-- This configuration will be used in general. --> <configuration> <container> <dependencies> <dependency> <groupId>org.apache.derby</groupId> <artifactId>derby</artifactId> </dependency> </dependencies> <systemProperties> <derby.system.home>\${project.build.directory}/derby</derby.system.home> </systemProperties> </container> <configuration> <properties> <cargo.datasource.datasource.derby> cargo.datasource.driver=org.apache.derby.jdbc.EmbeddedDriver| cargo.datasource.url=jdbc:derby:derbyDB;create=true| cargo.datasource.jndi=jdbc/CargoDS| cargo.datasource.username=APP| cargo.datasource.password=nonemptypassword </cargo.datasource.datasource.derby> </properties> </configuration> ... </configuration> </plugin> </plugins> </build> <profiles> ... <profile> <id>glassfish3x</id> <build> <pluginManagement> <plugins> <plugin> <groupId>org.codehaus.cargo</groupId> <artifactId>cargo-maven2maven3-plugin</artifactId> <configuration> <container> <containerId>glassfish3x</containerId> <artifactInstaller> <groupId>org.glassfish.main.distributions</groupId> <artifactId>glassfish</artifactId> <version>3.1.2.2</version> </artifactInstaller> <dependencies> <!-- Remove the org.apache.derby dependency since GlassFish 3.x is already shipped with Derby, and adding the dependency twice results in a java.lang.SecurityException: sealing violation: package org.apache.derby. --> <dependency> <groupId>org.apache.derby</groupId> <artifactId>derby</artifactId> <classpath>none</classpath> </dependency> </dependencies> </container> </configuration> </plugin> </plugins> </pluginManagement> </build> </profile> </profiles> |
...
ConfigurationFixtureFactory
: class with static methods showing examples for creating various DataSource and resource types:createDataSource
andcreateAnotherDataSource
: Creation of a DataSourcecreateDriverConfiguredDataSourceWithLocalTransactionSupport
: Creation of a DataSource with local transaction supportcreateDriverConfiguredDataSourceWithXaTransactionSupport
: Creation of a DataSource with XA transaction supportcreateXADataSourceConfiguredDataSource
: Creation of an XA DataSource as DataSourcecreateConnectionPoolDataSourceAsResource
: Creation of a connection poolcreateXADataSourceAsResource
: Creation of an XA DataSource as a resourcecreateMailSessionAsResource
: Creation of a Mail resourcecreateDataSourceWithWindowsPath
: Creation of a DataSource with a Windows pathcreateJmsQueueAsResource
andcreateJmsTopicAsResource
: Creation of a JMS queue and topic resource, respectively
DataSourceOnStandaloneConfigurationTest
: DataSource definition.TransactionEmulationDataSourceOnStandaloneConfigurationTest
: DataSource definition with transaction emulation.XATransactionDataSourceOnStandaloneConfigurationTest
: XA DataSource definition.MailResourceOnStandaloneConfigurationTest
: Resource definition, showing for examplemailsession
.JmsQueueResourceOnStandaloneConfigurationTest
andJmsTopicResourceOnStandaloneConfigurationTest
: Resource definition, showing for example a JMS queue and topic, respectively.
Users of the Maven2/Maven3 plugin can use the Maven2 Archetype showing DataSource support. Please read: DataSource Definition Archetype Maven 3 Plugin can refer to the Maven 3 Archetype showing DataSource support.