Skip to content

Installation

Jan Wiemer edited this page Aug 31, 2022 · 13 revisions

Installation

It is possible to download the JACIS jar files directly from the maven repository page (see below). However the easiest way to use JACIS is to use e.g. gradle or another build tool that can manage maven repositories. For JACIS the maven repository included in the GitHub packages is used. The URL of a this maven repository containing all JACIS releases is: https://maven.pkg.github.com/janwiemer/jacis

Gradle

The gradle syntax for the maven coordinates is:

dependencies {
    implementation group: 'org.jacis', name: 'jacis', version: '2.0.23'
}

A complete sample gradle build file may look like:

plugins {
    id 'java'
    id 'maven-publish'
}

group = 'org.jacisexampleproject'
version = '2.0.0'

ext {
    projectName            = "JacisExampleProject"
    projectDescription     = "Example Project using JACIS."
    projectURL             = "https://github.com/JanWiemer/jacisexampleproject"
    author                 = "Jan Wiemer"
    authorId               = "JanWiemer"
    authorPwd              = System.properties.get("githubPAT") // read access token for GitHub package access.
    jacisMavenUrl          = "https://maven.pkg.github.com/janwiemer/jacis"
}

dependencies {
    implementation group: 'org.jacis', name: 'jacis', version: '2.0.23'
}

repositories {
    mavenLocal()
    mavenCentral()
    maven {
      credentials {
        username authorId
        password authorPwd
      }
       url jacisMavenUrl
    }
}

Note that the maven repository at gitHub can only be accesses using a security token (system property "githubPAT" above). Since it is anyway possible to download the artifacts it is safe to publish this security token (PAT) here (for the actual token see below). If you are using the gradle file from above you have to pass this token as a JVM argument (starting with "-D") to gradle. If you use the Eclipse buildship plugin you can add this to the gradle preferences page under JVM Arguments (add entry "-DgithubPAT=@PAT@", for the actual value of @PAT@ see below). Please do never commit the value of the token to github, otherwise the token will be invalidated automatically!

A little example project based on gradle using JACIS can be found here: https://github.com/JanWiemer/jacisexampleprj

Maven

The maven coordinates (repository: https://maven.pkg.github.com/janwiemer/jacis) for a release look like:

<dependency>
  <groupId>org.jacis</groupId>
  <artifactId>jacis</artifactId>
  <version>2.0.23</version>
</dependency>

A maven settings file providing access to the repository could look like:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      http://maven.apache.org/xsd/settings-1.0.0.xsd">

  <activeProfiles>
    <activeProfile>github</activeProfile>
  </activeProfiles>

  <profiles>
    <profile>
      <id>github</id>
      <repositories>
        <repository>
          <id>github</id>
	  <name>JanWiemer</name>
          <url>https://maven.pkg.github.com/JanWiemer/jacis</url>
        </repository>
      </repositories>
    </profile>
  </profiles>
  <servers>
      <server>
        <id>github</id>
        <username>JanWiemer</username>
        <password>@PAT@</password>
      </server>
    </servers>
</settings>

A little example project based on gradle using JACIS can be found here: https://github.com/JanWiemer/jacis-bank-demo

Access Token

To access the repository you need an access token as described above. In the chapters above the token is represented by the string "@PAT@" (personal access token). You have to replace this string by the actual token:

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
Important
Please note that you must not commit this token in any form to a file in github! Otherwise github will notice this and invalidate the token!

For safety I generate a second token that can by tried if the first one does not work:

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

For details see also this discussion.

Next Chapter: Getting Started