[MDEPLOY-193] Deploy At End feature (no extension)#20
Conversation
This PR makes deployAtEnd work as expected even if maven-deploy-plugin is not used as extension. How it works: it uses mojo Context to store "markers" (and params): * presence of marker means project was "processed" * value of marker tells what should be done (true = deploy, false = skipped) * if needed, other params are stored as well UTs adjusted to provide plugin context (was null before).
|
I'm pretty sure I wrote ITs for it, so if they keep working we should be safe. For Maven 3 (and likely 4) this would be fine until https://issues.apache.org/jira/browse/MNG-5666 has been implemented. |
| if ( altReleaseDeploymentRepository != null ) | ||
| { | ||
| getPluginContext().put( | ||
| DEPLOY_ALT_RELEASE_DEPLOYMENT_REPOSITORY, | ||
| altReleaseDeploymentRepository | ||
| ); | ||
| } | ||
| if ( altSnapshotDeploymentRepository != null ) | ||
| { | ||
| getPluginContext().put( | ||
| DEPLOY_ALT_SNAPSHOT_DEPLOYMENT_REPOSITORY, | ||
| altSnapshotDeploymentRepository | ||
| ); | ||
| } | ||
| if ( altDeploymentRepository != null ) | ||
| { | ||
| getPluginContext().put( | ||
| DEPLOY_ALT_DEPLOYMENT_REPOSITORY, | ||
| altDeploymentRepository | ||
| ); | ||
| } |
There was a problem hiding this comment.
If we can add null value - I would not check for null
There was a problem hiding this comment.
I still think that checking for null is not necessary.
There was a problem hiding this comment.
I am joining this question also.
There was a problem hiding this comment.
w/o nullcheck:
Caused by: java.lang.NullPointerException
at java.util.concurrent.ConcurrentHashMap.putVal (ConcurrentHashMap.java:1011)
at java.util.concurrent.ConcurrentHashMap.put (ConcurrentHashMap.java:1006)
at org.apache.maven.plugins.deploy.DeployMojo.execute (DeployMojo.java:183)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
You know, that plugin context is not a simple Map...
slawekjaranowski
left a comment
There was a problem hiding this comment.
We also need DEPLOY_PROCESSED_MARKER if deployAtEnd if false.
One module can override it.
|
@gnodet @michael-o @slawekjaranowski ping, let's agree all this PR does is:
So IMHO is def an improvement |
|
Same here |
I do agree. Minimal scope. |
Also, be clearer re intent. Still, cannot use enum directly, as due classloading, there is no single enum.
Done |
|
Resolve #524 |
This PR makes deployAtEnd work as expected even
if maven-deploy-plugin is not used as extension.
How it works: it uses mojo Context to store "state markers" (and params):
UTs adjusted to provide plugin context (was null before).
https://issues.apache.org/jira/browse/MDEPLOY-193