Class MavenContext
java.lang.Object
org.jdrupes.builder.mvnrepo.MavenContext
Manages a global instance of
RepositorySystem and
RepositorySystemSession and provides lists of RemoteRepositorys
from profiles in settings.xml.-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanlookupCredentials(String serverId, BiConsumer<String, String> consumer) Looks up the credentials for the specified server insettings.xml.static org.eclipse.aether.repository.RemoteRepositoryReturns theRemoteRepositoryfor Maven Central.static Stream<org.eclipse.aether.repository.RemoteRepository> repositories(String profileId) Return theRemoteRepositorys from the specified profile.static Stream<org.eclipse.aether.repository.RemoteRepository> repositories(Settings settings, String profileId) Return theRemoteRepositorys from the specified settings and profile.static org.eclipse.aether.RepositorySystemSessionRepository session.static org.eclipse.aether.RepositorySystemRepository system.
-
Method Details
-
repositorySystem
Repository system.- Returns:
- the repository system
-
repositorySession
Repository session.- Returns:
- the repository system session
-
lookupCredentials
Looks up the credentials for the specified server insettings.xml. Invokes the consumer with the username and password if found.- Parameters:
serverId- the server idconsumer- the consumer- Returns:
- true, if found
-
mavenCentral
Returns theRemoteRepositoryfor Maven Central.- Returns:
- the remote repository
-
repositories
Return theRemoteRepositorys from the specified profile.- Parameters:
profileId- the profile id- Returns:
- the repositories
-
repositories
public static Stream<org.eclipse.aether.repository.RemoteRepository> repositories(Settings settings, String profileId) Return theRemoteRepositorys from the specified settings and profile.- Parameters:
settings- the settingsprofileId- the profile id- Returns:
- the repositories
-