import Base_java from "./base_java.js"; export type Provider = import('../provider').Provider; export type Provided = import('../provider').Provided; export type Package = { name: string; version: string; }; export type Dependency = { groupId: string; artifactId: string; version: string; scope: string; ignore: boolean; }; export default class Java_maven extends Base_java { #private; constructor(); /** * @param {string} manifestName - the subject manifest name-type * @returns {boolean} - return true if `pom.xml` is the manifest name-type */ isSupported(manifestName: string): boolean; /** * @param {string} manifestDir - the directory where the manifest lies */ validateLockFile(): boolean; /** * Provide content and content type for maven-maven stack analysis. * @param {string} manifest - the manifest path or name * @param {{}} [opts={}] - optional various options to pass along the application * @returns {Promise} */ provideStack(manifest: string, opts?: {}): Promise; /** * Provide content and content type for maven-maven component analysis. * @param {string} manifest - path to the manifest file * @param {{}} [opts={}] - optional various options to pass along the application * @returns {Provided} */ provideComponent(manifest: string, opts?: {}): Provided; /** * Read license from pom.xml manifest, with fallback to LICENSE file * @param {string} manifestPath - path to pom.xml * @returns {string|null} */ readLicenseFromManifest(manifestPath: string): string | null; /** * Create a Dot Graph dependency tree for a manifest path. * @param {string} manifest - path for pom.xml * @param {{}} [opts={}] - optional various options to pass along the application * @returns {Promise} the Dot Graph content * @private */ private #createSbomStackAnalysis; /** @type {Object} Packaging types that produce .jar files despite non-jar packaging names. */ static PACKAGING_TO_JAR: Record; /** * Build a Map of PURL string → CycloneDX hash entries by reading artifact files from the local Maven repository. * * Both the artifact file path and the hash-map key are derived from the * shared {@link Base_java#parseCoordinate} parser: the file path uses the * resolved version and raw classifier, while the key uses the same canonical * PURL builder as {@link Base_java#parseDep}. This guarantees the key always * matches the PURL that {@link Base_java#parseDependencyTree} looks up. * * @param {string} depTreeText Raw dependency tree text from mvn dependency:tree * @param {{}} [opts={}] Options bag (may contain TRUSTIFY_DA_MVN_REPO) * @returns {Promise>>} */ _buildMavenHashMap(depTreeText: string, opts?: {}): Promise>>; /** * @param {String} textGraphList Text graph String of the manifest * @param {[String]} ignoredDeps List of ignored dependencies to be omitted from sbom * @param {{}} opts Options * @param {String} manifestPath Path to the pom.xml manifest * @param {Map>} [hashMap] PURL→hashes map * @return {String} formatted sbom Json String with all dependencies */ createSbomFileFromTextFormat(textGraphList: string, ignoredDeps: [string], opts: {}, manifestPath: string, hashMap?: Map>): string; /** * Create a dependency list for a manifest content. * @param {{}} [opts={}] - optional various options to pass along the application * @returns {[Dependency]} the Dot Graph content * @private */ private #getSbomForComponentAnalysis; /** * * @param effectivePomManifest effective pom manifest path * @param originalManifest pom.xml manifest path * @return {Dependency} returns the root dependency for the pom * @private */ private #getRootFromPom; /** * Get a list of dependencies with marking of dependencies commented with * or . * @param {string} manifest - path for pom.xml * @returns {[Dependency]} an array of dependencies * @private */ private #getDependencies; /** * Utility function for looking up a dependency in a list of dependencies ignoring the "ignored" * field * @param dep {Dependency} dependency to look for * @param deps {[Dependency]} list of dependencies to look in * @returns boolean true if found dep in deps * @private */ private #dependencyIn; /** * Returns true if the given version string is a Maven version range * (starts with '[' or '('). * @param {string} version * @returns {boolean} * @private */ private #isVersionRange; /** * Resolves Maven version ranges in the given dependency list by running * maven-dependency-plugin:tree and reading the concrete versions it selects. * If no dependency uses a version range, returns the list unchanged. * @param {Dependency[]} dependencies * @param {string} manifestPath * @param {object} opts * @returns {Dependency[]} * @private */ private #resolveVersionRanges; } /** * Discover all pom.xml manifest paths in a Maven multi-module project. * * @param {string} workspaceRoot - Absolute or relative path to workspace root (must contain pom.xml) * @param {object} [opts={}] * @returns {Promise} Paths to pom.xml files (absolute) */ export declare function discoverMavenModules(workspaceRoot: string, opts?: object): Promise;