Search in sources :

Example 1 with MavenProfile

use of org.eclipse.che.maven.data.MavenProfile in project che by eclipse.

the class MavenModelUtil method convertProfiles.

private static List<MavenProfile> convertProfiles(List<Profile> profiles) {
    List<MavenProfile> result = new ArrayList<>();
    if (profiles != null) {
        for (Profile profile : profiles) {
            if (profile.getId() == null) {
                continue;
            }
            MavenProfile mavenProfile = new MavenProfile(profile.getId(), profile.getSource());
            List<String> modules = profile.getModules();
            if (modules == null) {
                mavenProfile.setModules(Collections.emptyList());
            } else {
                mavenProfile.setModules(modules);
            }
            mavenProfile.setActivation(convertActivation(profile.getActivation()));
            if (profile.getBuild() != null) {
                convertBaseBuild(profile.getBuild(), mavenProfile.getBuild());
            }
            result.add(mavenProfile);
        }
    }
    return result;
}
Also used : MavenProfile(org.eclipse.che.maven.data.MavenProfile) ArrayList(java.util.ArrayList) Profile(org.apache.maven.model.Profile) MavenProfile(org.eclipse.che.maven.data.MavenProfile)

Example 2 with MavenProfile

use of org.eclipse.che.maven.data.MavenProfile in project che by eclipse.

the class MavenModelUtil method convertToMavenProfile.

private static Profile convertToMavenProfile(MavenProfile mavenProfile) {
    Profile result = new Profile();
    result.setId(mavenProfile.getId());
    result.setSource(mavenProfile.getSource());
    result.setModules(mavenProfile.getModules());
    result.setProperties(mavenProfile.getProperties());
    result.setBuild(new Build());
    result.setActivation(convertToMavenActivation(mavenProfile.getActivation()));
    convertToMavenBuildBase(mavenProfile.getBuild(), result.getBuild());
    return result;
}
Also used : MavenBuild(org.eclipse.che.maven.data.MavenBuild) Build(org.apache.maven.model.Build) Profile(org.apache.maven.model.Profile) MavenProfile(org.eclipse.che.maven.data.MavenProfile)

Aggregations

Profile (org.apache.maven.model.Profile)2 MavenProfile (org.eclipse.che.maven.data.MavenProfile)2 ArrayList (java.util.ArrayList)1 Build (org.apache.maven.model.Build)1 MavenBuild (org.eclipse.che.maven.data.MavenBuild)1