Skip to main content
Validity is two modules on Maven Central, under the group io.github.soleworks, released together and always at the same version, so a project that uses both never mixes versions: Most projects need only validity-core.

Add the dependency

For phone numbers, add validity-phone too, at the same version:
Validity is not on Maven Central yet: the first release is on its way. Until it lands, clone the repository next to your project and add includeBuild("../validity") to your settings.gradle.kts. Gradle then builds the dependency from the clone, so the dependency names no version. Maven cannot build from a clone, so a Maven project waits for the release.

Requirements

Java 17+

The JVM the artifacts are compiled for.

Kotlin 2.4

The version Validity is built with. It uses context parameters for its DSL.

Coroutines

kotlinx.coroutines comes with validity-core. You do not need to add it.

Packages and imports

Your IDE adds them for you when you complete a constraint.

Why phone numbers are apart

libphonenumber is large and holds the numbering plans of every country. Keeping it out of validity-core means a project that never validates a phone number does not ship it. A module adds its messages to the configuration without the core knowing it, through MessagesKey, the same way your own constraints can.

Versions

Validity follows Semantic Versioning. While the version is 0.x, a breaking change raises the minor version, so moving to the next minor version may ask you to change your code. The changelog says what to change.