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>