Search in sources :

Example 1 with Profile

use of org.apache.maven.settings.Profile in project spring-boot by spring-projects.

the class MavenSettings method createModelProfiles.

private List<org.apache.maven.model.Profile> createModelProfiles(List<Profile> profiles) {
    List<org.apache.maven.model.Profile> modelProfiles = new ArrayList<>();
    for (Profile profile : profiles) {
        org.apache.maven.model.Profile modelProfile = new org.apache.maven.model.Profile();
        modelProfile.setId(profile.getId());
        if (profile.getActivation() != null) {
            modelProfile.setActivation(createModelActivation(profile.getActivation()));
        }
        modelProfiles.add(modelProfile);
    }
    return modelProfiles;
}
Also used : ArrayList(java.util.ArrayList) Profile(org.apache.maven.settings.Profile)

Example 2 with Profile

use of org.apache.maven.settings.Profile in project spring-boot by spring-projects.

the class RepositoryConfigurationFactory method addActiveProfileRepositories.

private static void addActiveProfileRepositories(List<Profile> activeProfiles, List<RepositoryConfiguration> configurations) {
    for (Profile activeProfile : activeProfiles) {
        Interpolator interpolator = new RegexBasedInterpolator();
        interpolator.addValueSource(new PropertiesBasedValueSource(activeProfile.getProperties()));
        for (Repository repository : activeProfile.getRepositories()) {
            configurations.add(getRepositoryConfiguration(interpolator, repository));
        }
    }
}
Also used : Repository(org.apache.maven.settings.Repository) RegexBasedInterpolator(org.codehaus.plexus.interpolation.RegexBasedInterpolator) Interpolator(org.codehaus.plexus.interpolation.Interpolator) RegexBasedInterpolator(org.codehaus.plexus.interpolation.RegexBasedInterpolator) PropertiesBasedValueSource(org.codehaus.plexus.interpolation.PropertiesBasedValueSource) Profile(org.apache.maven.settings.Profile)

Example 3 with Profile

use of org.apache.maven.settings.Profile in project maven-plugins by apache.

the class SettingsSitePublishVariableStub method getProfiles.

@Override
public List<Profile> getProfiles() {
    Profile p = new Profile();
    p.setId("site-location");
    p.addProperty("sitePublishLocation", "file://tmp/sitePublish");
    return Collections.singletonList(p);
}
Also used : Profile(org.apache.maven.settings.Profile)

Example 4 with Profile

use of org.apache.maven.settings.Profile in project maven-plugins by apache.

the class EffectiveSettingsMojo method cleanSettings.

/**
     * Apply some logic to clean the model before writing it.
     *
     * @param settings not null
     */
private static void cleanSettings(Settings settings) {
    List<Profile> profiles = settings.getProfiles();
    for (Profile profile : profiles) {
        Properties properties = new SortedProperties();
        properties.putAll(profile.getProperties());
        profile.setProperties(properties);
    }
}
Also used : Properties(java.util.Properties) Profile(org.apache.maven.settings.Profile)

Aggregations

Profile (org.apache.maven.settings.Profile)4 ArrayList (java.util.ArrayList)1 Properties (java.util.Properties)1 Repository (org.apache.maven.settings.Repository)1 Interpolator (org.codehaus.plexus.interpolation.Interpolator)1 PropertiesBasedValueSource (org.codehaus.plexus.interpolation.PropertiesBasedValueSource)1 RegexBasedInterpolator (org.codehaus.plexus.interpolation.RegexBasedInterpolator)1