-
Notifications
You must be signed in to change notification settings - Fork 2
[MWRAPPER-14] put all wrapper pieces in one build #1
base: master
Are you sure you want to change the base?
Conversation
I'm not convinced this is the right thing to do. If you compare the original mvn and mvnw script when it was donated, you should have noticed that they both went their own way. It took me quite some time to get them in sync and to pick the best of both. By splitting it up it will happen again. Moving the wrapper to here, does that mean that this plugin must be released every time is released too, like the takari plugin used to do? Then we've lost the benefit of the current setup, because most likely the plugin now doesn't require new releases. |
I completely value the work done to sync mvn and mvnw: syncing again is just about copying the 6 partial scripts to on releasing, there is only 1 simultaneous release for the 3 artifacts: wrapper, wrapper distribution and wrapper-plugin = the full wrapper, clearly separate from the Maven distribution. It is really simple and logical. with the latest commits, the new wrapper is working well with whatever Maven version |
So how do you intend to keep up with changes like apache/maven#602 ? |
Another idea ... why not simply call In this case code will be in one place |
@slawekjaranowski if that would work, that would be a much more acceptable solution for me. |
yes, instead of copying by hand partial scripts from https://github.com/apache/maven/tree/master/apache-maven/src/assembly/shared to current project source https://github.com/apache/maven-wrapper-plugin/tree/MWRAPPER-14/maven-wrapper-distribution/src/assembly/maven , it can be automated => I'll add this soon |
I think that running so what will happen when we have newer scripts in wrapper and want to setup older Maven to use ... |
oh, yes, sorry, please forget my previous comment: morning coffe took more time than I expected to warm up my brain :) Yes, having to implement it, we'll need to have |
I created https://issues.apache.org/jira/browse/MWRAPPER-16 to track this very good idea on |
- wrapper (maven-wrapper.jar) - wrapper distribution (mvnw scripts) - wrapper plugin
That's a great idea. I originally thought of a tiny plugin (I think one might actually exist) to have the core grab the scripts from the wrapper for reuse, but your idea is far better and essentially zero maintenance. |
Historically the Maven Wrapper has been separate, and I believe works well that way. Its concern to bring Maven into existence for build, and I would argue that should be any version of Maven. The simple fact that the Takari Maven Wrapper still needs to exist is an indication that we have an issue. I understand the maintenance issue with the scripts, but I think @slawekjaranowski has an elegant solution to that problem. I would very much like to archive the Takari Maven Wrapper repository, and add some features to the wrapper at Apache. With the wrapper separated we may even be able to help people still using Maven 2.x (I've seen lots of 2.x projects) as the wrapper makes CI so much easier. But again, I think the wrapper has a separate concern, and we may want to add new features to the wrapper and it's been very nice with the Takari Maven Wrapper to just release it when necessary without concern for any particular version of Maven. But I do think having the wrapper and wrapper plugin together makes sense. I didn't think about it very hard with the Takari Wrapper but it definitely would have been easier if all the wrapper capability was together. I think what's in the PR here with the addendum of @slawekjaranowski's solution is ideal. |
The only potential problem I see is that a script calls another script that calls java. Should be easy to validate. |
From wrapper perspective should not be important what We should assume that |
ok, so no objection to merge this PR? |
it still contains the copy of the original scripts, right? Then I'm -1. |
wrong logic: not merging MWRAPPER-14 (and not releasing a usable wrapper) does not help on evolving with MWRAPPER-16 please think again: scripts released as part of Maven core do not help to have consistency between wrapper scripts copied to project Git and scripts from downloaded Maven distribution = the right objective we share. It just helps on their maintenance in ASF Git (between maven.git and maven-wrapper-plugin.git), at the cost of a confusing release cycle and limitation on possible target Maven version (future Maven 4 only) but at least, I can create MWRAPPER-16 branch to be merged to MWRAPPER-14: it's just sad to not be able to work in a constructive way |
@rfscholte are you fine with a first step of dynamically importing the scripts and implementing the more sophisticated https://issues.apache.org/jira/browse/MWRAPPER-16 later? I’d really like to shut down the Takari Wrapper repo sooner rather than later, if possible. |
This commit touches 75 files, and after MWRAPPER-16 a lot of them are removed. |
|
||
public static final String MVNW_REPOURL = "MVNW_REPOURL"; | ||
|
||
public static final String MVN_VERSION = "3.8.3"; |
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 this value needs to be in sync with the Maven release, then this class (and its artifact) doesn't belong here.
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.
yes, the more I'm merging back everything in one build, the more I'm in fact reverting many changes that were done while you tried to put some pieces in Maven core
you're probably right, instead of continuing the current branch, we probably better start again from original maven-wrapper history and merge maven-wrapper-plugin in it: that may be easier to get to a new stable situation
is it what you had in mind?
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.
Right, so there are a couple of things that have been solved by moving it from takari to maven-core:
- no additional releases required.
- identical scripts are in sync.
We shouldn't loose these improvements.
last try:
This approach of wrapper does not need any releases when new Maven versions are released, and can work with any version from the past and any Maven SNAPSHOT (like the original donation) Getting identical features of installed all, please review: in the end, I expect to create a maven-wrapper.git repository containing my initial work (that contains initial donation), and we'll track future features an release normally in MWRAPPER Jira |
@hboutemy great job. I've tested by:
In this point of time I'm not looking deeper in code, simple build and use. I think that push this code to public repo and release this version as is - will be the best approach. Next improvement can be done in small, easy to review changes. |
I run the following in the cloned repository itself:
Which yields:
All I have in the
@slawekjaranowski how did you test it? |
in
and in other project
important is
|
@hboutemy I think that's poor default behavior, the |
Of course,
|
I'm not sure why the slight change was made, but the latest published instructions put the JAR in there by default. Just a warning that it's asking for potential support issues. Maybe someone has one network setup and commits the wrapper change not noticing the JAR isn't there. Changes network setups and their network or corporate setup doesn't allow access. I think it's nicer not to have any JARs checked in but changing the way it works before it's released may not make for a great first release. |
the issue you have is only with SNAPSHOTs of maven-wrapper, that are obviously not published to central during development with SNAPSHOT maven-wrapper, see last section of https://maven.apache.org/wrapper-archives/wrapper-LATEST/ |
but for sure, there is the question: what should be the default? current |
thinking at default type more in depth, I think that I now understand the logic thinking like this, I now feel that yes, |
The choice for |
There are still things in the code I want to comment on, but that's hard to describe here. |
Can https://github.com/hboutemy/maven-wrapper be cloned to maven-studies? That makes it easier for everybody to do their changes. |
ok, code pushed in MWRPPER-14 branch in maven-studies https://github.com/apache/maven-studies/tree/MWRAPPER-14 |
making script the default is not sufficient, because if .mvn/wrapper/maven-wrapper.jar or *.jar is not in .gitignore, the jar will inevitably come into future Git commit, not by the guy who did then forcing |
In the end the-person-that-called-wrapper:wrapper should decide. It is a matter of a "sources-only repository" (either download via script or Java) versus "don't download", not the "cloner/forker". IIUC everything is configurable to download, including repo-manager, proxy, etc. It should be possible to guide in case it doesn't work. Also, regarding the potential unintended commit: the plugin could help here generating scm-specific ignore files. |
Wrapper consists in 3 pieces:
that should have the same version = "the wrapper version"
the wrapper plugin will unpack wrapper distribution with the same version as the plugin
the only drawback vs releasing wrapper jar and wrapper distribution in the Apache Maven core release is that partial mvn scripts (3 shell and 3 cmd) are copied
but in terms of versions clarity, seems much easier to understand: wrapper is something, Maven is something
notice that this is a WIP: I did not yet review maven-wrapper-plugin logic to select the distribution version