Search in sources :

Example 1 with MavenProjectsCreator

use of org.gradle.buildinit.plugins.internal.maven.MavenProjectsCreator in project gradle by gradle.

the class PomProjectInitDescriptor method generate.

@Override
public void generate(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);
    }
}
Also used : MavenProject(org.apache.maven.project.MavenProject) MavenProjectsCreator(org.gradle.buildinit.plugins.internal.maven.MavenProjectsCreator) Maven2Gradle(org.gradle.buildinit.plugins.internal.maven.Maven2Gradle) File(java.io.File) MavenConversionException(org.gradle.buildinit.plugins.internal.maven.MavenConversionException) Settings(org.apache.maven.settings.Settings) MavenConversionException(org.gradle.buildinit.plugins.internal.maven.MavenConversionException)

Aggregations

File (java.io.File)1 MavenProject (org.apache.maven.project.MavenProject)1 Settings (org.apache.maven.settings.Settings)1 Maven2Gradle (org.gradle.buildinit.plugins.internal.maven.Maven2Gradle)1 MavenConversionException (org.gradle.buildinit.plugins.internal.maven.MavenConversionException)1 MavenProjectsCreator (org.gradle.buildinit.plugins.internal.maven.MavenProjectsCreator)1