> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scanoss.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Overview

> The <a href='https://github.com/scanoss/scanoss.java' target='_blank' rel='noopener noreferrer'>SCANOSS Java SDK</a> provides a Java library for interacting with the SCANOSS API and scanning engine directly from your Java projects.

## Prerequisites

Before you begin, ensure you have the following installed:

* [Java 11](https://www.java.com/en/) or higher
* [Maven](https://maven.apache.org/download.cgi) or [Gradle](https://gradle.org/)

## Installation

### Maven

Add the following dependency to your `pom.xml`:

```xml theme={null}
<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:

```xml theme={null}
<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>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>3.1.0</version>
                <configuration>
                    <mainClass>com.example.YourMainClass</mainClass>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
```

This configuration fetches the SCANOSS SDK and allows you to run your application using `mvn exec:java`. Replace `com.example.YourMainClass` with the fully qualified name of your entry point class.

### Gradle

Add the following to your `build.gradle` dependencies block:

```groovy theme={null}
implementation group: 'com.scanoss', name: 'scanoss', version: '0.13.0'
```

> **Note:** Ensure the version matches the Maven dependency above. Check [Maven Central](https://central.sonatype.com/artifact/com.scanoss/scanoss) for the latest available release.

## Default API Endpoint

By default, the `Scanner` class sends requests to the SCANOSS Open Source Software Knowledge Base (OSSKB) API at:

```
https://api.osskb.org
```

To use a different endpoint, configure the `Scanner` instance accordingly. Refer to the [Configuration](#) section for details.

## Quick Start

To perform a scan using the default `Scanner` configuration:

```java theme={null}
import com.scanoss.Scanner;

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

`Scanner.builder().build()` constructs a `Scanner` instance using the default API endpoint and settings. The `scanFile` method returns the scan results as a JSON string.
