Expand Authors Top

If you have a few years of experience in the Java ecosystem and you’d like to share that with the community, have a look at our Contribution Guidelines.

November Discount Launch 2022 – Top
We’re finally running a Black Friday launch. All Courses are 30% off until next Friday:

>> GET ACCESS NOW

November Discount Launch 2022 – TEMP TOP (NPI)
We’re finally running a Black Friday launch. All Courses are 30% off until next Friday:

>> GET ACCESS NOW

Expanded Audience – Frontegg – Security (partner)
announcement - icon User management is very complex, when implemented properly. No surprise here.

Not having to roll all of that out manually, but instead integrating a mature, fully-fledged solution - yeah, that makes a lot of sense.
That's basically what Frontegg is - User Management for your application. It's focused on making your app scalable, secure and enjoyable for your users.
From signup to authentication, it supports simple scenarios all the way to complex and custom application logic.

Have a look:

>> Elegant User Management, Tailor-made for B2B SaaS

1. Overview

This tutorial introduces the verifier plugin, one of the core plugins of the Maven build tool.

For an overview of the other core plugins, refer to this overview article.

2. Plugin Goal

The verifier plugin has only one goal – verify. This goal verifies the existence or non-existence of files and directories, optionally checking file content against a regular expression.

Despite its name, the verify goal is bound to the integration-test phase by default rather than the verify phase.

3. Configuration

The verifier plugin is triggered only if it's explicitly added to the pom.xml:

<plugin>
    <artifactId>maven-verifier-plugin</artifactId>
    <version>1.1</version>
    <configuration>
        <verificationFile>input-resources/verifications.xml</verificationFile>
    </configuration>
    <executions>
        <execution>
            <goals>
                <goal>verify</goal>
            </goals>
        </execution>
    </executions>
</plugin>

This link shows the newest version of the plugin.

The default location of the verification file is src/test/verifier/verifications.xml. We must set a value for the verificationFile parameter if we want to use another file.

Here's the content of the verification file shown in the given configuration:

<verifications 
  xmlns="http://maven.apache.org/verifications/1.0.0" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/verifications/1.0.0 
  http://maven.apache.org/xsd/verifications-1.0.0.xsd">
    <files>
        <file>
            <location>input-resources/baeldung.txt</location>
            <contains>Welcome</contains>
        </file>
    </files>
</verifications>

This verification file confirms that a file named input-resources/baeldung.txt exists and that it contains the word Welcome. We've already added such a file before, thus the goal execution succeeds.

4. Conclusion

In this article, we walk through the verifier plugin and described how to customize it.

The complete source code for this tutorial can be found over on GitHub.

Next »
The Maven Site Plugin
« Previous
The Maven Clean Plugin
November Discount Launch 2022 – Bottom
We’re finally running a Black Friday launch. All Courses are 30% off until next Friday:

>> GET ACCESS NOW

Maven footer banner
Comments are closed on this article!