use of org.apache.maven.settings.Settings in project sling by apache.
the class BundleListUtils method createInterpolator.
public static Interpolator createInterpolator(MavenProject project, MavenSession mavenSession) {
StringSearchInterpolator interpolator = new StringSearchInterpolator();
final Properties props = new Properties();
props.putAll(project.getProperties());
props.putAll(mavenSession.getSystemProperties());
props.putAll(mavenSession.getUserProperties());
interpolator.addValueSource(new PropertiesBasedValueSource(props));
// add ${project.foo}
interpolator.addValueSource(new PrefixedObjectValueSource(Arrays.asList("project", "pom"), project, true));
// add ${session.foo}
interpolator.addValueSource(new PrefixedObjectValueSource("session", mavenSession));
// add ${settings.foo}
final Settings settings = mavenSession.getSettings();
if (settings != null) {
interpolator.addValueSource(new PrefixedObjectValueSource("settings", settings));
}
return interpolator;
}
use of org.apache.maven.settings.Settings in project gradle by gradle.
the class PomProjectInitDescriptor method generate.
@Override
public void generate(BuildInitDsl dsl, BuildInitTestFramework testFramework) {
SingleMessageLogger.incubatingFeatureUsed("Maven to Gradle conversion");
File pom = fileResolver.resolve("pom.xml");
try {
Settings settings = settingsProvider.buildSettings();
Set<MavenProject> mavenProjects = new MavenProjectsCreator().create(settings, pom);
new Maven2Gradle(mavenProjects, fileResolver.resolve(".")).convert();
} catch (Exception exception) {
throw new MavenConversionException(String.format("Could not convert Maven POM %s to a Gradle build.", pom), exception);
}
}
Aggregations