Concat Maven Plugin

Maven plugin that can concatenate several files into one new file.

License

License

Categories

Categories

Maven Build Tools
GroupId

GroupId

io.github.kpeedosk
ArtifactId

ArtifactId

concat-maven-plugin
Last Version

Last Version

1.6.0
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

Concat Maven Plugin
Maven plugin that can concatenate several files into one new file.
Project URL

Project URL

https://github.com/KPeedosk/concat-maven-plugin
Source Code Management

Source Code Management

https://github.com/KPeedosk/concat-maven-plugin.git

Download concat-maven-plugin

How to add to project

<plugin>
    <groupId>io.github.kpeedosk</groupId>
    <artifactId>concat-maven-plugin</artifactId>
    <version>1.6.0</version>
</plugin>

Dependencies

compile (9)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.25
org.slf4j : slf4j-simple jar 1.7.2
org.apache.commons : commons-lang3 jar 3.7
org.apache.maven : maven-plugin-api jar 3.2.5
org.apache.maven : maven-core jar 3.2.5
org.apache.maven : maven-compat jar 3.2.5
org.apache.maven.plugin-tools : maven-plugin-tools-api jar 3.4
commons-io : commons-io jar 2.5
com.google.inject : guice jar 4.1.0

provided (1)

Group / Artifact Type Version
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.4

test (2)

Group / Artifact Type Version
org.apache.maven.plugin-testing : maven-plugin-testing-harness jar 3.3.0
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

Concat Maven Plugin

Maven Plugin to allow concatenation of files.

Forked from DarrenForsythe concat-maven-plugin.

This plugin is compiled against maven 3.2.5, the last supported java 1.6 maven release, hosted on Maven Central.

<plugin>
    <groupId>io.github.KPeedosk</groupId>
    <artifactId>concat-maven-plugin</artifactId>
    <version><!-- A Version --> </version>
    <configuration>
      <!-- Configure me -->
    </configuration>
</plugin>

Build Info

Build Status Maven metadata URI

Build

Mutation Testing, Code Formatting, OWASP Dependency Analysis, POM Ordering is all checked as part of the Travis CI build.

Concatenation Types

Multiple methods of concatenating can be supported, the current implementions are,

  • FILE_LIST
    • Default setting, expects a list of concatFiles.
  • DIRECTORY
    • Given a specified directory all files will be concatenated to the output ordered by file name.
  • SEMVER
    • Attempts to order a directory by SEMVER ordering.

Param Validation

Validations are in place to check only the specified parameters required by the Concatentation Type, and are usable.

e.g. directory and concatFiles params are mutually exclusive and should not be set at the same time.

e.g. All files when using FILE_LIST must exist.

File List Usage

A basic example, which will concat the .input files to the concatfile.output.

<plugin>
    <groupId>io.github.kpeedosk</groupId>
    <artifactId>concat-maven-plugin</artifactId>
    <configuration>
        <concatenationType>FILE_LIST</concatenationType>
        <outputFile>target/concatfile.output</outputFile>
        <concatFiles>
            <concatFile>src/test/resources/testfiles/file_1.input</concatFile>
            <concatFile>src/test/resources/testfiles/file_2.input</concatFile>
            <concatFile>src/test/resources/testfiles/file_3.input</concatFile>
        </concatFiles>
    </configuration>
</plugin>

Directory Usage

Will concat all files in the directory to the output file.

<plugin>
    <groupId>io.github.kpeedosk</groupId>
    <artifactId>concat-maven-plugin</artifactId>
    <configuration>
        <outputFile>target/concatfile.output</outputFile>
        <directory>src/test/resources/testfiles/</directory>
        <concatenationType>
            DIRECTORY
        </concatenationType>
    </configuration>
</plugin>

Params

  • appendNewline
    • Defaults to false, will add a new line character between each concatenated file.
  • deleteTargetFile
    • Defaults to false, if they target file should be deleted before concatenation.
  • concatenationType
    • For selecting different types of concatentation implementations. Defaults to requiring a list of files as specified in the basic example.
  • directory
    • When using ConcatenationType.DIRECTORY specify the directory from which to get all files. Natural ordering of the file name is used to sort the files.
  • startingFile
    • When using directory this file will be used as the starting file for concatenation.
    • This file is always appended first regardless of the ordering applied.
  • recursive
    • Defaults to false, should directory be searched recursively.

Change Log

1.0.0

  • Correct maven dependencies to actually be able to test the project.
  • Add ability to delete the target file.

1.1.0

  • Add ability to concat by a directory.

1.1.1

  • Set Commons IO to 2.5.
    • UTF-8 is used to write and read files.
  • Use Toolchain to build against Java 6.

1.1.2

  • Updated to use Guice CDI
    • Why not over engineer

1.1.3

  • Remove final from ConcatenationType in mojo.

1.2.0

  • Make concatenationType required.
  • Add debug logger for the parmas if enable.
  • Move verification to CI profile

1.3.0

  • Add startingFile param used in DIRECTORY concatenation.
    • If specified this file will be the first file to be concatenated to with the rest following with natural ordering.

1.3.1

  • Correct startingFile for a startingFile that is contained within the same directory.

1.4.0

  • Add SLF4J Simple Logger.
    • Info, debug, and error logs are implemented for the flow of the plugin

1.5.0

  • Add SEMVER conact type.
    • Follows directory for the most part except file comparison attempts SEMVER ordering.

1.6.0

  • Add recurisve directory search.

Versions

Version
1.6.0