Having thought about it further overnight, I think what I’m trying to do really 
needs to be incorporated into the plugin (liquibase) itself, so I’ll contact 
the owners to see if that’s something they’d be open to. In the meantime, it’s 
back to printed checklists and old-school sign-off, plus some resetting of 
database account passwords to reinforce the message. 😊

Later,

Andy

From: Mirko Friedenhagen <mfriedenha...@gmx.de.INVALID>
Date: Friday, 15 August 2025 at 08:34
To: Maven Users List <users@maven.apache.org>
Subject: Re: Require confirmation before running a plugin goal

I think with Maven 4 you may combine conditions for profile activation and can 
Even have boolean logic . So may requiring another property set for 
prod+liquibase should be possible.
Mit freundlichen Grüßen
Mirko Friedenhagen
—
Sent from my mobile

> Am 14.08.2025 um 21:36 schrieb Andy Law <andy....@roslin.ed.ac.uk>:
>
> Thanks. Those are interesting ideas.
>
> Later,
>
> Andy.
>
> From: Tamás Cservenák <ta...@cservenak.net>
> Date: Thursday, 14 August 2025 at 17:57
> To: Maven Users List <users@maven.apache.org>
> Subject: Re: Require confirmation before running a plugin goal
>
> Howdy,
>
> This most certainly cannot be an enforcer rule to "watch" some plugin
> execution (as it may be too late).
>
> But this reminds me of an "experiment" we were tinkering with:
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Fmaven%2Fpull%2F1086&data=05%7C02%7C%7Cb3c5eed082714a49cc4a08dddbce353b%7C2e9f06b016694589878910a06934dc61%7C0%7C0%7C638908400883749514%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=0qtYo%2BA5OksPRE%2BsYYP36kGQYwy9F2S48DcYddBo%2B%2Bw%3D&reserved=0<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fapache%2Fmaven%2Fpull%2F1086&data=05%7C02%7C%7Cb3c5eed082714a49cc4a08dddbce353b%7C2e9f06b016694589878910a06934dc61%7C0%7C0%7C638908400883779500%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=wDLij%2FHHq6%2FAtt9a9TapPQgDNFbIGZPmgLfgUPoXdkg%3D&reserved=0><https://github.com/apache/maven/pull/1086>
>
> Here the idea was to be able to instruct Maven (without tampering with
> POM) to "skip" certain plugin executions. Now, instead of
> filter/match/remove. something else can happen here, like:
> - filter
> - match
> - some action, like "remove" (as in PR), but it could be prompt, and
> if response is 'Y' NOT remove, etc
> This is just to show the internal, I'd NOT recommend going this route.
>
> Another (much simpler to implement) idea: an extension that inspect
> the (effective) model, and collects plugin executions of interests and
> does something.... ?
> To inspect model here is an example:
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fsonatype%2Fnexus-maven-plugins%2Fblob%2Ff5ba90d339064c4981716a98e4afa6a76bc3ff2e%2Fstaging%2Fmaven-plugin%2Fsrc%2Fmain%2Fjava%2Forg%2Fsonatype%2Fnexus%2Fmaven%2Fstaging%2Fdeploy%2FDeployLifecycleParticipant.java%23L88&data=05%7C02%7C%7Cb3c5eed082714a49cc4a08dddbce353b%7C2e9f06b016694589878910a06934dc61%7C0%7C0%7C638908400883796844%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=z7Sf%2BJfRlnQjstt4YHxBLK9n055W3pItsIrPxWkihXE%3D&reserved=0<https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fsonatype%2Fnexus-maven-plugins%2Fblob%2Ff5ba90d339064c4981716a98e4afa6a76bc3ff2e%2Fstaging%2Fmaven-plugin%2Fsrc%2Fmain%2Fjava%2Forg%2Fsonatype%2Fnexus%2Fmaven%2Fstaging%2Fdeploy%2FDeployLifecycleParticipant.java%23L88&data=05%7C02%7C%7Cb3c5eed082714a49cc4a08dddbce353b%7C2e9f06b016694589878910a06934dc61%7C0%7C0%7C638908400883816239%7CUnknown%7CTWFpbGZsb3d8eyJFbXB0eU1hcGkiOnRydWUsIlYiOiIwLjAuMDAwMCIsIlAiOiJXaW4zMiIsIkFOIjoiTWFpbCIsIldUIjoyfQ%3D%3D%7C0%7C%7C%7C&sdata=LyEUJjK6xrJdxR0NdnwNkcBGOJbncqSe3KDi%2FDmocRI%3D&reserved=0><https://github.com/sonatype/nexus-maven-plugins/blob/f5ba90d339064c4981716a98e4afa6a76bc3ff2e/staging/maven-plugin/src/main/java/org/sonatype/nexus/maven/staging/deploy/DeployLifecycleParticipant.java#L88>
> I'd advise to NOT modify the model (like remove the plugin), but instead:
> - check model
> - IF plugin/goal of interest detected, perform some action: prompt, yada
> - basically fail the build if plugin would run, but user did not
> provide "consent" for it
>
> This could be a nice generic extension, where user of extension could
> provide some configuration like:
> G:A:goal = FAIL < fails the build if this plugin goal is detected to be 
> executed
> G:A:goal = APPROVE < makes a prompt, fail or continue the build
> depending on user input
> etc
>
> My 5 cents
>
> Thanks
> T
>
>> On Thu, Aug 14, 2025 at 6:04 PM Andy Law <andy....@roslin.ed.ac.uk> wrote:
>>
>> I recognise that I may be over-reaching with my wish list, but any and all 
>> constructive suggestions are welcomed.
>>
>> I have a project that uses liquibase to manage the database structure. I 
>> store the connection credentials in profiles in my settings.xml file and 
>> have an enforcer rule to ensure that one, and only one, of the develop, 
>> sandbox, and production profiles is active when I run maven.
>>
>> I stash the liquibase changes in a sub-module of the project and only run 
>> the plugin goals when needed. I would like to have the build/run plugin 
>> process prompt me to confirm that I really mean to do what I’m trying to do 
>> if I run the liquibase plugin with the production profile active.
>>
>> So:
>>
>>  *
>> clean, install, validate, test etc. under normal circumstances, run with one 
>> of the profiles active and don’t warn.
>>  *
>> run liquibase:update with the develop or sandbox profiles active - again, 
>> don’t warn
>>  *
>> run liquibase:update with the production profile active - I want maven to 
>> ask me to confirm that I really mean to do that.
>>
>>
>> The liquibase plugin has a “promptOnNonLocalDatabase” option, but I can’t 
>> use that because the connections to the database are tunnelled so they all 
>> appear as local as far as the plugin process is concerned.
>>
>> I’m happy enough to hack together code to do this if there is no current 
>> solution to the problem, but I’m not sure how I would go about tying 
>> something like an enforcer rule to just the liquibase plugin executions.
>>
>> Does anyone think this is possible?
>>
>>
>> Later,
>>
>>
>>
>> Andy
>>
>> --------
>>
>> Yada, yada, yada...
>>
>>
>>
>> Disclaimer: This e-mail and any attachments are confidential and intended 
>> solely for the use of the recipient(s) to whom they are addressed. If you 
>> have received it in error, please destroy all copies and inform the sender.
>>
>>
>>
>> The University of Edinburgh is a charitable body, registered in Scotland, 
>> with registration number SC005336. Is e buidheann carthannais a th’ ann an 
>> Oilthigh Dhùn Èideann, clàraichte an Alba, àireamh clàraidh SC005336.
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
> For additional commands, e-mail: users-h...@maven.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to