Maven Artifacts and dependency
The term artifacts is used for the things like jar, war, executable jar files etc. which either produced or used by programs. In case of maven projects jar, war, source code and binary files produces or used by maven project are artifacts.
These days almost all the Java libraries are distributed also in the form of maven artifacts. This eases product development as maven is one of the most used and robust software project management tool.
In Maven artifacts are distribute through online repositories and each artifact is identified by:
Group ID: like org.springframework
Artifact ID: spring-core
Version ID: 5.0.0.M5
All these information are defined in the pom.xml. For example if you want to use above spring module in your project then you should add following in your project's pom.xml file:
<dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>5.0.0.M5</version> </dependency>
Maven Dependency
In maven project if you are to use any of the library then you have add it in the dependencies tag. For example you should include above in the dependencies tag:
<dependencies> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>5.0.0.M5</version> </dependency>
.... </dependencies>
This makes project development cycle very easy for developers. Developers can easily change version of libraries if new library comes in the market.
Top maven dependencies:
- JUnit
- Scala Library
- SLF4J API Module
- Guava: Google Core Libraries For Java
- Apache Log4j
- Clojure
- Apache Commons IO
- Logback Classic Module
- SLF4J LOG4J 12 Binding
- JavaServlet(TM) Specification