Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Collaborating with Maven1:26 with Chris Ramacciotti
If you are working on an open-source or collaborative project, it's convenient to distribute Maven with the source code. This accelerates the contributions of other developers because they don't have to worry about installing Maven separately. This video gives you an option for distributing what is called a "Maven wrapper".
There's far more that you can do with Maven than we could 0:00 ever cover in one workshop. 0:03 But there's one more tip I'll show you that's super useful for 0:04 collaborating with others. 0:07 When somebody joins our team, we want them to get the project up and 0:09 running on their system as quickly as possible. 0:12 Wouldn't it be nice if developers didn't have to install Maven on 0:15 their own machines to get up and running? 0:17 Well, there is a solution for that. 0:19 Borrowed from Gradle and its use of the Gradle wrapper, 0:21 there is the Maven wrapper. 0:24 To add it to your project, in your project directory, 0:26 that is in file-spy on my system, I'll say mvn -N io.takari:maven:wrapper. 0:30 This will download the wrapper and when it's done, you'll see a .mvn directory as 0:37 well as an mvnw and an mvnw.cmd file which are the executables for 0:41 Unix based systems and Windows systems respectively. 0:47 So let me show you what that looks like, tree -P and 0:51 let's just look for *mvn* items. 0:56 Let's --prune the tree and there we go, we get an mvnw and an mvnw.cmd. 0:59 Now you can commit these new additions to your repository like Git. 1:07 So that when a new developer joins the team, they can simply run mvnw package, 1:11 for example, all without installing Maven on their own machines. 1:15 All right, that's all for now. 1:19 Thanks for hanging with me today to learn the most widely used build tool 1:21 in the Java market. 1:24
You need to sign up for Treehouse in order to download course files.Sign up