class MavenArtifact:
Constructors: MavenArtifact.fromGradleShort(groupNameVersionClassifier, type), MavenArtifact(group, name, version, classifier, type)
Encapsulates group, name, version and type (file extension) of an artifact as provided, for example, by a maven repository.
Basically, the pieces are used to create URLs and file names to access a repository.
| Static Method | from |
Create an MavenArtifact from a Gradle short form like "org.json:json:20250107" A forth element, the classifier, may be given too. |
| Method | __init__ |
Creates the artifact. |
| Method | as |
Provides a Target which can be used to fetch the artifact and place it into the file system. |
| Method | filename |
Provides the filename of the artifact. |
| Method | repo |
Creates the relative URL part, including filename(), which can be used to fetch the target if prefixed by a repository URL. |
| Instance Variable | classifier |
artifact classifier |
| Instance Variable | group |
group of the artifact |
| Instance Variable | name |
name of the artifact |
| Instance Variable | type |
artifact type, typically a file extension like "jar" |
| Instance Variable | version |
artifact version |
Create an MavenArtifact from a Gradle short form like
"org.json:json:20250107" A forth element, the classifier, may be given
too.
Creates the artifact.
| Parameters | |
group:str | typically something like "org.json" |
name:str | of the artifact, like "json" |
version:str | of the artifact, like "1.2.3" |
classifier:str | None | of the artifact, like "runtime", may be None |
type:str | ends up as the file extension, like "jar" |
str, mavenRepoUrl: str | None = None, name: str | None = None) -> Target[ Path]:
¶
Provides a Target which can be used to fetch the artifact and place it into
the file system.
| Parameters | |
dir:str | directory to copy the artifact to, also the name of the
Target returned. |
mavenstr | None | The URL to fetch the artifact from. If this is not provided we assume we have a local repository in ~/.m2. The string must end with '/' otherwise the resulting URL is likely wrong. |
name:str | None | optional name for the target being created, defaults to the name of the artifact |
| Returns | |
Target[ | the target |
Provides the filename of the artifact.
| Returns | |
str | file name of the form "name-version-classifier.type" where -classifier only provided if defined in the constructor.. |
Creates the relative URL part, including filename(), which can be used
to fetch the target if prefixed by a repository URL.
| Returns | |
str | URL of the form "g1/g2/.../name/version/filename" where g1,... are the dot-separated parts of the group name |