@@ -405,24 +405,6 @@ Result<Map<Artifact, List<Version>>> versions(
405405
406406 // POM editing
407407
408- /**
409- * The version operation mode to apply.
410- */
411- enum Op {
412- /**
413- * Always add: if exists "update" version, if not exist, create new entry with it.
414- */
415- UPSERT ,
416- /**
417- * Add only if it exists: "update" version, otherwise no-op.
418- */
419- UPDATE ,
420- /**
421- * Remove if exists.
422- */
423- DELETE
424- }
425-
426408 interface EditSession extends Closeable {
427409 Path editedPom ();
428410 }
@@ -462,12 +444,34 @@ default List<Artifact> calculateLatest(
462444 : versionSelector .apply (e .getKey (), e .getValue ())))
463445 .collect (Collectors .toList ());
464446 }
447+ /**
448+ * The operation subject to apply to.
449+ */
450+ enum OpSubject {
451+ MANAGED_PLUGINS ,
452+ PLUGINS ,
453+ MANAGED_DEPENDENCIES ,
454+ DEPENDENCIES
455+ }
465456
466- Result <List <Artifact >> doManagedPlugins (EditSession es , Op op , Source <Artifact > artifacts ) throws Exception ;
467-
468- Result <List <Artifact >> doPlugins (EditSession es , Op op , Source <Artifact > artifacts ) throws Exception ;
469-
470- Result <List <Artifact >> doManagedDependencies (EditSession es , Op op , Source <Artifact > artifacts ) throws Exception ;
457+ /**
458+ * The operation mode to apply.
459+ */
460+ enum Op {
461+ /**
462+ * Always alter: like if exists "update" version, if does not exist, create new entry with provided one.
463+ */
464+ UPSERT ,
465+ /**
466+ * Alter it only if it exists: like "update" version, otherwise no-op.
467+ */
468+ UPDATE ,
469+ /**
470+ * Remove, if exists.
471+ */
472+ DELETE
473+ }
471474
472- Result <List <Artifact >> doDependencies (EditSession es , Op op , Source <Artifact > artifacts ) throws Exception ;
475+ Result <List <Artifact >> doEdit (EditSession es , OpSubject subject , Op op , Source <Artifact > artifacts )
476+ throws Exception ;
473477}
0 commit comments