-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we can add null value - I would not check for null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still think that checking for null is not necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am joining this question also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
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