java

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToMavenPomName

func ToMavenPomName(name, version string) string

ToMavenPomName is helper method to build name exists in https://repo1.maven.org

example name: org.apache.logging.log4j:log4j-core version: 2.17.1 output: org/apache/logging/log4j/log4j-core/2.17.1/log4j-core-2.17.1.pom

Types

type Project

type Project struct {
	Licenses struct {
		License struct {
			Name string `xml:"name"`
		} `xml:"license"`
	} `xml:"licenses"`
}

Project is struct to unmarshal pom.xml of java project

type Scanner

type Scanner struct {
	Crawler shared.Crawler
}

Scanner is struct to scan license info Crawler is exported to modify or make it easy to test by mock

func (*Scanner) ScanLicense

func (s *Scanner) ScanLicense(name, _ string) (string, float64, error)

ScanLicense returns license fetched from repo1.maven.org/maven2, returns license if confidence is over 90% example https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-core/2.17.1/log4j-core-2.17.1.pom name is required in a format like org/apache/logging/log4j/log4j-core/2.17.1/log4j-core-2.17.1.pom If structure of pom is not expected, Detection logic is depends on github.com/google/licenseclassifier

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL