grep-maven-plugin

a maven plugin for grepping through text files

License

License

Categories

Categories

Maven Build Tools Net
GroupId

GroupId

net.radai
ArtifactId

ArtifactId

grep-maven-plugin
Last Version

Last Version

1.1
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

grep-maven-plugin
a maven plugin for grepping through text files
Project URL

Project URL

https://github.com/radai-rosenblatt/grep-maven-plugin

Download grep-maven-plugin

How to add to project

<plugin>
    <groupId>net.radai</groupId>
    <artifactId>grep-maven-plugin</artifactId>
    <version>1.1</version>
</plugin>

Dependencies

compile (3)

Group / Artifact Type Version
org.apache.maven : maven-plugin-api jar 3.3.9
net.java.truevfs : truevfs-profile-default pom 0.11.0
org.freemarker : freemarker jar 2.3.23

provided (1)

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

Project Modules

There are no modules declared in this project.

grep-maven-plugin

a maven plugin that greps through files and prints the results

usage example:


<build>
    <plugins>
        <plugin>
            <groupId>net.radai</groupId>
            <artifactId>grep-maven-plugin</artifactId>
            <version>1.0-SNAPSHOT</version>
            <executions>
                <execution>
                    <goals>
                        <goal>grep</goal>
                    </goals>
                    <phase>test</phase>
                    <configuration>
                        <greps>
                            <grep>
                                <file>src/main/resources/file.txt</file>
                                <grepPattern>prop1</grepPattern>
                            </grep>
                            <grep>
                                <file>src/main/resources/archive.zip/directory/file.txt</file>
                                <grepPattern>prop1</grepPattern>
                                <outputPattern>found in file ${fileName} at line ${lineNumber} : ${line}</outputPattern>
                            </grep>
                        </greps>
                    </configuration>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

failing the build if a pattern if found/not-found:


<grep>
    <failIfFound>true</failIfFound>
    ...or...
    <failIfNotFound>true</failIfNotFound>
</grep>

to use this you will need to add the Sonatype OSS repository to your maven project:


<pluginRepositories>
   <pluginRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/groups/public</url>
   </pluginRepository>
</pluginRepositories>

Versions

Version
1.1
1.0