JStatic Docs Javadocs

Installation

As CLI

You can download the latest distribution version from here. This needs Java 13 to run. After downloading it, you can symlink it to your /bin directory to be always accessible:

For example on macOS run following to link:

$ sudo ln -s /path/to/distribution/of/jstatic/bin/jstatic /usr/local/bin/jstatic

This is right now out of the scope of this guide due to its complexity and variety for different systems.

Use Docker Image

We publish following images:

Whereas:

Decide based on your use case, which tag and from where you want to consume.

To use the docker image you should:

  1. mount your data under working directory which is /jstatic/home/. This shall contain:
    • your own config.yaml file. See default config for possible values
    • all your other input files for data and possible plugins
  2. run image
  3. use output as configured in config.yaml

Assuming using the latest release image and having your project files in current directory, the command would look like:

$ docker run -v $(pwd):/wrk -w /wrk mohamnag/jstatic

You can pass in any parameter that you would pass to CLI by appending it to above. For example to start watch mode:

$ docker run -v $(pwd):/wrk -w /wrk mohamnag/jstatic --watch

As Java Library

No surprise that you can include and use this library as a Java library too. Use coordinates in following sections to install the dependency.

Releases

Releases are published to maven central.

in Gradle:

repositories {
  mavenCentral()
}

dependencies {
  implementation 'com.mohamnag:jstatic:X.Y.Z'
}

in Maven:


<dependency>
  <groupId>com.mohamnag</groupId>
  <artifactId>jstatic</artifactId>
  <version>X.Y.Z</version>
</dependency>

Snapshots

Snapshots are published to OSS Sonatype snapshot repository.

in Gradle:

repositories {
  maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}

dependencies {
  implementation 'com.mohamnag:jstatic:X.Y.Z'
}

in Maven (you need to add https://oss.sonatype.org/content/repositories/snapshots as repository in your maven settings):


<dependency>
  <groupId>com.mohamnag</groupId>
  <artifactId>jstatic</artifactId>
  <version>X.Y.Z</version>
</dependency>

Replace X.Y.Z with desired version.

As Gradle Task

You can use JStatic as a Gradle task to achieve a number of goals:

As the setup and usage are in this case more complicated, refer to its own dedicated page to find more and see the sample setup how JStatic has been used to generate POJOs from OpenAPI spec.