Skip to main content

Prerequisites

Before you begin, ensure you have the following installed:

Installation

Maven

Add the following dependency to your pom.xml:
<dependency>
    <groupId>com.scanoss</groupId>
    <artifactId>scanoss</artifactId>
    <version>0.13.0</version> <!-- Replace with the latest version available on Maven Central -->
</dependency>
A minimal pom.xml for a project using the SCANOSS SDK:
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
                             http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.example</groupId>
    <artifactId>scanoss-demo</artifactId>
    <version>1.0-SNAPSHOT</version>

    <dependencies>
        <dependency>
            <groupId>com.scanoss</groupId>
            <artifactId>scanoss</artifactId>
            <version>0.13.0</version> <!-- Replace with the latest version available on Maven Central -->
        </dependency>
    </dependencies>

</project>

Gradle

Add the following to your build.gradle dependencies block:
implementation group: 'com.scanoss', name: 'scanoss', version: '0.13.0'
Note: Ensure the version matches the Maven dependency above. Check Maven Central for the latest available release.

Quick Start

To initiate a scan using all the SCANOSS defaults:
import com.scanoss.Scanner;

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