Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Convert to maven project in eclipse java

  • In order to convert any java project in to maven using eclipse we need to install m2e plugin.
  • Latest versions of eclipse are coming with this m2e plugin by default.
  • If not found this plugin we can install it by help->install->click on add and enter http://download.eclipse.org/technology/m2e/releases. 
  • currently i am using eclipse oxygen version so it is having m2e plugin.
  • I have created a normal java project and i want to convert that into a maven project.
  • To convert any project in to maven right click on the project and ->configure->convert to maven project. 
  • After that a window will be opened and you need to enter group id and artifact id and then click on finish.  
  • convert to maven project eclipse luna / convert to maven project is not visible in eclipse /convert to maven project option not available in eclipse.



Right click on project and select configure-> convert to maven project.



Project will be converted to Maven by creating pom.xml file.

 

pom.xml

  1. /2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
  2. http://maven.apache.org/xsd/maven-4.0.0.xsd">
  3.   4.0.0
  4.   com.instanceofjava.maven
  5.   MavenProject
  6.   0.0.1-SNAPSHOT
  7.  
  8.     src
  9.    
  10.      
  11.         maven-compiler-plugin
  12.         3.7.0
  13.        
  14.           1.8
  15.           1.8
  16.        
  17.      
  18.    
  19.  

Add dependencies to your pom.xml file

  1.  
  2.         5.0.3.RELEASE
  3.      
  4.      
  5.        
  6.           org.springframework
  7.           spring-context
  8.           ${springVersion}
  9.        
  10.       
  11.          org.springframework
  12.          spring-core
  13.           5.0.3.RELEASE
  14.        
  15.      


This post first appeared on Java Tutorial - InstanceOfJava, please read the originial post: here

Share the post

Convert to maven project in eclipse java

×

Subscribe to Java Tutorial - Instanceofjava

Get updates delivered right to your inbox!

Thank you for your subscription

×