Touch Maven Plugin

Touch files

License

License

Categories

Categories

Maven Build Tools
GroupId

GroupId

org.honton.chas
ArtifactId

ArtifactId

touch-maven-plugin
Last Version

Last Version

0.0.1
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

Touch Maven Plugin
Touch files
Project URL

Project URL

https://github.com/chonton/touch-maven-plugin
Source Code Management

Source Code Management

https://github.com/chonton/touch-maven-plugin

Download touch-maven-plugin

How to add to project

<plugin>
    <groupId>org.honton.chas</groupId>
    <artifactId>touch-maven-plugin</artifactId>
    <version>0.0.1</version>
</plugin>

Dependencies

compile (2)

Group / Artifact Type Version
org.apache.maven : maven-plugin-api jar 3.6.3
org.apache.maven.shared : file-management jar 3.0.0

provided (2)

Group / Artifact Type Version
org.apache.maven.plugin-tools : maven-plugin-annotations jar 3.6.0
org.projectlombok : lombok jar 1.18.16

test (4)

Group / Artifact Type Version
org.junit.jupiter : junit-jupiter-api jar 5.7.0
org.junit.jupiter : junit-jupiter-engine jar 5.7.0
org.junit.jupiter : junit-jupiter-params jar 5.7.0
org.mockito : mockito-core jar 3.6.0

Project Modules

There are no modules declared in this project.

touch-maven-plugin

Create file or set file modification time.

Plugin

Plugin reports available at plugin info.

There is a single goal: touch, which does not have a default bound phase. This goal modifies the timestamp of all files matching the FileSet specification. The FileSet includes and excludes support posix style globs

Any FileSet include which is not a glob will force creation of the necessary directories and create a zero byte file.

Configuration

Parameter Property Default Description
skipTouch ${touch.skip} false Skip modifying file timestamps
files The fileset to update last modification time
modificationTime The timestamp. Either a positive integer of number of seconds since the Unix Epoch, or an ISO8601 zoned date time

Filset Defaults

The following attributes of FileSet are used. Any attribute not in this table is ignored.

Attribute Default Description
directory ${user.dir} The root directory to walk
includes ** The files to include
excludes The files to exclude. Exclude takes precedence over include
followSymlinks false If true, evaluate soft links
fileMode 0644 The posix octal notation for created files
directoryMode 0755 The posix octal notation for created directories

Examples

Typical Use

  <build>
    <pluginManagement>
        <plugins>
          <plugin>
            <groupId>org.honton.chas</groupId>
            <artifactId>touch-maven-plugin</artifactId>
            <version>0.0.1</version>
          </plugin>
        </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.honton.chas</groupId>
        <artifactId>touch-maven-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>touch</goal>
            </goals>
            <phase>validate</phase>
          </execution>
        </executions>
        <configuration>
          <modificationTime>0</modificationTime>
          <filesets>
            <fileset>
              <directory>some/relative/path</directory>
              <includes>
                <include>**/*</include>
              </includes>
              <excludes>
                <exclude>**/log.log</exclude>
              </excludes>
            </fileset>
          </filesets>
        </configuration>
      </plugin>
    </plugins>
  </build>

Create a file

Create a file and its parent directories:

    <configuration>
      <modificationTime>${maven.build.timestamp}</modificationTime>
      <filesets>
        <fileset>
          <directory>path/to/create</directory>
          <includes>
            <include>.gitignore</include>
          </includes>
        </fileset>
      </filesets>
    </configuration>

Versions

Version
0.0.1