Skip to content

a maven plugin that greps through text files. can print the results or fail the build if [not] found etc.

License

Notifications You must be signed in to change notification settings

radai-rosenblatt/grep-maven-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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>

About

a maven plugin that greps through text files. can print the results or fail the build if [not] found etc.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages