@Override protected void interpolateObject(Object obj, Model model, File projectDir, ProjectBuilderConfiguration config, boolean debugEnabled) throws ModelInterpolationException { // IDEA-74131 avoid concurrent access to the static cache in StringSearchModelInterpolator synchronized (CustomMaven3ModelInterpolator.class) { try { super.interpolateObject(obj, model, projectDir, config, debugEnabled); } catch (NullPointerException e) { // npe may be thrown from here: //at org.apache.maven.project.interpolation.StringSearchModelInterpolator$InterpolateObjectAction.isQualifiedForInterpolation(StringSearchModelInterpolator.java:344) //at org.apache.maven.project.interpolation.StringSearchModelInterpolator$InterpolateObjectAction.traverseObjectWithParents(StringSearchModelInterpolator.java:172) //at org.apache.maven.project.interpolation.StringSearchModelInterpolator$InterpolateObjectAction.traverseObjectWithParents(StringSearchModelInterpolator.java:328) //at org.apache.maven.project.interpolation.StringSearchModelInterpolator$InterpolateObjectAction.run(StringSearchModelInterpolator.java:135) //at org.apache.maven.project.interpolation.StringSearchModelInterpolator$InterpolateObjectAction.run(StringSearchModelInterpolator.java:102) throw new ModelInterpolationException("Cannot interpolate", e); } } }
@Override protected void interpolateObject(Object obj, Model model, File projectDir, ProjectBuilderConfiguration config, boolean debugEnabled) throws ModelInterpolationException { // IDEA-74131 avoid concurrent access to the static cache in StringSearchModelInterpolator synchronized (CustomModelInterpolator.class) { try { super.interpolateObject(obj, model, projectDir, config, debugEnabled); } catch (NullPointerException e) { // npe may be thrown from here: //at org.apache.maven.project.interpolation.StringSearchModelInterpolator$InterpolateObjectAction.isQualifiedForInterpolation(StringSearchModelInterpolator.java:344) //at org.apache.maven.project.interpolation.StringSearchModelInterpolator$InterpolateObjectAction.traverseObjectWithParents(StringSearchModelInterpolator.java:172) //at org.apache.maven.project.interpolation.StringSearchModelInterpolator$InterpolateObjectAction.traverseObjectWithParents(StringSearchModelInterpolator.java:328) //at org.apache.maven.project.interpolation.StringSearchModelInterpolator$InterpolateObjectAction.run(StringSearchModelInterpolator.java:135) //at org.apache.maven.project.interpolation.StringSearchModelInterpolator$InterpolateObjectAction.run(StringSearchModelInterpolator.java:102) throw new ModelInterpolationException("Cannot interpolate", e); } } }
private void interpolateProject() throws InitializationException, Exception, ModelInterpolationException { StringSearchModelInterpolator interpolator = new StringSearchModelInterpolator(new DefaultPathTranslator()); interpolator.enableLogging(new PlexusLoggerAdapter(embedder.getLogger())); interpolator.initialize(); ProjectBuilderConfiguration config = new DefaultProjectBuilderConfiguration(); config.setLocalRepository(getLocalRepository()); config.setGlobalProfileManager(getProfileManager()); interpolator.interpolate(project.getModel(), project.getBasedir(), config, logger.isDebugEnabled()); }