Skip to content

Instantly share code, notes, and snippets.

@danidiaz
Last active September 27, 2017 20:35
Show Gist options
  • Select an option

  • Save danidiaz/5885b961c42259eb8f4759f087f68a0b to your computer and use it in GitHub Desktop.

Select an option

Save danidiaz/5885b961c42259eb8f4759f087f68a0b to your computer and use it in GitHub Desktop.
Maven Cargo plugin example configuration. Includes container dependencies and a datasource definition https://codehaus-cargo.github.io/cargo/Maven2+Plugin+Reference+Guide.html#Maven2PluginReferenceGuide-dependency using the <properties> tag seems to be an alternative way of defining datasources https://codehaus-cargo.github.io/cargo/DataSource+a…
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>1.6.4</version>
<configuration>
<container>
<containerId>tomee7x</containerId>
<dependencies>
<dependency>
<!-- It seems the dependency must also be present,
with version, in the main dependency section of the pom.
-->
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
</dependencies>
</container>
<!-- The two nested configuration elements cause much confusion -->
<configuration>
<datasources>
<datasource>
<jndiName>jdbc/foo</jndiName>
<driverClass>org.postgresql.Driver</driverClass>
<url>localhost:5432/foo</url>
<username>foo</username>
<password>foo</password>
<id>foo</id>
</datasource>
</datasources>
<!-- Alternative (equivalent?) way of specifying datasources. -->
<!--
<properties>
<cargo.datasource.datasource.foo1>
cargo.datasource.driver=org.postgresql.Driver|
cargo.datasource.url=localhost:5432/foo|
cargo.datasource.jndi=jdbc/foo|
cargo.datasource.username=foo|
cargo.datasource.password=foo
</cargo.datasource.datasource.foo1>
</properties>
-->
</configuration>
<deployables>
</deployables>
</configuration>
</plugin>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment