Skip to main content

Requirements

Before installing Validator, ensure your environment meets these requirements:
  • Java Development Kit (JDK) 11 or higher
  • Maven 3.x or Gradle 6.x+ (if using dependency management)
Validator has zero external dependencies (except for testing). It’s a lightweight library that won’t bloat your application.

Installation Methods

Add the following dependency to your pom.xml file:
pom.xml
<dependency>
    <groupId>io.github.ApamateSoft</groupId>
    <artifactId>Validator</artifactId>
    <version>1.3.2</version>
</dependency>
Then run:
mvn clean install
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
         http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.example</groupId>
    <artifactId>my-application</artifactId>
    <version>1.0.0</version>

    <properties>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
    </properties>

    <dependencies>
        <dependency>
            <groupId>io.github.ApamateSoft</groupId>
            <artifactId>Validator</artifactId>
            <version>1.3.2</version>
        </dependency>
    </dependencies>
</project>

Verify Installation

Create a simple test class to verify Validator is properly installed:
import io.github.ApamateSoft.validator.Validator;

public class HelloValidator {
    public static void main(String[] args) {
        // Create a simple validator
        Validator validator = new Validator.Builder()
            .required()
            .minLength(3)
            .build();
        
        // Test validation
        String testValue = "Hello";
        boolean isValid = validator.isValid(testValue);
        
        System.out.println("Is '" + testValue + "' valid? " + isValid);
    }
}

Compile and Run

mvn compile exec:java -Dexec.mainClass="HelloValidator"
If you see the output Is 'Hello' valid? true, installation was successful!

Troubleshooting

Cause: The Validator library is not on the classpath.Solution:
  • Maven: Run mvn clean install to download dependencies
  • Gradle: Run gradle build --refresh-dependencies
  • JAR: Verify the JAR file path in your classpath configuration
Cause: You’re using Java 10 or lower. Validator requires Java 11+.Solution: Upgrade to Java 11 or higher:
java -version  # Check your Java version
Update your pom.xml or build.gradle:
<properties>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>
</properties>
Cause: Maven Central repository is not configured or network issues.Solution:
  • Verify internet connection
  • Check repository configuration in settings.xml (Maven) or build.gradle (Gradle)
  • Try clearing cache: mvn clean or gradle clean
Cause: IDE hasn’t indexed the new dependency.Solution:
  • IntelliJ IDEA: File → Invalidate Caches / Restart
  • Eclipse: Project → Clean
  • VS Code: Reload window (Ctrl+Shift+P → “Reload Window”)

Version Information

Current Version: 1.3.2Release Notes:
  • The validOrFail and compareOrFail methods now require a key parameter
  • Fixed instanceof check for InvalidEvaluationException
  • Updated message for name rule and @Name annotation

Checking for Updates

Visit the Maven Central Repository to check for the latest version.

IDE Integration

IntelliJ IDEA

Auto-import works out of the box with Maven/Gradle projects

Eclipse

Use m2e (Maven) or Buildship (Gradle) plugins

VS Code

Install the Java Extension Pack for dependency management

Next Steps

Now that Validator is installed, you’re ready to start validating strings!

Quick Start Guide

Learn how to create your first validator and start validating strings in minutes

Build docs developers (and LLMs) love