Installation
Table of contents
Requirements
| Requirement | Minimum version |
|---|---|
| Java | 25 |
| Build tool | Maven 3.8+ or Gradle 8+ |
JavaQueryBuilder has zero runtime dependencies. Nothing extra is pulled into your classpath.
Maven
1. Add the JitPack repository
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
2. Add the dependency
<dependency>
<groupId>com.github.EzFramework</groupId>
<artifactId>JavaQueryBuilder</artifactId>
<version>1.0.4</version>
</dependency>
Gradle (Kotlin DSL)
1. Add the JitPack repository
repositories {
maven("https://jitpack.io")
}
2. Add the dependency
dependencies {
implementation("com.github.EzFramework:JavaQueryBuilder:1.0.4")
}
GitHub Packages
JavaQueryBuilder is also published to GitHub Packages. To consume it from there, authenticate with a personal access token that has read:packages scope.
~/.m2/settings.xml:
<servers>
<server>
<id>github</id>
<username>YOUR_GITHUB_USERNAME</username>
<password>YOUR_GITHUB_PAT</password>
</server>
</servers>
pom.xml:
<repositories>
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/EzFramework/JavaQueryBuilder</url>
</repository>
</repositories>
<dependency>
<groupId>com.github.EzFramework</groupId>
<artifactId>java-query-builder</artifactId>
<version>1.0.4</version>
</dependency>
Verifying the installation
Add this snippet to a test class. It should compile and run without errors:
import com.github.ezframework.javaquerybuilder.query.builder.QueryBuilder;
import com.github.ezframework.javaquerybuilder.query.sql.SqlResult;
SqlResult result = new QueryBuilder()
.from("test")
.whereEquals("id", 1)
.buildSql();
System.out.println(result.getSql()); // SELECT * FROM test WHERE id = ?
System.out.println(result.getParameters()); // [1]
System.out.println("JavaQueryBuilder is wired correctly.");