Search in sources :

Example 1 with DefaultProjectBuilderConfiguration

use of org.apache.maven.project.DefaultProjectBuilderConfiguration in project che by eclipse.

the class MavenServerImpl method internalInterpolate.

private static Model internalInterpolate(Model model, File projectDir) throws RemoteException {
    try {
        AbstractStringBasedModelInterpolator interpolator = new org.apache.maven.project.interpolation.StringSearchModelInterpolator(new DefaultPathTranslator());
        interpolator.initialize();
        //MavenServerUtil.collectSystemProperties();
        Properties props = new Properties();
        ProjectBuilderConfiguration config = new DefaultProjectBuilderConfiguration().setExecutionProperties(props);
        config.setBuildStartTime(new Date());
        model = interpolator.interpolate(model, projectDir, config, false);
    } catch (ModelInterpolationException e) {
        MavenServerContext.getLogger().warning(e);
    } catch (InitializationException e) {
        MavenServerContext.getLogger().error(e);
    }
    return model;
}
Also used : ProjectBuilderConfiguration(org.apache.maven.project.ProjectBuilderConfiguration) DefaultProjectBuilderConfiguration(org.apache.maven.project.DefaultProjectBuilderConfiguration) ModelInterpolationException(org.apache.maven.project.interpolation.ModelInterpolationException) AbstractStringBasedModelInterpolator(org.apache.maven.project.interpolation.AbstractStringBasedModelInterpolator) DefaultPathTranslator(org.apache.maven.project.path.DefaultPathTranslator) DefaultProjectBuilderConfiguration(org.apache.maven.project.DefaultProjectBuilderConfiguration) Properties(java.util.Properties) InitializationException(org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException) Date(java.util.Date)

Aggregations

Date (java.util.Date)1 Properties (java.util.Properties)1 DefaultProjectBuilderConfiguration (org.apache.maven.project.DefaultProjectBuilderConfiguration)1 ProjectBuilderConfiguration (org.apache.maven.project.ProjectBuilderConfiguration)1 AbstractStringBasedModelInterpolator (org.apache.maven.project.interpolation.AbstractStringBasedModelInterpolator)1 ModelInterpolationException (org.apache.maven.project.interpolation.ModelInterpolationException)1 DefaultPathTranslator (org.apache.maven.project.path.DefaultPathTranslator)1 InitializationException (org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException)1