Class RepositoryAttachedValue<V>
- Type Parameters:
V- The type of the value
RepositoryAttachedValue is - as it's name implies - a value
that is attached to a repository. As of now it is used the file downloading
and repository negotiation process. The main purpose for this class is to be
able to trace the source repositories of artifacts.
Beware that it is permitted for the value to be attached to a null repository.
In this case, the value is considered to be attached to no particular repository
and may have directly been installed to the local maven repository.
However, RepositoryNegotiatior implementations should store adequate
metadata to be able to "track" from which repository an artifact came from even
across executions if the artifact was downloaded from a remote repository.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable MavenRepositoryObtains theMavenRepositorywhich is linked to the value.getValue()Obtains the value stored by this object.
-
Constructor Details
-
RepositoryAttachedValue
-
-
Method Details
-
getValue
Obtains the value stored by this object. May not return null as that is not sensical.- Returns:
- The attached value
-
getRepository
Obtains theMavenRepositorywhich is linked to the value. In practice this is the repository where a file originates from, may be null to indicate that this comes from MavenLocal - possibly installed by user interaction. Do note that most artifacts cached in MavenLocal should not return null but instead the repository where they were originally coming from. Furthermore this value should not return null if this object was created by any instance ofMavenRepository.It is also permitted to use null repositories if the repository the value originates from is known, but not registered to the negotiator (or whichever other object emits this
RepositoryAttachedValue). This for example can by reproduced by altering theIDof a repository across executions, rendering repository tracking metadata insufficient. Note: implementations are allowed to fall back to using theURLof the repository instead. That being said, solely relying on the ID is sufficient for most uses.- Returns:
- The repository.
-