Skip to content

Java/JVM implementation of the package url spec

License

Notifications You must be signed in to change notification settings

mr-zepol/packageurl-java

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Maven Central License

Package URL (purl) for Java

This project implements a purl parser and class for Java.

Compiling

mvn clean install

Maven Usage

Package URL is available on the Maven Central Repository. These can be used without having to compile the project yourself.

<dependencies>
    <dependency>
        <groupId>com.github.package-url</groupId>
        <artifactId>packageurl-java</artifactId>
        <version>1.3.0</version>
    </dependency>
</dependencies>

Usage

Creates a new PackageURL object from a purl string:

PackageURL purl = new PackageURL(purlString);

Creates a new PackageURL object from parameters:

PackageURL purl = new PackageURL(type, namespace, name, version, qualifiers, subpath);

Creates a new PackageURL object using the builder pattern:

PackageURL purl = PackageURLBuilder.aPackageURL()
    .withType("type")
    .withNamespace("namespace")
    .withName("name")
    .withVersion("version")
    .withQualifier("key","value")
    .withSubpath("subpath")
    .build();

Validates a String field in a POJO (Bean Validation):

@PackageURL
private String purl;

License

Permission to modify and redistribute is granted under the terms of the MIT License

About

Java/JVM implementation of the package url spec

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 99.4%
  • Shell 0.6%