Whenever a project references a dependency that isn't available in the local repository, Maven will download the dependency from a remote repository into the local repository. So far, all of our projects have included the JUnit dependency. It is sometimes going to be necessary to add other dependencies required by your project. Let's say we've added some logging to the code for debugging purposes and we need to add log4j as a dependency.
- [Narrator] There are times when you need…to add dependencies.…This is one of the benefits of using Maven.…It makes adding dependencies easy.…Remember, Maven supports both internal…and external dependencies.…Whenever a project references a dependency…that isn't available in a local repository,…Maven will download the dependency…from a remote repository into the local repository.…So far, all of our projects have…included the JUnit dependency.…It is sometimes going to be necessary…to add other dependencies required by your project.…
Let's say we've added some logging…to our code for debugging purposes,…and we need to add the Log4j as a dependency.…Let's add this dependency to our calculator project.…In order to add the dependency,…we need to edit the pom.xml file.…So I'm going to go to my file explorer,…I'm already in my calculator project.…I'm going to go into my pom file.…To open the file, I'm going to right click…and say edit with Notepad++.…And right below the dependency for JUnit,…I'm going to add a new dependency.…
- Downloading Maven
- Installing Maven
- Understanding the lifecycle and dependencies of Maven
- Working with the Project Object Model (POM)
- Defining project relationships
- Using Maven plugins
- Creating a sample project with Maven
- Writing tests in Maven
- Packaging your app
Skill Level Intermediate
Java: Database Integration with JDBCwith David Gassner2h 51m Intermediate
1. Get Started with Maven
2. Understand Maven
3. Project Object Model (POM)
4. Maven Plugins
5. Create a Project with Maven
6. Test with Maven
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.