-
Notifications
You must be signed in to change notification settings - Fork 70
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-265] Maintain backwards compatibility for alt*DeploymentRepository in id::default::url format #15
Conversation
…sitory in id::default::url format The legacy format (<=2.x) of alt*DeploymentRepository is id::layout::url. The new format (>= 3.x) of alt*DeploymentRepository is id::url, which is equivalent to id::default:url from the legacy format. This change introduces backwards compatibility with 2.x by supporting alt*DeploymentRepository values in the id::layout::url format if and only if the layout is equal to "default". The "default" layout is the most commonly used layout, so this should maintain backwards compatibility with the large majority of projects using the alt*DeploymentRepository properties. Usage of the legacy format with the "default" layout will result in a warning message being logged. Usage of the legacy format with layouts other than "default" will result in an exception being thrown. One use case this change will help is when alt*DeploymentRepository properties are set in common maven settings.xml files used for a large number of projects. For example, a CI server. Keeping backwards compatibilty with id::default::url allows those settings.xml files to be used regardless of the version of maven-deploy-plugin used by the projects built on that CI server. Projects can individually upgrade their maven-deploy-plugin without breaking.
@cstamas WDYT? |
My original change was doing exactly this, so I am +1 on this (so "legacy syntax w/ default layout should work + warn), but there was a discussion where we agreed that ANY unexpected syntax should fail the build. So, again, I am +1, but @mickroll? |
Build Warning is fine aswell. 👍 |
Hmm, this should have happened pre 3.0.0 🤣. My proposal is to allow this during milestone phase, but ultimately drop with GA. |
FWIW, I would like to keep these changes in 3.0 GA. For me, it's not useful unless it makes it into GA. It seems like such a small amount of code for huge wins in compatibility. |
Let me think about that and come back to you later. |
Can you please describe why this is so important to you since this is a non-standard case? |
Sure thing. We have an artifactory instance in our corporate environment to which we deploy thousands of our own artifacts. This is a large corporate environment that supports many, many dev teams. We do not specify a We want to allow projects to upgrade the version of maven-deploy-plugin used in their projects at their own pace. And we want the builds to continue to work and deploy correctly when they do upgrade maven-deploy-plugin without any other changes to the build pipeline. This transparency requires backwards compatibility of the There are several alternatives, but none are very desirable
In short, not maintaining backwards compatibility of this format will cause us a tremendous amount of toil. That toil can be easily avoided if the format remains backwards compatible. The code to keep backwards compatibility is straightforward and simple, and totally worth it. |
I agree with Phil. 3.0.0-M1 made it wrong: old |
@philsttr Thanks for your elaboration. There are few nits with your settings which you should correct:
Now back to your approach: As far as I understand the target repo does not depend on the group/artifact id, but no the CI server performing actions? |
(I do not quite understand the question, but I'll attempt to answer what I think you are asking. If this does not answer your question, please clarify the question.) Each of our many repos define their dependencies and plugins, and version of each. They are free to use whatever they need. They are currently using various versions of the maven-deploy-plugin (but not 3.0.0-M1, since that broke compatibility). The CI server does not define dependencies, plugins, or versions. |
Sorry for the confusion. There was a nasty typo in my question. I wll rephrase: How do you know/decide on the CI server to which hosted repo a deployment will go and why is not possible to have that kind of information staticially in the POMs? |
We have one shared artifactory instance to which all artifacts are published. All CI servers use the same We prefer to centrally manage the distribution settings on our CI servers via |
OK, let me summarize: You update at most 5 CI servers for new URLs instead to manipulate the corporate POM and then need to update all dependend projects (thousands)? |
Correct. And to clarify 'you' in your statement... the infrastructure teams handle the updates to CI, settings.xml, and artifactory. It's transparent to developers. Devs don't need to know anything about this stuff. All they need to know is to create a maven project, and the artifacts are deployed where they are supposed to go automatically. |
But you still have to maintain developer settings to resolve artifactsduring coding, right? |
Yes, the same settings.xml file is used by developers as part of automated dev environment setup/maintenance. |
Thank you very much making your setup clear. I will re-review this PR today and go ahead with the merge. |
@philsttr It'd be awesome if you could share/write down your approach as a single page for our Maven Site Guides as "Large Scale Centralized Deployments with Maven". |
@michael-o I'd be happy to. Where are the Maven Site Guides located? Can you point me to where I should submit a PR? |
[MDEPLOY-265] Maintain backwards compatibility for
alt*DeploymentRepository
inid::default::url
formatThe legacy format (<=2.x) of
alt*DeploymentRepository
isid::layout::url
.The new format (>= 3.x) of
alt*DeploymentRepository
isid::url
, which is equivalent toid::default::url
from the legacy format.This change introduces backwards compatibility with 2.x by supporting
alt*DeploymentRepository
values in theid::layout::url
format if and only if the layout is equal todefault
. Thedefault
layout is the most commonly used layout, so this should maintain backwards compatibility with the large majority of projects using thealt*DeploymentRepository
properties.Usage of the legacy format with the
default
layout will result in a warning message being logged.Usage of the legacy format with layouts other than
default
will result in an exception being thrown.One use case this change will help is when
alt*DeploymentRepository
properties are set in common mavensettings.xml
files used for a large number of projects. For example, a CI server. Keeping backwards compatibility withid::default::url
allows thosesettings.xml
files to be used regardless of the version of maven-deploy-plugin used by the projects built on that CI server. Projects can individually upgrade their maven-deploy-plugin without breaking.Following this checklist to help us incorporate your
contribution quickly and easily:
for the change (usually before you start working on it). Trivial changes like typos do not
require a JIRA issue. Your pull request should address just this issue, without
pulling in other changes.
[MPH-XXX] - Fixes bug in ApproximateQuantiles
,where you replace
MPH-XXX
with the appropriate JIRA issue. Best practiceis to use the JIRA issue title in the pull request title and in the first line of the
commit message.
mvn clean verify
to make sure basic checks pass. A more thorough check willbe performed on your pull request automatically.
mvn -Prun-its clean verify
).If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.
To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.
I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004
In any other case, please file an Apache Individual Contributor License Agreement.