Skip to content

SCANOSS Java package providing a simple, easy to consume library for interacting with SCANOSS APIs.

License

Notifications You must be signed in to change notification settings

scanoss/scanoss.java

Repository files navigation

SCANOSS Java Library

The SCANOSS java package provides a simple, easy to consume library for interacting with SCANOSS APIs.

Unit Test Release

Usage

The latest version of the package can be found on Maven Central.

Include in a maven project using:

        <dependency>
            <groupId>com.scanoss</groupId>
            <artifactId>scanoss</artifactId>
            <version>0.7.0</version>
        </dependency>

And in gradle using:

implementation group: 'com.scanoss', name: 'scanoss', version: '0.1.3'

Examples of consuming this SDK can be found in the cli package folder. Specifically, the ScanCommandLine.java shows how to instantiate the Scanner class to initiate a scan.

Here is a simple way to initiate a scan using all the SCANOSS defaults:

import com.scanoss.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner scanner = Scanner.builder().build();
        String file = "test.java";
        String result = scanner.scanFile(file);
    }
}

CLI

The package also ships with a sample CLI. It can be run using the example script scanoss-cli.sh:

scanos-cli.sh -h

Custom Certificate

In order to connect to a SCANOSS server with a custom (self-signed) certificate, the keychain will need to be imported onto the CA Certs into the instance of java before proceeding:

keytool -cacerts -importcert -file custom-key-chain.pem

Development

Before starting with development of this project, please read our CONTRIBUTING and CODE OF CONDUCT.

Requirements

Java 11 or higher.

The dependencies can be found in the pom.xml.

Testing

A full set of unit tests are included with the package.

To run tests, using the following command:

make test

Package Development

Versioning

The version of the package is defined in the pom.xml file. Please update this version before packaging/releasing an update.

The following commands are provided for incrementing version:

make inc_path
make inc_minor
make inc_major

Packaging

To package the library, please run:

make package

Dependency Updates

Check for dependency updates:

mvn versions:display-dependency-updates

Deployment

Then deploy to prod:

make deploy

This will deploy the package to Maven Central.

Alternatively pushing a tagged version to GitHub will trigger the Release Action to automate the deployment.

Bugs/Features

To request features or alert about bugs, please do so here.

Changelog

Details of major changes to the library can be found in CHANGELOG.md.

About

SCANOSS Java package providing a simple, easy to consume library for interacting with SCANOSS APIs.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

 
 
 

Languages