Getting Started

Our Java SDK for the secuconnect API can be included from our GitHub repository using the JAR file or Maven.

Installing the SDK using Maven (recommended)

1) add this to your pom.xml file:

edit pom.xml file
<dependency>
<groupId>com.secuconnect</groupId>
<artifactId>secuconnect-java-sdk</artifactId>
<version>4.1.0</version>
</dependency>
<repository>
<id>secuconnect-java-sdk-mvn</id>
<url>https://raw.github.com/secuconnect/secuconnect-java-sdk/mvn-repo/</url>
</repository>

2) then install it by using maven:

Maven install
mvn install

Installing the SDK from downloaded JAR file

We are also providing JAR files with all dependencies, so called fat JARs.

1) Download the latest secuconnect-java-sdk-...-shaded.jar file from the GitHub release page https://github.com/secuconnect/secuconnect-java-sdk/releases and store it into a subdirectory (f.e. lib) in your project.

2) then add this to your pom.xml file:

<dependency>
<groupId>com.secuconnect</groupId>
<artifactId>secuconnect-java-sdk</artifactId>
<version>4.1.0</version>
<scope>system</scope>
<systemPath>${basedir}/lib/secuconnect-java-sdk-4.1.0-shaded.jar</systemPath>
</dependency>

Shaded JAR

Shading takes all the classes from the dependencies, extracts them, and packs them directly into the final JAR alongside your application classes. It often renames (relocates) packages to avoid conflicts.

  • Structure: Flattened. All dependencies are merged into the main application file.
  • Best for: Avoiding "Jar Hell" when different libraries rely on different versions of the same dependency.
  • Pros: Solves dependency version conflicts (e.g., if you need Library A v1.0 and Library B needs v2.0, you can "shade" one of them into a new package name).
  • Cons: Removes original metadata, can create large files, and hides the original libraries, making vulnerability tracking (CVEs) difficult. 

One-JAR (alternatively)

One-JAR uses a special ClassLoader at runtime to load nested JAR files. It packages the code and the original dependency JARs together, allowing the application to read them directly from inside the main archive.

  • Structure: JAR-inside-a-JAR (nested).
  • Best for: Projects where preserving original dependency structures is necessary, or to avoid namespace conflicts without renaming classes.
  • Pros: Keeps dependencies in their original form.
  • Cons: Can be more complex at runtime due to a custom classloader.

A sample application

See https://github.com/secuconnect/secuconnect-java-sdk-demo

Live

To switch to the live environment it is necessary to change the URLs of the API endpoints:

// Live-Server:
Configuration.getDefaultApiClient().setBasePath("https://connect.secucard.com/api/v2");
Configuration.getDefaultApiClient().setAuthHost("https://connect.secucard.com/");