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_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 andgetSearchURL()
andgetRetrieveURL()
andcreateItemURLs(ResponseDoc, String)
can be overriden.- Author:
- stephan.watermeyer, Diebold Nixdorf
-
-
Field Summary
Fields Modifier and Type Field Description static String
REPO_RETRIEVE_URL
static String
REPO_SEARCH_SERVICE_URL
-
Constructor Summary
Constructors Constructor Description MavenCentralSearchService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getRetrieveURL()
Can over overriden.String
getSearchURL()
List<String>
retrieveVersions(String pRepositoryId, String pGroupId, String pArtifactId, String pPackaging, ValidAndInvalidClassifier pClassifier)
void
setCredentials(String pUserName, String pUserPassword)
void
setUserName(String pUserName)
void
setUserPassword(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:
retrieveVersions
in interfaceIVersionReader
- Throws:
VersionReaderException
-
setUserName
public void setUserName(String pUserName)
- Specified by:
setUserName
in interfaceIVersionReader
-
setUserPassword
public void setUserPassword(String pUserPassword)
- Specified by:
setUserPassword
in interfaceIVersionReader
-
setCredentials
public void setCredentials(String pUserName, String pUserPassword)
- Specified by:
setCredentials
in interfaceIVersionReader
-
getSearchURL
public String getSearchURL()
-
getRetrieveURL
public String getRetrieveURL()
Can over overriden.- Returns:
- the URL where the artifacts are stored.
-
-