If you want to add a dependency in your maven project , you should know the dependency details to add in POM.XML file of your project.
Then here where we will get stuck usually . We just know which jar or dependency is required that to be added , but we don't know the dependency details.
For any dependency to be added in your POM.XML file we should following three values.
- GroupId (Package name)
- ArtifactId (Dependency name)
- Version (Dependency Version)
You can know the above details by visiting maven central repository site.
Click here : Search in Maven Central RepositoryJust type your dependency name , you will get a list of related dependencies with different versions.
You can see the GroupId , Artifact Id and version details .
Click on your required thing and download it and add dependency details in your POM.XML
For example : For log4j :<!-- Log4j details --> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j</artifactId> <version>2.8.2</version> </dependency>Search results for log4j in central repository.
Click on version to more details as below.
In similar way search any dependency you needed in central repository and add in your pom.xml . maven will download it and will keep it in your local repository.
Hope this is helpful..........!!!!Thank You.