Liking cljdoc? Tell your friends :D

lice-comb.maven

Functionality related to combing Maven POMs for license information.

In this namespace abbreviations are used for Maven's groupId, artifactId, and version concepts. So for example:

  • GA means groupId & artifactId
  • GAV means groupId, artifactId & version

In function calls where a version isn't required or provided, the library will determine and use the latest available version, as determined from (in order):

  1. your local Maven cache (usually ~/.m2/repository)
  2. remote Maven artifact repositories (e.g. Maven Central, CLojars)

Other/custom Maven artifact repositories are supported via the set-local-maven-repo! and set-remote-maven-repos! fns.

Functionality related to combing Maven POMs for license information.

In this namespace abbreviations are used for Maven's groupId, artifactId, and
version concepts.  So for example:

* `GA` means groupId & artifactId
* `GAV` means groupId, artifactId & version

In function calls where a version isn't required or provided, the library will
determine and use the latest available version, as determined from (in order):

1. your local Maven cache (usually ~/.m2/repository)
2. remote Maven artifact repositories (e.g. Maven Central, CLojars)

Other/custom Maven artifact repositories are supported via the
`set-local-maven-repo!` and `set-remote-maven-repos!` fns.
raw docstring

default-local-maven-repoclj

A String containing a file path for the default local Maven artifact cache that the library uses. Attempts to use this Maven client command to determine this value by default:

mvn help:evaluate -Dexpression=settings.localRepository -q -DforceStdout

but falls back on a "best guess" if the Maven client isn't installed or cannot be executed.

A `String` containing a file path for the default local Maven artifact cache
that the library uses.  Attempts to use this Maven client command to determine
this value by default:

  `mvn help:evaluate -Dexpression=settings.localRepository -q -DforceStdout`

but falls back on a "best guess" if the Maven client isn't installed or
cannot be executed.
sourceraw docstring

default-remote-maven-reposclj

A map containing the default remote Maven artifact repositories that the library uses. Each key is a String that's the short identifier of the repo (e.g. "clojars"), and each value is the base URL of that artifact repository (e.g. "https://repo.clojars.org").

A map containing the default remote Maven artifact repositories that the
library uses. Each key is a `String` that's the short identifier of the repo
(e.g. `"clojars"`), and each value is the base URL of that artifact
repository (e.g. `"https://repo.clojars.org"`).
sourceraw docstring

ga->metadata-uriclj

(ga->metadata-uri {:keys [group-id artifact-id]})
(ga->metadata-uri group-id artifact-id)

Returns a URI pointing to the maven-metadata.xml for the given GA, or nil if one cannot be found. The returned URI is guaranteed to be resolvable - either to a file that exists in the local Maven cache, or to an HTTP-accessible resource on a remote Maven repository (e.g. Maven Central, Clojars) that resolves.

Returns a `URI` pointing to the `maven-metadata.xml` for the given GA, or
`nil` if one cannot be found.  The returned `URI` is guaranteed to be
resolvable - either to a file that exists in the local Maven cache, or to an
HTTP-accessible resource on a remote Maven repository (e.g. Maven Central,
Clojars) that resolves.
sourceraw docstring

ga-latest-versionclj

(ga-latest-version group-id artifact-id)

Determines the latest version of the given GA as a String, or nil if it cannot be determined.

Note: this could be a SNAPSHOT, RC, alpha, beta, or any other type of pre-release version.

Determines the latest version of the given GA as a `String`, or `nil` if it
cannot be determined.

Note: this could be a SNAPSHOT, RC, alpha, beta, or any other type of
pre-release version.
sourceraw docstring

ga-release-versionclj

(ga-release-version group-id artifact-id)

Determines the release version (if any) of the given GA as a String, or nil if it cannot be determined or the GA doesn't have a released version.

Determines the release version (if any) of the given GA as a `String`, or
`nil` if it cannot be determined or the GA doesn't have a released version.
sourceraw docstring

gav->expressionsclj

(gav->expressions group-id artifact-id)
(gav->expressions group-id artifact-id version)

Returns a set of SPDX expressions (Strings) for the given GA and optionally V. See gav->expressions-info for details.

Returns a set of SPDX expressions (`String`s) for the given GA and
optionally V. See [[gav->expressions-info]] for details.
sourceraw docstring

gav->expressions-infoclj

(gav->expressions-info group-id artifact-id)
(gav->expressions-info group-id artifact-id version)

Returns an expressions-info map for the given GA and (optionally) V, by looking up the POM for the given GA(V) and calling pom->expressions-info on it.

If version is not provided, the latest version is looked up (which involves file and potentially also network I/O).

Notes:

Returns an expressions-info map for the given GA and (optionally) V, by
looking up the POM for the given GA(V) and calling [[pom->expressions-info]]
on it.

If `version` is not provided, the latest version is looked up (which involves
file and potentially also network I/O).

Notes:
* despite the name, will always return a singleton map, due to [Maven's rule
  about multi-licensed POMs](https://maven.apache.org/ref/3.9.7/maven-model/maven.html)
  (then search that page for 'licenses/license*')
* throws on XML parsing error
sourceraw docstring

gav->metadata-uriclj

(gav->metadata-uri {:keys [group-id artifact-id version]})
(gav->metadata-uri group-id artifact-id version)

Returns a URI pointing to the maven-metadata.xml for the given GAV, or nil if one cannot be found. The returned URI is guaranteed to be resolvable - either to a file that exists in the local Maven cache, or to an HTTP-accessible resource on a remote Maven repository (e.g. Maven Central, Clojars) that resolves.

Returns a `URI` pointing to the `maven-metadata.xml` for the given GAV, or
`nil` if one cannot be found.  The returned URI is guaranteed to be
resolvable - either to a file that exists in the local Maven cache, or to an
HTTP-accessible resource on a remote Maven repository (e.g. Maven Central,
Clojars) that resolves.
sourceraw docstring

gav->pom-uriclj

(gav->pom-uri {:keys [group-id artifact-id version]})
(gav->pom-uri group-id artifact-id)
(gav->pom-uri group-id artifact-id version)

Returns a URI pointing to the POM for the given GAV, or nil if one cannot be found. The returned URI is guaranteed to be resolvable - either to a file that exists in the local Maven cache, or to an HTTP-accessible resource on a remote Maven repository (e.g. Maven Central, Clojars) that resolves.

If version is not provided, determines the latest version (which may be a SNAPSHOT, or other pre-release version) and uses that.

Returns a `URI` pointing to the POM for the given GAV, or `nil` if one cannot
be found.  The returned `URI` is guaranteed to be resolvable - either to a
file that exists in the local Maven cache, or to an HTTP-accessible resource
on a remote Maven repository (e.g. Maven Central, Clojars) that resolves.

If version is not provided, determines the latest version (which may be a
SNAPSHOT, or other pre-release version) and uses that.
sourceraw docstring

init!clj

(init!)

Initialises this namespace upon first call (and does nothing on subsequent calls), returning nil. Consumers of this namespace are not required to call this fn, as initialisation will occur implicitly anyway; it is provided to allow explicit control of the cost of initialisation to callers who need it.

Note: this method may have a substantial performance cost.

Initialises this namespace upon first call (and does nothing on subsequent
calls), returning nil. Consumers of this namespace are not required to call
this fn, as initialisation will occur implicitly anyway; it is provided to
allow explicit control of the cost of initialisation to callers who need it.

Note: this method may have a substantial performance cost.
sourceraw docstring

local-maven-repoclj

(local-maven-repo)

The current local Maven repo in use, as a String containing a file path.

The current local Maven repo in use, as a `String` containing a file path.
sourceraw docstring

pom->expressionsclj

(pom->expressions pom)
(pom->expressions pom filepath)

Returns a set of SPDX expressions (Strings) for pom. See pom->expressions-info for details.

Returns a set of SPDX expressions (`String`s) for `pom`. See
[[pom->expressions-info]] for details.
sourceraw docstring

pom->expressions-infocljmultimethod

(pom->expressions-info pom)
(pom->expressions-info pom filepath)

Returns an expressions-info map for pom (an InputStream or something that can have an clojure.java.io/input-stream opened on it), or nil if no expressions were found.

If an InputStream is provided, it is the caller's responsibility to open and close it, and a filepath associated with the InputStream must be provided as the second parameter (it is not required for other types of input).

Notes:

Returns an expressions-info map for `pom` (an `InputStream` or something that
can have an `clojure.java.io/input-stream` opened on it), or `nil` if no
expressions were found.

If an `InputStream` is provided, it is the caller's responsibility to open and
close it, and a filepath associated with the `InputStream` *must* be provided
as the second parameter (it is not required for other types of input).

Notes:
* despite the name, will always return a singleton map, due to [Maven's rule
  about multi-licensed POMs](https://maven.apache.org/ref/3.9.7/maven-model/maven.html)
  (then search that page for 'licenses/license*')
* throws on XML parsing error
sourceraw docstring

remote-maven-reposclj

(remote-maven-repos)

The current remote Maven repos in use, as a map in the format described in default-remote-maven-repos.

The current remote Maven repos in use, as a map in the format described in
[[default-remote-maven-repos]].
sourceraw docstring

set-local-maven-repo!clj

(set-local-maven-repo! dir)

Sets the local Maven repo to use from this point onward. dir is a String that must be a readable directory that exists (throws ex-info if these conditions are not met).

Sets the local Maven repo to use from this point onward. `dir` is a `String`
that must be a readable directory that exists (throws ex-info if these
conditions are not met).
sourceraw docstring

set-remote-maven-repos!clj

(set-remote-maven-repos! repos)

Sets the remote Maven repos to use from this point onward. The argument is a map in the format described in default-remote-maven-repos.

For most use cases you should merge default-remote-maven-repos with whatever additional repos you wish to provide (the rare exceptions being situations such as a dev environment that contains a custom Maven artifact repository that proxies Maven Central and/or Clojars, and you don't want lice-comb to attempt to access anything but the proxy).

Sets the remote Maven repos to use from this point onward. The argument is a
map in the format described in [[default-remote-maven-repos]].

For most use cases you should merge `default-remote-maven-repos` with whatever
additional repos you wish to provide (the rare exceptions being situations
such as a dev environment that contains a custom Maven artifact repository
that proxies Maven Central and/or Clojars, and you don't want lice-comb to
attempt to access anything but the proxy).
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close