Versions Compared

Key

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

...

Option Name

Notes

Optional

Default Value

file

This specifies the path to the file that should be used. Can also specify a directory path if a whole directory needs to be copied over.

no

n/a

todir

This specified the name the directory that the file should be copied to relative to the configurations home.
If this is not specified, its value will be determined based on the tofile setting and if that is not specified, it will default to the configuration's home directory

yes

The configuration home root

tofile

This specified the name the file to where it should be copied relative to the configurations home. This path variable can also be used to specify both the directory and file name.
If this is not specified, its value will be determined based on the file name of the original file

yes

The file name of the original file

configfile

This specifies if the file being copied is a configuration file or not. This determines whether token replacement should be applied to the file.
Do not use this option when passing a file that is not an ascii file as it will corrupt the copied file.

yes

false

overwrite

This specifies if the file should overwrite a file if it already exists

yes

true

Example:

file

todir

tofile

destination file (relative to standalone configuration root)

/tmp/server.xml

conf

 


conf/server.xml

/tmp/server.xml 


conf/server.xml

conf/server.xml

/tmp/server.xml

conf

server-2.xml

conf/server-2.xml

/tmp/server.xml

 

 



server.xml

Usage

Example pom.xml fragment of how to use custom file configuration.s
Note in this example if  (customMessage) is set in any of the files with configfile=true it will be replaced with "Hello World" when it gets copied to the standalone server's directory.

Code Block
xml
xml

<build>
  <plugins>
    <plugin>
      <groupId>org.codehaus.cargo.maven2<maven3</groupId>
      <artifactId>cargo-maven2maven3-plugin</artifactId>
      <configuration>
        <container>
          <containerId>tomcat5x</containerId>
        </container>
        <configuration>
          <files>
            <copy>
              <file>/tmp/server.xml</file>
              <tofile>conf/server.xml</tofile>
              <configfile>true</configfile>
              <overwrite>true</overwrite>
            </copy>
          </files>
          <properties>
            <customMessage>Hello World</customMessage>
          </properties>
        </configuration>
      </configuration>
    </plugin>
  </plugins>
</build>

...