 ------
 Usage
 ------
 Aneesh Joseph
 ------
 2014-10-25
 ------

~~ The MIT License
~~
~~ Copyright (c) 2004
~~
~~ Permission is hereby granted, free of charge, to any person obtaining a copy of
~~ this software and associated documentation files (the "Software"), to deal in
~~ the Software without restriction, including without limitation the rights to
~~ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
~~ of the Software, and to permit persons to whom the Software is furnished to do
~~ so, subject to the following conditions:
~~
~~ The above copyright notice and this permission notice shall be included in all
~~ copies or substantial portions of the Software.
~~
~~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
~~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
~~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
~~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
~~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
~~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
~~ SOFTWARE.


Usage

  Brief examples on how to use the Copy Maven Plugin's goals.

* Copy a single file during maven build

  Use this example to copy a file during maven build.

-------------------
<project>
  ...
  <build>
    <plugins>
      <plugin>
        <groupId>com.coderplus.maven.plugins</groupId>
        <artifactId>copy-rename-maven-plugin</artifactId>
        <version>${project.version}</version>
        <executions>
          <execution>
            <id>copy-file</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <sourceFile>src/someDirectory/test.environment.properties</sourceFile>
              <destinationFile>target/someDir/environment.properties</destinationFile>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
-------------------

* Copy multiple files during a maven build

  The same as the previous example, but this time it will copy a directory instead of a file

-------------------
<project>
  ...
<project>
  ...
  <build>
    <plugins>
      <plugin>
        <groupId>com.coderplus.maven.plugins</groupId>
        <artifactId>copy-rename-maven-plugin</artifactId>
        <version>${project.version}</version>
        <executions>
          <execution>
            <id>copy</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <fileSets>
                <fileSet>
                  <sourceFile>src/someDirectory/test.environment.properties</sourceFile>
                  <destinationFile>target/someDir/environment.properties</destinationFile>
                </fileSet>
                <fileSet>
                  <sourceFile>src/someDirectory/test.logback.xml</sourceFile>
                  <destinationFile>target/someDir/logback.xml</destinationFile>
                </fileSet>                
              </fileSets>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
-------------------
* Rename a file during maven build

  The same as the first  example, but this time it will do a rename instead of copy

-------------------
<project>
  ...
  <build>
    <plugins>
      <plugin>
        <groupId>com.coderplus.maven.plugins</groupId>
        <artifactId>copy-rename-maven-plugin</artifactId>
        <version>${project.version}</version>
        <executions>
          <execution>
            <id>rename-file</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>rename</goal>
            </goals>
            <configuration>
              <sourceFile>src/someDirectory/test.environment.properties</sourceFile>
              <destinationFile>target/someDir/environment.properties</destinationFile>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
-------------------
* Rename a directory during maven build

  Similar to the above example, but this time it will do a rename a directory 

-------------------
<project>
  ...
  <build>
    <plugins>
      <plugin>
        <groupId>com.coderplus.maven.plugins</groupId>
        <artifactId>copy-rename-maven-plugin</artifactId>
        <version>${project.version}</version>
        <executions>
          <execution>
            <id>rename-file</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>rename</goal>
            </goals>
            <configuration>
              <sourceFile>target/someDirectory/</sourceFile>
              <destinationFile>target/someOtherDirectory/</destinationFile>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
-------------------
* Rename multiple files during maven build

  The same as the second example, but this time it will do a rename instead of copy

-------------------
<project>
  ...
  <build>
    <plugins>
      <plugin>
        <groupId>com.coderplus.maven.plugins</groupId>
        <artifactId>copy-rename-maven-plugin</artifactId>
        <version>${project.version}</version>
        <executions>
          <execution>
            <id>rename-file</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>rename</goal>
            </goals>
            <configuration>
              <fileSets>
                <fileSet>
                  <sourceFile>src/someDirectory/test.environment.properties</sourceFile>
                  <destinationFile>target/someDir/environment.properties</destinationFile>
                </fileSet>
                <fileSet>
                  <sourceFile>src/someDirectory/test.logback.xml</sourceFile>
                  <destinationFile>target/someDir/logback.xml</destinationFile>
                </fileSet>                
              </fileSets>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
-------------------

* Rename multiple files/directories during maven build

  The same as the second example, but this time it will do a rename instead of copy

-------------------
<project>
  ...
  <build>
    <plugins>
      <plugin>
        <groupId>com.coderplus.maven.plugins</groupId>
        <artifactId>copy-rename-maven-plugin</artifactId>
        <version>${project.version}</version>
        <executions>
          <execution>
            <id>rename-file</id>
            <phase>generate-sources</phase>
            <goals>
              <goal>rename</goal>
            </goals>
            <configuration>
              <fileSets>
                <fileSet>
                  <sourceFile>src/someDirectory/test.environment.properties</sourceFile>
                  <destinationFile>target/someDir/environment.properties</destinationFile>
                </fileSet>
                <fileSet>
                  <sourceFile>src/someFolder/</sourceFile>
                  <destinationFile>target/someOtherFolder/</destinationFile>
                </fileSet>                
              </fileSets>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
-------------------