One thing you can use the tag after release:prepare is to run a more extensive testing sweet on your remote server. So for instance you could add a webhook on github or you coworkers could download and test the tag before pushing the release.
Hi. Yes you are correct, it only auto increment the patch version. If you want to push a major or minor version you just change when you specify the version during the release process. And then a new snapshot with the next patch version will be created. So you decide when to release major or minor but default is patch. I hope this helps. Thank you for watching my videos. Best regards Daniel
Hi Tony. I mostly use Intellj today with the standard setup. I have used Visual Studio.Net earlier and use code for editing also without any extra bells or whistles. Thank you for watching my videos Best regards Daniel
Hi Sukumar I don't think there would be much difference in a multi module approach. The main program should just inherit the maven dependencies required in order to build your project. If you talking about the module system that only Java engineers uses for their projects I don't know if there is a problem that it creates that would make your builds harder to build. I stay clear of that technology as it does not add any benefit for the developer of the program. Thank you for watching my videos. Best regards Daniel
Hi Daniel, I am setting up pipeline for a maven project. I have private maven repository and I want my project to access the jar files in the private repository when I set up pipelines. My project's version is -RELEASE, what should I mention in .yml file?
Hi Pooja. Thank you for watching my videos. I must have missed some detail in your question but I can't really figure out what you are looking for. Please add more information so I might understand your question easier. Again, sorry for not understanding. Best regards Daniel
Hi Chandraveer. No I don't sadly. I have some projects that I manage that have multiple modules and that is a struggle. But mainly the best solution is to handle them as separate projects and then make releases for the main module from time to time but the other modules lives their own life. But making it clear in docs and release notes is hard. I hope this helps. Thank you for watching my videos. Best regards Daniel
Well, Jenkins should be able to run any maven project tasks. So if you prep your build with a release.properties it should be able to run the release plugin without any inputs. Never tried it myself as I see this as a manual process. Hope this helps. Thank you for watching my videos Best regards Daniel
So using maven how we can automatically change the parent version in pom file. like version:set -newversion need to give a version name through command line , so how can i automate this command version should be increment automatically i.e. if previous version is 1.0 snapshot it would change to 1.1 snapshot.
Hi Himanshu. I'm not sure if the plugin has this functionality. Have never had a use-case for this; worked once in a company that had a parent project to many child projects, but that is the only instance I've come across this setup. And in that case, you rarely updated the version of the parent as it rarely changed. Sorry I can't give you an answer, but I'm grateful that you've taken the time to watch my video, and I hope you learned something. Best regards Daniel
Hi Shad I've read the differences and depending on your workflow I can see the pros of both methods. What ever fits your style I guess. We work in branches and merges into master before a tagged release so maven-release-plugin works. But I'll try it out because we have some issues with resources and It's always fun to learn something new. best regards Daniel
Hi Daniel, with your help I was able to use mvn-release-plugin. now my code is pushed to my development branch and tag is updated as 0.1 there are two subsequent check-in in my development branch with below comments: 2 .[maven-release-plugin] prepare for next development iteration [maven-release-plugin] prepare for next development iteration 1. [maven-release-plugin] prepare release 0.1 Now I want the 0.1 (version tag) code to be pushed to master branch [typical git flow], I mean I want to merge the version 0.1 to master branch, Could you please help me with this ?
Hi Shad. The question is if you are coding in both? If you only code in development then you only set your master so it points to the 0.1 version. On the other hand, if you have parallel programming in both branches you need to merge them. This could be done with git merge 0.1 Hope this helps. Best regards Daniel
Hey Daniel , ahh pardon my silly questions.. i am quite new to git and maven... Actually i want to point master to latest release, so in my case: 1. Master should point to 0.1 2. Development should point to 0.2-Snapshot ( this is already happening ) Now, kindly let me know 1. how to achieve 1st point manually . 2. Is there any way to automatically point master to the latest release as soon as mvn release:perform is executed. P.s. - i only work in development branch master is just to point at latest release
Hi Shad There are no silly questions. We are all new at something. To your question there are two ways to update a branch pointer without merging. git branch -f branch-name new-tip-commit and git update-ref -m "reset: Reset to " refs/heads/ So git branch -f master git update-ref -m "reset: Reset master to " refs/heads/master You find the commit hash by looking in your development branch log for the tagged commit. Hope this helps Best regards Daniel
HI Philip Thank you for watching my videos. I usually use this feature with certificate authentication but it should work with password auth and GitHub as well. Glad you got it to work. Best regards Daniel
Hi Shad. Thank you for watching my videos. Well I looked at the specification of BitBucket, never used it myself, and I see that they support git repositories. So this plugin should work with bitbucket the same way that it does for github you just change your scm url. Hope this helps, and if not then don't hesitate to ask again. Best regards Daniel
Hi SCMowns The short answer is it doesn't. If you are using dependencies maven will help you download and keep these up to date, depending on your configuration in the pom file. But if you build a client and distribute that maven helps you with versioning but not distribution. So the users of your jar need to download a new one. But you can build a function to download the new jar and replace the old one but that's out of the scope of what maven does. Example of such a client: Minecraft Hope this helps. Best regards Daniel
Thanks! Subscribed. :) I like how you mentioned Minecraft. I have seen how they distribute jars using their launcher. I could find all the jars under %appdata% > .minecraft. Thanks again for the insight.
Hi Игорь That is true, I did not cover that in this video. Maven uses the installed keys for the user in the operating system so by adding an SSH key to your user and then send the public part to the git repository provider you will be able to use a git connection for your releases. Hope this helps. Thank you for watching my videos. Best regards Daniel
@@DanielPersson can i set up this key in server section in setting xml? If yes which id i should specify?Because i use jenkins in remote server, and maven on jenkins dont know about key that i actualy use
Hi Игорь Jenkins probably have a local user usually called jenkins or something like that. Perhaps there is a user that initiates the jenkins runner. That user on the system needs a ssh key in their .ssh directory that you give access to on your repository server. Maven does not, to my knowledge, use any special ssh setup. It uses the same ssh configuration you have setup locally for the user running the maven command. Best regards Daniel
Because it gives me the following problem: Caused by: org.apache.maven.shared.release.ReleaseFailureException: You don't have a SNAPSHOT project in the reactor projects list.
Hi I have not gotten that issue myself. Maybe your pom file points to a version instead of a SNAPSHOT? I hope this helps. Thank you for watching my videos. Best regards Daniel
great job Daniel, like your explanation
thanks for the clear explanation, it helps a lot for a beginner
Maybe one of the best maven videos on youtube
Hi Ivan
Thank you, and thank you for watching my videos
Best regards
Daniel
4:33 skip till 5:38 then make releases
9:34 maven-release-plugin
12:25 command: mvn release:prepare
This was really useful. Thanks for uploading the tutorial :-)
This was really helpful, Thanks D
good info friend, be blessed!
One thing you can use the tag after release:prepare is to run a more extensive testing sweet on your remote server.
So for instance you could add a webhook on github or you coworkers could download and test the tag before pushing the release.
Great presentation!
still useful
I am using this and it is working fine but it only increamnet patch version how to use this and auto increament major or minor version as well
Hi.
Yes you are correct, it only auto increment the patch version. If you want to push a major or minor version you just change when you specify the version during the release process. And then a new snapshot with the next patch version will be created. So you decide when to release major or minor but default is patch.
I hope this helps. Thank you for watching my videos.
Best regards
Daniel
Thanks! It helped me with some configs. :)
thanks - just wondering how do you setup you studio the way you do?
Hi Tony.
I mostly use Intellj today with the standard setup. I have used Visual Studio.Net earlier and use code for editing also without any extra bells or whistles.
Thank you for watching my videos
Best regards
Daniel
Hi Daniel, is there an example for multi module maven project release?
Hi Sukumar
I don't think there would be much difference in a multi module approach. The main program should just inherit the maven dependencies required in order to build your project.
If you talking about the module system that only Java engineers uses for their projects I don't know if there is a problem that it creates that would make your builds harder to build. I stay clear of that technology as it does not add any benefit for the developer of the program.
Thank you for watching my videos.
Best regards
Daniel
Hi Daniel, I am setting up pipeline for a maven project. I have private maven repository and I want my project to access the jar files in the private repository when I set up pipelines. My project's version is -RELEASE, what should I mention in .yml file?
Hi Pooja.
Thank you for watching my videos.
I must have missed some detail in your question but I can't really figure out what you are looking for. Please add more information so I might understand your question easier.
Again, sorry for not understanding.
Best regards
Daniel
Hi Daniel, Any Reference to handle releases for multi-module Projects.
Thanks in Advance !!
Hi Chandraveer.
No I don't sadly. I have some projects that I manage that have multiple modules and that is a struggle. But mainly the best solution is to handle them as separate projects and then make releases for the main module from time to time but the other modules lives their own life. But making it clear in docs and release notes is hard.
I hope this helps. Thank you for watching my videos.
Best regards
Daniel
Hi Daniel , Can you show me how to set up Maven project in azure devops realease pipeline ?
Hi Rajdeeo
I will look into it and create a video.
Thank you for watching my videos.
Best regards
Daniel
Hi would like to understand on how to integrate maven release plugin into jenkins, is there any easy ways out.
Well, Jenkins should be able to run any maven project tasks. So if you prep your build with a release.properties it should be able to run the release plugin without any inputs. Never tried it myself as I see this as a manual process.
Hope this helps.
Thank you for watching my videos
Best regards
Daniel
So using maven how we can automatically change the parent version in pom file. like version:set -newversion need to give a version name through command line , so how can i automate this command version should be increment automatically i.e. if previous version is 1.0 snapshot it would change to 1.1 snapshot.
Hi Himanshu.
I'm not sure if the plugin has this functionality. Have never had a use-case for this; worked once in a company that had a parent project to many child projects, but that is the only instance I've come across this setup. And in that case, you rarely updated the version of the parent as it rarely changed.
Sorry I can't give you an answer, but I'm grateful that you've taken the time to watch my video, and I hope you learned something.
Best regards
Daniel
At 2:53, you neglect to say what scm is. I don't think it's enough to call it "our little setup for this project".
Hi.
SCM = Source code management, usually git but could be older things like subversion and cvs.
I hope this helps.
Best regards
Daniel
Hi Daniel, Please check this maven-jgitflow-plugin.. It does all work for maven-release-plugin and takes care of git flow as well.
Hi Shad
I've read the differences and depending on your workflow I can see the pros of both methods. What ever fits your style I guess.
We work in branches and merges into master before a tagged release so maven-release-plugin works.
But I'll try it out because we have some issues with resources and It's always fun to learn something new.
best regards
Daniel
Hi Daniel, with your help I was able to use mvn-release-plugin. now my code is pushed to my development branch and tag is updated as 0.1
there are two subsequent check-in in my development branch with below comments:
2 .[maven-release-plugin] prepare for next development iteration [maven-release-plugin] prepare for next development iteration
1. [maven-release-plugin] prepare release 0.1
Now I want the 0.1 (version tag) code to be pushed to master branch [typical git flow], I mean I want to merge the version 0.1 to master branch, Could you please help me with this ?
Hi Shad.
The question is if you are coding in both? If you only code in development then you only set your master so it points to the 0.1 version.
On the other hand, if you have parallel programming in both branches you need to merge them. This could be done with
git merge 0.1
Hope this helps.
Best regards
Daniel
Hey Daniel , ahh pardon my silly questions.. i am quite new to git and maven...
Actually i want to point master to latest release, so in my case:
1. Master should point to 0.1
2. Development should point to 0.2-Snapshot ( this is already happening )
Now, kindly let me know
1. how to achieve 1st point manually .
2. Is there any way to automatically point master to the latest release as soon as mvn release:perform is executed.
P.s. - i only work in development branch master is just to point at latest release
Hi Shad
There are no silly questions. We are all new at something.
To your question there are two ways to update a branch pointer without merging.
git branch -f branch-name new-tip-commit
and
git update-ref -m "reset: Reset to " refs/heads/
So
git branch -f master
git update-ref -m "reset: Reset master to " refs/heads/master
You find the commit hash by looking in your development branch log for the tagged commit.
Hope this helps
Best regards
Daniel
Thanks for the tutorial. I had to unset commit.gpgsign for signing error
HI Philip
Thank you for watching my videos.
I usually use this feature with certificate authentication but it should work with password auth and GitHub as well.
Glad you got it to work.
Best regards
Daniel
hi Daniel, could you please let me know how to configure this plugin for bitbucket .
Hi Shad.
Thank you for watching my videos.
Well I looked at the specification of BitBucket, never used it myself, and I see that they support git repositories. So this plugin should work with bitbucket the same way that it does for github you just change your scm url.
Hope this helps, and if not then don't hesitate to ask again.
Best regards
Daniel
I have a question. If I build a client jar and distribute it how does Maven keep it updated when I push version updates?
Hi SCMowns
The short answer is it doesn't.
If you are using dependencies maven will help you download and keep these up to date, depending on your configuration in the pom file.
But if you build a client and distribute that maven helps you with versioning but not distribution. So the users of your jar need to download a new one.
But you can build a function to download the new jar and replace the old one but that's out of the scope of what maven does.
Example of such a client: Minecraft
Hope this helps.
Best regards
Daniel
Thanks! Subscribed. :) I like how you mentioned Minecraft. I have seen how they distribute jars using their launcher. I could find all the jars under %appdata% > .minecraft. Thanks again for the insight.
You didn't explane how you seted up maven for ssh connection!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Hi Игорь
That is true, I did not cover that in this video. Maven uses the installed keys for the user in the operating system so by adding an SSH key to your user and then send the public part to the git repository provider you will be able to use a git connection for your releases.
Hope this helps.
Thank you for watching my videos.
Best regards
Daniel
@@DanielPersson can i set up this key in server section in setting xml? If yes which id i should specify?Because i use jenkins in remote server, and maven on jenkins dont know about key that i actualy use
Hi Игорь
Jenkins probably have a local user usually called jenkins or something like that. Perhaps there is a user that initiates the jenkins runner. That user on the system needs a ssh key in their .ssh directory that you give access to on your repository server.
Maven does not, to my knowledge, use any special ssh setup. It uses the same ssh configuration you have setup locally for the user running the maven command.
Best regards
Daniel
Because it gives me the following problem: Caused by: org.apache.maven.shared.release.ReleaseFailureException: You don't have a SNAPSHOT project in the reactor projects list.
Hi
I have not gotten that issue myself. Maybe your pom file points to a version instead of a SNAPSHOT?
I hope this helps. Thank you for watching my videos.
Best regards
Daniel
@@DanielPersson I finally solved the problem, I was having problems with a specific version. But if the example works, thanks for the contribution.