Follow suggested three steps to convert your project into maven project.
Step 1:
As suggested by nullpointer, following attributes are mandatory in your pom to make it as maven project.
Sample pom.xml file:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.infy</groupId>
<artifactId>user-identity-rest</artifactId>
<version>1.0.0</version>
</project>
groupId: It is unique identifier to the group of multiple modules in your project
artifactId: Unique module identifier of your module.
version: Initially we will start with version 1.0.0 and will upgrade to 1.0.1 and so on subsequently.
You can customized these things as per your understanding and future references.
Step 2:
Now you need to add all libraries in declared pom.xml which is similar to jars you added in your project.
You might have added a library in your project(lets say json-simple-1.1.1.jar). Here maven doesn't look for the whole library, instead it asks its dependency.
You can find dependency of your external library here by searching for library with exact version.
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
Now you need to copy the dependency from given site and paste it to your pom.xml file within the <dependencies> element. In this example, the full pom.xml is:
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.infy</groupId>
<artifactId>user-identity-rest</artifactId>
<version>1.0.0</version>
<dependencies>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
</dependencies>
</project>
Maven will automatically fetch it from its repository.
Step 3:
Third and last step is to build your project. Open command prompt/terminal and go to the directory where your pom.xml is declared and type mvn clean install
![Building application with maven]()
This will generate an executable for your project on local and voilla! You have converted and built your project into maven project
Reference Path: C:\PA\IntelliJ Workspace\Springboot Practise\target\spring-boot-examples-1.0-SNAPSHOT.jar
Note: Comment below if you need more clarifications.