Make Maven reactor build work#1522
Conversation
| <parent> | ||
| <groupId>io.kubernetes</groupId> | ||
| <artifactId>client-java-examples-parent</artifactId> | ||
| <version>11.0.1-SNAPSHOT</version> |
There was a problem hiding this comment.
I don't think we want this, do we? This makes these examples part of the overall release build (which definitely messed things up before.
There was a problem hiding this comment.
It doesn't get deployed because the parent has <skip>true</true> in the the deploy plugin. What else could go wrong?
There was a problem hiding this comment.
The maven release plugin looks for these strings and replaces them every time you run a release.
There was a problem hiding this comment.
The trick is to not make your modules break if the project version changes. I don't think this one will. It looks safe to me.
| <kubernetes.client.version>${project.version}</kubernetes.client.version> | ||
| </properties> | ||
|
|
||
| <modules> |
There was a problem hiding this comment.
I explicitly pulled this out last time I did a release because I didn't want these included in the release.
There was a problem hiding this comment.
This isn't anything to do with a release. It's just a property that is used to specify a dependency.
There was a problem hiding this comment.
The maven release plugin pulls in everything that is referenced by the top level POM (at least it did the last time I ran a release) so including these as sub-modules for this pom causes them to get pulled into a release.
There was a problem hiding this comment.
You can switch off plugins with skip=true (as is done for the deploy plugin in the examples here). But that's probably not what you want - you want to just make sure that the projects don't break if their artifact version changes. I'm pretty sure these ones don't now. The problem is that without this change nothing in the examples is built automatically from the top level, so it's easy to miss something important when refactoring.
There was a problem hiding this comment.
The problem is that without this change nothing in the examples is built automatically from the top level, so it's easy to miss something important when refactoring.
my IDE (intellj-idea) won't build the examples unless applying some tricky manual configuration. i suppose we can explicitly skip the deploying steps for the release plugin here's an example configuration
There was a problem hiding this comment.
Actually I don't know because I don't know how the release was performed. Is there a script or something? I don't see it in the Github actions.
There was a problem hiding this comment.
This is strange, for instance, given that I believe the release plugin has been used: https://github.com/kubernetes-client/java/blob/master/pom.xml#L421 (<skip>true</skip> in the parent). I'm not sure that's a good idea. But mvn deploy would work, once the versions were set up correctly. Personally I don't find the release plugin very useful, but if you do want to use it, probably it's best not to disable it at the top level?
There was a problem hiding this comment.
The current release process is documented here:
https://github.com/kubernetes-client/java/blob/master/RELEASES.md
I'm definitely open to suggestions about changing/improving the release process, especially if it included a GitHub action for continuous snapshot releases. I currently find the release process quite cumbersome.
Happy for someone who is more knowledgeable than me about releasing things via Maven take a look. What we have was cobbled together by amateurs :)
There was a problem hiding this comment.
A GitHub Action for snapshots would be excellent, but I don't think it's within the scope of this PR. You can easily set one up if you have permission to deploy snapshots somewhere. You could probably ask Sonatype for permission based on whatever credentials you use for the releases.
It looks like there is a bug in the release plugin (https://issues.apache.org/jira/browse/MRELEASE-799) which makes the examples a bit awkward to configure - they have to use a hard-coded version for the kubernetes-api dependencies. That seems like a small price to pay to get this whole thing working properly. (IMO the examples for older versions should just be in a branch in git, but we discussed that before and you didn't agree, so we have to work with this.)
My latest change includes a workaround for that bug, and I tested it by running mvn release:prepare (which failed when it tried to git push the change, but that's expected since I don't have permission).
There was a problem hiding this comment.
+1 it will be great if we can publish snapshots on a daily basis via GH actions automatically
8be9448 to
20ebdae
Compare
|
One last question and then I think this is good to go: Why use Also, needs a rebase. |
Duh. That was a mistake (caused by the release plugin, but lets continue to work with that while we have no other easy options). Fixed it when I rebased. |
Signed-off-by: Dave Syer <dsyer@vmware.com>
|
/lgtm Thanks for the patience on this one. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: brendandburns, dsyer The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This will make IDEs work better (especially VSCode) because
otherwise they cannot compute the classpath for the examples.