-
Notifications
You must be signed in to change notification settings - Fork 74
fix DeployAtEnd failures #1
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
Conversation
Same PR as apache/maven-plugins#138. |
Great work. The Deploy Maven Plugin 2.8.2 deployAtEnd feature is not working with Maven 3 due to the different class realms (http://maven.apache.org/guides/mini/guide-maven-classloading.html) - so the static instance variables are useless. |
I referenced this PR on https://issues.apache.org/jira/browse/MDEPLOY-200. |
Interested in getting this fix merged. @khmarbaise Which repo should be used? I have an open PR myself on apache/maven-plugins because I didn't realize this repo existed. |
Unfortunately, this technique interferes with surefire/failsafe. The user properties must contain String properties. I could make the pojos into json encoding. Or, what other places can a plugin save information across invocations? It appears that plugin context is also tied to the ClassLoader. |
The serialization seems the easiest approach. I've written a quick & dirty modification to serialize/deserialize with XMLEncoder/XMLDecoder - which works with surefire. |
Any chance this PR is accepted one day? |
The point is, as already @chonton has stated it will not work without influences in other areas which is unfortunately not good... The other solution would be to change the Maven Core to handle such things differently which is not very easy MNG-5666 and keeping compatibility... |
As I've written before, this PR can be fixed without breaking other stuff by using any form of serialization: Just use the following class: DeployRequestList package org.apache.maven.plugin.deploy; import java.beans.XMLDecoder; import org.apache.maven.project.MavenProject; /**
*/
} And add serialize/deserialize functions to DeployRequest: public void serializeIn(XMLEncoder encoder) {
Then you can easily serialize the list into the property string. I don't think Maven Core will change its concept of different class loaders. So to hang up shared stuff in a shared variable is the way to go. |
Wouldn't it be possible to add a Note: You can't use the class itself as key because the classloader is part of the hashCode/equals. |
Can this be revisited to be merged? |
if ( reqs == null ) | ||
{ | ||
reqs = new ArrayList<ProjectDeployerRequest>( reactorProjects.size() ); | ||
projectProperties.put( propertyKey, reqs ); |
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.
How about serializing the value reqs
here (and deserialize on line 215)
Any update on this? |
Since implementation is difficult without changes to core, I've modified this pull request to be documentation only. |
Having multiple submodules declaring extensions cause the maven-deploy-plugin to not deploy artifacts when using -DdeployAtEnd=true. See apache/maven-deploy-plugin#1
I will verify it again, thanks for efforts |
I wish this had been merged and was available in documentation. Spent hours only to figure out that having one of the modules skip deployments makes the whole deployAtEnd silently fail to deploy anything at all |
Does that happen with latest m-deploy-p as well? |
yes v3.1.1 |
And how is the module skipped? Using the |
Can you create a simple reproducer and post it on GitHub (or wherever)? |
I see nothing in JIRA (all similar issues were reported against older versions, that yes, had known issues w/ skip). 3.1.1 should not have these issues (unless whole plugin is left out from execution, which is kinda "illegal" and could cause this): essentially, plugin should be always invoked (invoking it with skip=true also counts) to signal to plugin state "i am done" (even if did not anything as I was skipped). This PR is totally irrelevant and not applicable to m-deploy-p 3.1.1 FTR. Same for doco changes. So, if you have some issue with deployAtEnd, I'd like to see a reproducer for it. |
I tried to create small reproducible case but I am not able to. the project I am trying to deploy is https://github.com/ExpediaGroup/styx in github actions I run
If you have local server repo server to deploy and can try against. you can skip tests to make the build faster 3.8.8
vs
Ignore it fails, but you can see with 3.8.8 it is failing at deploy:deploy-file skipping deploy:deploy while with 3.9.5 it is actually failing at deploy:deploy phase which was supposed to do deployment of all the modules another interesting thing is if you remove one of the modules with |
Well,...
|
I thought GH uses latest maven! lessons learned I guess :) I agree controlling the version is the best. Thanks for your help |
Resolve #365 |
MDEPLOY-226: DeployAtEnd fails when module has extension
MDEPLOY-225: DeployAtEnd fails when overriding skip
MDEPLOY-224: Overriding deployAtEnd fails