use of org.apache.maven.project.path.DefaultPathTranslator in project intellij-community by JetBrains.
the class Maven30ServerEmbedderImpl method interpolateAndAlignModel.
@NotNull
public static MavenModel interpolateAndAlignModel(MavenModel model, File basedir) throws RemoteException {
Model result = MavenModelConverter.toNativeModel(model);
result = doInterpolate(result, basedir);
PathTranslator pathTranslator = new DefaultPathTranslator();
pathTranslator.alignToBaseDirectory(result, basedir);
return MavenModelConverter.convertModel(result, null);
}
use of org.apache.maven.project.path.DefaultPathTranslator in project intellij-community by JetBrains.
the class Maven30ServerEmbedderImpl method doInterpolate.
private static Model doInterpolate(Model result, File basedir) throws RemoteException {
try {
AbstractStringBasedModelInterpolator interpolator = new CustomMaven3ModelInterpolator(new DefaultPathTranslator());
interpolator.initialize();
Properties props = MavenServerUtil.collectSystemProperties();
ProjectBuilderConfiguration config = new DefaultProjectBuilderConfiguration().setExecutionProperties(props);
config.setBuildStartTime(new Date());
result = interpolator.interpolate(result, basedir, config, false);
} catch (ModelInterpolationException e) {
Maven3ServerGlobals.getLogger().warn(e);
} catch (InitializationException e) {
Maven3ServerGlobals.getLogger().error(e);
}
return result;
}
Aggregations