On 7/30/2023 3:28 PM, Garret Wilson wrote:
… I also see that there is a `skipNexusStagingDeployMojo`, but that
appears to be neither a configuration property nor a user property,
but only a "plugin flag" which is "passed in from the CLI" using `-D`.
Is there a "skip" configuration property for the Nexus Staging Maven
Plugin ?
Answering my own question: yes, the `skipNexusStagingDeployMojo` "flag"
indeed seems to work as a "configuration property". Setting this to
`true` disables the entire Nexus Staging Plugin, and the default Maven
Deploy Plugin doesn't seem to run either (because I assume that the
Nexus Staging Plugin has disabled it anyway).
> [INFO] Skipping Nexus Staging Deploy Mojo at user's demand.
If I were to remove the Nexus Staging Plugin, I _assume_ that the Maven
Deploy Plugin would take effect, in which case I would need to set its
`skip` configuration property to `true` (or set the `maven.deploy.skip`
user property).
This simple answer is a big step forward, but it's only halfway to
easily turning this off in the child POM. (Yes, I want things to be
easier than redeclaring a plugin configuration in the child POM.) The
next "obvious" step is to create a user property to turn off the Nexus
Staging Plugin. And we already have one—the `maven.deploy.skip` user
property for the Maven Deploy Plugin! So all we have to do is add this
to the Nexus Staging Plugin:
```xml
<skipNexusStagingDeployMojo>${maven.deploy.skip}</skipNexusStagingDeployMojo>
```
Now the child POMs can turn off deployment by simply setting
`maven.deploy.skip` to `false`, and kill two birds with one stone:
deployment will be disabled whether the Nexus Staging Plugin or the
Maven Deploy Plugin was used.
See, things don't have to be difficult.
I have one more tweak to make things even easier and protect even more
against accidental deployment. I'll explain how in a separate message.
Best,
Garret
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org