4444import org .apache .maven .api .Session ;
4545import org .apache .maven .api .plugin .Log ;
4646import org .apache .maven .api .plugin .Mojo ;
47- import org .apache .maven .api .xml .Dom ;
47+ import org .apache .maven .api .xml .XmlNode ;
4848import org .apache .maven .configuration .internal .EnhancedComponentConfigurator ;
4949import org .apache .maven .internal .impl .DefaultLog ;
50+ import org .apache .maven .internal .xml .XmlNodeImpl ;
5051import org .apache .maven .lifecycle .internal .MojoDescriptorCreator ;
5152import org .apache .maven .plugin .PluginParameterExpressionEvaluatorV4 ;
5253import org .apache .maven .plugin .descriptor .MojoDescriptor ;
@@ -176,13 +177,13 @@ private Mojo lookupMojo(
176177 Path path = Paths .get (getBasedir ()).resolve (pom );
177178 pomDom = Xpp3DomBuilder .build (ReaderFactory .newXmlReader (path .toFile ()));
178179 }
179- Dom pluginConfiguration = extractPluginConfiguration (coord [1 ], pomDom );
180+ XmlNode pluginConfiguration = extractPluginConfiguration (coord [1 ], pomDom );
180181 if (!mojoParameters .isEmpty ()) {
181- List <Dom > children = mojoParameters .stream ()
182- .map (mp -> new org . apache . maven . internal . xml . Xpp3Dom (mp .name (), mp .value ()))
182+ List <XmlNode > children = mojoParameters .stream ()
183+ .map (mp -> new XmlNodeImpl (mp .name (), mp .value ()))
183184 .collect (Collectors .toList ());
184- Dom config = new org . apache . maven . internal . xml . Xpp3Dom ("configuration" , null , null , children , null );
185- pluginConfiguration = Dom .merge (config , pluginConfiguration );
185+ XmlNode config = new XmlNodeImpl ("configuration" , null , null , children , null );
186+ pluginConfiguration = XmlNode .merge (config , pluginConfiguration );
186187 }
187188 Mojo mojo = lookupMojo (coord , pluginConfiguration , descriptor );
188189 return mojo ;
@@ -204,7 +205,8 @@ protected String[] mojoCoordinates(String goal) throws Exception {
204205 /**
205206 * lookup the mojo while we have all of the relavent information
206207 */
207- protected Mojo lookupMojo (String [] coord , Dom pluginConfiguration , PluginDescriptor descriptor ) throws Exception {
208+ protected Mojo lookupMojo (String [] coord , XmlNode pluginConfiguration , PluginDescriptor descriptor )
209+ throws Exception {
208210 // pluginkey = groupId : artifactId : version : goal
209211 Mojo mojo = lookup (Mojo .class , coord [0 ] + ":" + coord [1 ] + ":" + coord [2 ] + ":" + coord [3 ]);
210212 for (MojoDescriptor mojoDescriptor : descriptor .getMojos ()) {
@@ -244,25 +246,25 @@ protected Mojo lookupMojo(String[] coord, Dom pluginConfiguration, PluginDescrip
244246 return mojo ;
245247 }
246248
247- private Dom finalizeConfig (Dom config , MojoDescriptor mojoDescriptor ) {
248- List <Dom > children = new ArrayList <>();
249+ private XmlNode finalizeConfig (XmlNode config , MojoDescriptor mojoDescriptor ) {
250+ List <XmlNode > children = new ArrayList <>();
249251 if (mojoDescriptor != null && mojoDescriptor .getParameters () != null ) {
250- Dom defaultConfiguration =
252+ XmlNode defaultConfiguration =
251253 MojoDescriptorCreator .convert (mojoDescriptor ).getDom ();
252254 for (Parameter parameter : mojoDescriptor .getParameters ()) {
253- Dom parameterConfiguration = config .getChild (parameter .getName ());
255+ XmlNode parameterConfiguration = config .getChild (parameter .getName ());
254256 if (parameterConfiguration == null ) {
255257 parameterConfiguration = config .getChild (parameter .getAlias ());
256258 }
257- Dom parameterDefaults = defaultConfiguration .getChild (parameter .getName ());
258- parameterConfiguration = Dom .merge (parameterConfiguration , parameterDefaults , Boolean .TRUE );
259+ XmlNode parameterDefaults = defaultConfiguration .getChild (parameter .getName ());
260+ parameterConfiguration = XmlNode .merge (parameterConfiguration , parameterDefaults , Boolean .TRUE );
259261 if (parameterConfiguration != null ) {
260262 Map <String , String > attributes = new HashMap <>(parameterConfiguration .getAttributes ());
261263 if (isEmpty (parameterConfiguration .getAttribute ("implementation" ))
262264 && !isEmpty (parameter .getImplementation ())) {
263265 attributes .put ("implementation" , parameter .getImplementation ());
264266 }
265- parameterConfiguration = new org . apache . maven . internal . xml . Xpp3Dom (
267+ parameterConfiguration = new XmlNodeImpl (
266268 parameter .getName (),
267269 parameterConfiguration .getValue (),
268270 attributes ,
@@ -273,7 +275,7 @@ private Dom finalizeConfig(Dom config, MojoDescriptor mojoDescriptor) {
273275 }
274276 }
275277 }
276- return new org . apache . maven . internal . xml . Xpp3Dom ("configuration" , null , null , children , null );
278+ return new XmlNodeImpl ("configuration" , null , null , children , null );
277279 }
278280
279281 private boolean isEmpty (String str ) {
@@ -288,7 +290,7 @@ private static Stream<Xpp3Dom> children(Xpp3Dom element) {
288290 return Stream .of (element .getChildren ());
289291 }
290292
291- public static Dom extractPluginConfiguration (String artifactId , Xpp3Dom pomDom ) throws Exception {
293+ public static XmlNode extractPluginConfiguration (String artifactId , Xpp3Dom pomDom ) throws Exception {
292294 Xpp3Dom pluginConfigurationElement = child (pomDom , "build" )
293295 .flatMap (buildElement -> child (buildElement , "plugins" ))
294296 .map (MojoExtension ::children )
0 commit comments