Guide to validate your environment compiles correctly and the SDK can authenticate successfully.
- Option A (recommended for consumers): use Maven Central.
- Option B (recommended for contributors): use this Git repository source code.
If you want to consume the SDK from Maven Central (instead of source code in this repository), use:
- GroupId:
io.github.deathbycaptcha - ArtifactId:
deathbycaptcha-java-library - Version:
4.7.0
pom.xml dependency:
<dependency>
<groupId>io.github.deathbycaptcha</groupId>
<artifactId>deathbycaptcha-java-library</artifactId>
<version>4.7.0</version>
</dependency>Quick online resolution check:
mvn -B org.apache.maven.plugins:maven-dependency-plugin:3.7.1:get \
-Dartifact=io.github.deathbycaptcha:deathbycaptcha-java-library:4.7.0 \
-Dtransitive=false \
-DremoteRepositories=central::default::https://repo1.maven.org/maven2Expected result: BUILD SUCCESS.
Note: Maven Central publishes only the core library artifact. Runnable samples live in this repository under samples/src/main/java/examples/.
git clone https://github.com/deathbycaptcha/deathbycaptcha-api-client-java.git
cd deathbycaptcha-api-client-java- Java 25 LTS (recommended).
- Java 17 or 21 (supported for compatibility).
- Maven 3.9+.
- DeathByCaptcha credentials (for running examples and tests).
For running examples: Use Maven profile samples (see section 4 and samples usage).
For running integration tests (optional): Set environment variables or create a .env file:
export DBC_USERNAME="your_username"
export DBC_PASSWORD="your_password"
# or
export DBC_AUTHTOKEN="your_token"The run-tests.sh helper script automatically loads variables from a .env file if present.
From the repository root:
mvn clean compileThe fastest way to validate connectivity and authentication.
All sample executions use profile samples (-Psamples) because examples are located outside the core source set.
ExampleGetBalance requires 3 command-line parameters:
- Username
- Password
- API type:
HTTPorSOCKET
Pass parameters using -Dexec.args:
mvn -Psamples exec:java -Dexec.mainClass="examples.ExampleGetBalance" \
-Dexec.args="your_username your_password HTTP"Or using Socket API:
mvn -Psamples exec:java -Dexec.mainClass="examples.ExampleGetBalance" \
-Dexec.args="your_username your_password SOCKET"With valid credentials, you should see output similar to:
Using HTTP API
Your balance is 1234 US cents
Run unit tests (excludes Selenium integration tests that require Chrome):
mvn clean test -Dtest='!OnlineSeleniumRecaptchaIntegrationTest'Or use the helper script (automatically loads variables from .env file):
./run-tests.shTo run all tests including Selenium (requires Chrome/ChromeDriver installed):
mvn clean test
# or
./run-tests.sh testGenerated artifacts:
- Test report:
target/surefire-reports/ - JaCoCo coverage:
target/site/jacoco/
Note: The OnlineSeleniumRecaptchaIntegrationTest requires Chrome browser and ChromeDriver to be installed. If you don't have them, use the first command to skip that test.
Most examples require editing the source code to set credentials and captcha parameters. For more details on available samples and how to run them, see Samples usage.
You can run the full GitLab CI pipeline locally using gitlab-ci-local:
# Install gitlab-ci-local (if not already installed)
npm install -g gitlab-ci-local
# Run the pipeline
gitlab-ci-local --file ./.gitlab-ci.ymlFor more details, see CI and coverage.
401 Unauthorized: Verify username/password or auth token in environment or.envfile.- Network timeout: Confirm outbound connectivity to
api.dbcapi.me. - Java release error: Use Java 17, 21, or 25 (see Requirements above).
- Samples not found: Use Maven profile
-Psamplesto include samples in compilation (see Samples usage).