Skip to main content

How to build a project in eclipse with MAVEN build tool?

How to build a project in eclipse with MAVEN build tool?
Step 1:-
Install maven and set the path in my computer. Once path is set for java and maven you will get a screen
With version installed in your system.

Step 2:-
Write a command mvn archetype:generate to build a project of your choice.This will give you a option to select a project from list.

Step 3:- As soon as this operation will complete maven give you choice to choose project.Search for maven-archetype-webapp this will build a web project with basic structure.

Step4:- Follow the below procedure to give name , version ,package ,artifact and group id of your choice.

Step 5:- You will get screen with build success.Congrats your project is build in directory.

Step 6: Go in the directory to check for the folders automatically created by maven. You will get pom file and src folder and the package folder.

Step:-7  Move to the directry having pom.xml and run mvn eclipse:eclipse command to convert the project into eclipse.

You will get a screen of successful completion of project.

Step 9:- Open eclipse and import the same project into eclipse.

Step 10:- The following structure you will get after import will be successful.
Change you directory in command prompt from normal directory and go to the same project in eclipse workspace.

Now right click on project go to configure and select convert to maven.

 You will get an error don’t panic follow next steps.

This is a maven bug in eclipse first clean the project using command mvn eclipse :clean then again convert it to mvn eclipse:eclipse project.After completing the steps again convert to maven by selecting the same option.This  time you will be able to convert the project.

The below folder you will get as the final basic structure.



Popular posts from this blog

Driver program to perform operations in graph

Driver program to perform operations in graph:-

package com.problems.graph;publicclassGraphDriver{publicstaticvoidmain(String[] args){ BFSGraph g=new BFSGraph(); g.addVertex('A'); g.addVertex('B'); g.addVertex('C'); g.addVertex('D'); g.addVertex('E'); g.addVertex('F'); g.addVertex('G'); g.addVertex('H'); g.addEdge(0,1); g.addEdge(1,2); g.addEdge(1,7); g.addEdge(2,3); g.addEdge(2,4); g.addEdge(7,4); g.addEdge(4,5); g.addEdge(4,6); g.bfs();}}

Selection Sort in JAVA

What is selection sort?

It is a sorting technique that is based on the partitioning of array into two parts, sorted and unsorted.

The process is:-

1) Find minimum element in unsorted array.
2) Swap the element at the end of sorted array.

when i=0 we don't have any sorted array so element will be replaced from first element later the sorted array end will growas the index.


underline elements are sorted array, the length is increasing with each minimum element added at the end.minimum element11 1125122264 minimum element12 1112252264 minimum element22 1112222564 minimum element25 1112222564 minimum element64 1112222564

package sorting;publicclassSelectionSort{//function to print arraypublicstaticvoidprint(int[] arr){for(int i=0;i<=arr.length-1;i++) System.out.print(" "+arr[i]); System.out.println(" ");}//function to swap elementspublicstaticint[]swap(int[] arr,int i,int j){int temp; temp=arr[i]; arr[i]=arr[j]; arr[j]=temp…