In this article, we will understand about maven co-ordinates
Q) What is Maven Co-ordinates ?
- <groupId>:<artifactId>:<version> defines a maven co-ordinate for any maven module in local or central or remote repositories
- This combination needs to be unique, to distinctly identify maven artifacts from other artifacts in any of the repositories (local/central/remote)
- For example, maven co-ordinate for spring-core module is
- groupId –> org.springframework
- artifactId –> spring-core
- version –> 4.1.3.RELEASE
- Above co-ordinate added as <dependency> under <dependencies> tag in pom.xml as below
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>4.1.3.RELEASE</version>
</dependency>
Now, there won’t be any other maven module with same co-ordinates other than this
Q) How can we search Maven co-ordinates ?
- Initially users/developers who are all just started to understand and getting hold of maven will find it difficult to search maven co-ordinates for their project requirements
- In fact, it takes time to understand exactly which maven co-ordinate should we use for our project requirements
- But with experience, everything gets sorted out and makes developers life easy –> that’s beauty of the maven
To search Maven co-ordinate:
- There are various website from where we can look upon to get the required co-ordinates for our requirements
- Central repository: http://search.maven.org/
- This website is developed and maintained by ‘Apache Software Foundation‘ and it’s contributed by many Maven users
- Maven repository: http://mvnrepository.com/
- This is another one to find Maven co-ordinate
- And there are various third party sites to host their specific modules i.e.; Remote repositories
- Still un-successful: Call the help of Google
Useful Eclipse IDE shortcuts :
- Eclipse IDE – How to show line numbers ?
- Eclipse IDE – How to GO TO any line number directly ?
- Eclipse IDE – How to remove unused imports ?
- Eclipse IDE – How to clean project ?
- Eclipse IDE – How to build Java project automatically ?
- Eclipse IDE – How to comment and un-comment line & block ?
- Eclipse IDE – How to generate constructor using fields ?
- Eclipse IDE – How to generate getters and setters ?
- Eclipse IDE – How to search files ?
- Eclipse IDE – How to locate methods in Java file ?
- Eclipse IDE – How to open editor using CTRL + E ?
- Eclipse IDE – Java compiler compliance level issue
Related Articles:
- Apache Maven – Introduction
- Apache Maven – Install on Windows 7 OS
- Apache Maven – Settings.xml explanation
- Apache Maven – Proxy setting explanation
- Apache Maven – pom.xml explanation
- Apache Maven – Plugins explanation
- Apache Maven – Changing default Maven repository location in Windows 7 OS
- Apache Maven – Local, Central and Remote Repositories
- Apache Maven – Installing custom library into local repository
- Apache Maven – Transitive dependencies explanation
- Apache Maven – Exclusion of Transitive dependencies
- Apache Maven – Dependency Scopes
- Apache Maven – Skipping unit test using surefire plugin
- Apache Maven – Exclusions and Inclusions of unit test
- Apache Maven – offline execution
- Apache Maven – Co-ordinates explained
- Eclipse + Maven – Integration
- Eclipse + Maven – How to import Maven project with pom.xml ?
- Eclipse + Maven – Setting M2_REPO classpath variable in IDE
- Eclipse + Maven – M2_REPO is Non Modifiable
- Eclipse + Maven – Creating and exploring projects using archetypes
- Eclipse + Maven – Converting Web project to Maven project
- Eclipse + Maven – mvn eclipse:eclipse command
- Eclipse + Maven – Plugin execution not covered by lifecycle configuration
References:
Happy Coding !!
Happy Learning !!