Search in sources :

Example 1 with MavenSettings

use of org.springframework.boot.cli.compiler.maven.MavenSettings in project spring-boot by spring-projects.

the class SettingsXmlRepositorySystemSessionAutoConfiguration method apply.

@Override
public void apply(DefaultRepositorySystemSession session, RepositorySystem repositorySystem) {
    MavenSettings settings = getSettings(session);
    String localRepository = settings.getLocalRepository();
    if (localRepository != null) {
        session.setLocalRepositoryManager(repositorySystem.newLocalRepositoryManager(session, new LocalRepository(localRepository)));
    }
}
Also used : LocalRepository(org.eclipse.aether.repository.LocalRepository) MavenSettings(org.springframework.boot.cli.compiler.maven.MavenSettings)

Example 2 with MavenSettings

use of org.springframework.boot.cli.compiler.maven.MavenSettings in project spring-boot by spring-projects.

the class SettingsXmlRepositorySystemSessionAutoConfiguration method getSettings.

private MavenSettings getSettings(DefaultRepositorySystemSession session) {
    MavenSettings settings = new MavenSettingsReader().readSettings();
    session.setOffline(settings.getOffline());
    session.setMirrorSelector(settings.getMirrorSelector());
    session.setAuthenticationSelector(settings.getAuthenticationSelector());
    session.setProxySelector(settings.getProxySelector());
    return settings;
}
Also used : MavenSettingsReader(org.springframework.boot.cli.compiler.maven.MavenSettingsReader) MavenSettings(org.springframework.boot.cli.compiler.maven.MavenSettings)

Example 3 with MavenSettings

use of org.springframework.boot.cli.compiler.maven.MavenSettings in project spring-boot by spring-projects.

the class RepositoryConfigurationFactory method createDefaultRepositoryConfiguration.

/**
	 * Create a new default repository configuration.
	 * @return the newly-created default repository configuration
	 */
public static List<RepositoryConfiguration> createDefaultRepositoryConfiguration() {
    MavenSettings mavenSettings = new MavenSettingsReader().readSettings();
    List<RepositoryConfiguration> repositoryConfiguration = new ArrayList<>();
    repositoryConfiguration.add(MAVEN_CENTRAL);
    if (!Boolean.getBoolean("disableSpringSnapshotRepos")) {
        repositoryConfiguration.add(SPRING_MILESTONE);
        repositoryConfiguration.add(SPRING_SNAPSHOT);
    }
    addDefaultCacheAsRepository(mavenSettings.getLocalRepository(), repositoryConfiguration);
    addActiveProfileRepositories(mavenSettings.getActiveProfiles(), repositoryConfiguration);
    return repositoryConfiguration;
}
Also used : MavenSettingsReader(org.springframework.boot.cli.compiler.maven.MavenSettingsReader) ArrayList(java.util.ArrayList) RepositoryConfiguration(org.springframework.boot.cli.compiler.grape.RepositoryConfiguration) MavenSettings(org.springframework.boot.cli.compiler.maven.MavenSettings)

Aggregations

MavenSettings (org.springframework.boot.cli.compiler.maven.MavenSettings)3 MavenSettingsReader (org.springframework.boot.cli.compiler.maven.MavenSettingsReader)2 ArrayList (java.util.ArrayList)1 LocalRepository (org.eclipse.aether.repository.LocalRepository)1 RepositoryConfiguration (org.springframework.boot.cli.compiler.grape.RepositoryConfiguration)1