Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
LocalContainer container = ...;
StandaloneLocalConfiguration configuration = (StandaloneLocalConfiguration) getLocalContainer().getConfiguration();

FileConfig loginConfigXml = new FileConfig();
loginConfigXml.setConfigfile("src/main/jboss5/login-config.xml");
loginConfigXml.setToDir("conf");
configuration.setConfigFileProperty(loginConfigXml);

FileConfig sampleRolesProperties = new FileConfig();
sampleRolesProperties.setConfigfile("src/main/jboss5/sample-roles.properties");
sampleRolesProperties.setToDir("conf");
configuration.setConfigFileProperty(sampleRolesProperties);

FileConfig sampleUsersProperties = new FileConfig();
sampleUsersProperties.setConfigfile("src/main/jboss5/sample-users.properties");
sampleUsersProperties.setToDir("conf");
configuration.setConfigFileProperty(sampleUsersProperties);

Example using the ANT tasks

Code Block
languagejava
<cargo containerId="@{containerId}" action="@{action}">
  <configuration home="${configuration.home}">
    <configfile file="${basedir}/src/main/jboss5/login-config.xml" todir="conf"/>
    <configfile file="${basedir}/src/main/jboss5/sample-roles.properties" todir="conf/props"/>
    <configfile file="${basedir}/src/main/jboss5/sample-users.properties" todir="conf/props"/>
  </configuration>
</cargo>

Example using the Maven 2 plugin

Code Block
languagehtml/xml
<plugin>
  <groupId>org.codehaus.cargo</groupId>
  <artifactId>cargo-maven2-plugin</artifactId>
  <configuration>
    <container>
      [...]
    </container>
    <configuration>
      <type>standalone</type>
      [...]
      <configfiles>
        <configfile>
          <file>${project.basedir}/src/main/jboss5/login-config.xml</file>
          <todir>conf</todir>
        </configfile>
        <configfile>
          <file>${project.basedir}/src/main/jboss5/sample-roles.properties</file>
          <todir>conf/props</todir>
        </configfile>
        <configfile>
          <file>${project.basedir}/src/main/jboss5/sample-users.properties</file>
          <todir>conf/props</todir>
        </configfile>
      </configfiles>
    </configuration>
  </configuration>
</plugin>

...