Class MavenCentralSearchService
java.lang.Object
org.jenkinsci.plugins.maven_artifact_choicelistprovider.central.MavenCentralSearchService
- All Implemented Interfaces:
IVersionReader
Maven Central offers a search service located at
As the API is public, but Maven Central is the only service offering it, there is no reason to modify the URLs for searching and retrieving the artifacts.
Anyway, if there should be another repository using the same API, this class can be inherited and
REPO_SEARCH_SERVICE_URL which can be used to query the
maven central repository via a RESTful interface. This class makes use of this API and return a list of artifacts.
As the API is public, but Maven Central is the only service offering it, there is no reason to modify the URLs for searching and retrieving the artifacts.
Anyway, if there should be another repository using the same API, this class can be inherited and
getSearchURL() and getRetrieveURL() and createItemURLs(ResponseDoc, String)
can be overriden.- Author:
- stephan.watermeyer, Diebold Nixdorf
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCan over overriden.retrieveVersions(String pRepositoryId, String pGroupId, String pArtifactId, String pPackaging, ValidAndInvalidClassifier pClassifier) voidsetCredentials(String pUserName, String pUserPassword) voidsetUserName(String pUserName) voidsetUserPassword(String pUserPassword)
-
Field Details
-
REPO_RETRIEVE_URL
- See Also:
-
REPO_SEARCH_SERVICE_URL
- See Also:
-
-
Constructor Details
-
MavenCentralSearchService
public MavenCentralSearchService()
-
-
Method Details
-
retrieveVersions
public List<String> retrieveVersions(String pRepositoryId, String pGroupId, String pArtifactId, String pPackaging, ValidAndInvalidClassifier pClassifier) throws VersionReaderException - Specified by:
retrieveVersionsin interfaceIVersionReader- Throws:
VersionReaderException
-
setUserName
- Specified by:
setUserNamein interfaceIVersionReader
-
setUserPassword
- Specified by:
setUserPasswordin interfaceIVersionReader
-
setCredentials
- Specified by:
setCredentialsin interfaceIVersionReader
-
getSearchURL
-
getRetrieveURL
Can over overriden.- Returns:
- the URL where the artifacts are stored.
-