Interface ArtifactSelectionDetails


  • public interface ArtifactSelectionDetails
    Details about artifact dependency substitution: this class gives access to the original dependency requested artifacts, if any, and gives the opportunity to replace the original requested artifacts with other artifacts. This can typically be used whenever you need to substitute a dependency with uses a classifier to a non-classified dependency, or the other way around.
    Since:
    6.6
    • Method Detail

      • hasSelectors

        boolean hasSelectors()
        Returns true if the dependency has requested a special artifact (either classifier, type or extension)
      • getRequestedSelectors

        java.util.List<DependencyArtifactSelector> getRequestedSelectors()
        Returns the list of requested artifacts for the dependency
      • withoutArtifactSelectors

        void withoutArtifactSelectors()
        Removes all artifact selectors, if any.
      • selectArtifact

        void selectArtifact​(java.lang.String type,
                            @Nullable
                            java.lang.String extension,
                            @Nullable
                            java.lang.String classifier)
        Adds an artifact to substitute. The first time this method is called, the original artifacts are replaced with the artifact defined by this method call. If you wish to add artifacts to the original query, you need to call getRequestedSelectors() and add them using selectArtifact(DependencyArtifactSelector).
        Parameters:
        type - the type of the artifact being queried
        extension - the extension, defaults to the type
        classifier - the classifier, defaults to null (no classifier)