use of org.springframework.boot.cli.compiler.grape.RepositoryConfiguration in project spring-boot by spring-projects.
the class RepositoryConfigurationFactoryTests method assertRepositoryConfiguration.
private void assertRepositoryConfiguration(List<RepositoryConfiguration> configurations, String... expectedNames) {
assertThat(configurations).hasSize(expectedNames.length);
Set<String> actualNames = new HashSet<>();
for (RepositoryConfiguration configuration : configurations) {
actualNames.add(configuration.getName());
}
assertThat(actualNames).containsOnly(expectedNames);
}
use of org.springframework.boot.cli.compiler.grape.RepositoryConfiguration in project spring-boot by spring-projects.
the class GroovyGrabDependencyResolverTests method setupResolver.
@Before
public void setupResolver() {
GroovyCompilerConfiguration configuration = new GroovyCompilerConfiguration() {
@Override
public boolean isGuessImports() {
return true;
}
@Override
public boolean isGuessDependencies() {
return true;
}
@Override
public boolean isAutoconfigure() {
return false;
}
@Override
public GroovyCompilerScope getScope() {
return GroovyCompilerScope.DEFAULT;
}
@Override
public List<RepositoryConfiguration> getRepositoryConfiguration() {
return RepositoryConfigurationFactory.createDefaultRepositoryConfiguration();
}
@Override
public String[] getClasspath() {
return new String[] { "." };
}
};
this.resolver = new GroovyGrabDependencyResolver(configuration);
}
use of org.springframework.boot.cli.compiler.grape.RepositoryConfiguration 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;
}
Aggregations