Class MavenCentralSearchService
- java.lang.Object
-
- org.jenkinsci.plugins.maven_artifact_choicelistprovider.central.MavenCentralSearchService
-
- All Implemented Interfaces:
IVersionReader
public class MavenCentralSearchService extends Object implements IVersionReader
Maven Central offers a search service located atREPO_SEARCH_SERVICE_URLwhich 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 andgetSearchURL()andgetRetrieveURL()andcreateItemURLs(ResponseDoc, String)can be overriden.- Author:
- stephan.watermeyer, Diebold Nixdorf
-
-
Field Summary
Fields Modifier and Type Field Description static StringREPO_RETRIEVE_URLstatic StringREPO_SEARCH_SERVICE_URL
-
Constructor Summary
Constructors Constructor Description MavenCentralSearchService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetRetrieveURL()Can over overriden.StringgetSearchURL()List<String>retrieveVersions(String pRepositoryId, String pGroupId, String pArtifactId, String pPackaging, ValidAndInvalidClassifier pClassifier)voidsetCredentials(String pUserName, String pUserPassword)voidsetUserName(String pUserName)voidsetUserPassword(String pUserPassword)
-
-
-
Field Detail
-
REPO_RETRIEVE_URL
public static final String REPO_RETRIEVE_URL
- See Also:
- Constant Field Values
-
REPO_SEARCH_SERVICE_URL
public static final String REPO_SEARCH_SERVICE_URL
- See Also:
- Constant Field Values
-
-
Method Detail
-
retrieveVersions
public List<String> retrieveVersions(String pRepositoryId, String pGroupId, String pArtifactId, String pPackaging, ValidAndInvalidClassifier pClassifier) throws VersionReaderException
- Specified by:
retrieveVersionsin interfaceIVersionReader- Throws:
VersionReaderException
-
setUserName
public void setUserName(String pUserName)
- Specified by:
setUserNamein interfaceIVersionReader
-
setUserPassword
public void setUserPassword(String pUserPassword)
- Specified by:
setUserPasswordin interfaceIVersionReader
-
setCredentials
public void setCredentials(String pUserName, String pUserPassword)
- Specified by:
setCredentialsin interfaceIVersionReader
-
getSearchURL
public String getSearchURL()
-
getRetrieveURL
public String getRetrieveURL()
Can over overriden.- Returns:
- the URL where the artifacts are stored.
-
-