Build the Maven Project Easy




                                Build the Maven Project
(Without the IDE)

step 1 :

  •  download the Maven

using below link--->

                        http://maven.apache.org/download.cgi

Then ,
            set the Environment varaibles.

  1. Ensure JAVA_HOME environment variable is set and points to your JDK installation.
  2. Add the bin directory of the created directory apache-maven-3.5.0 to the PATH environment variable.
  3. Check to verify , type in CLI  ----->>>>  mvn  -v.

step 2 :
  1. To build a Maven project via the command line, run the mvn command from the command line. The command should be executed in the directory which contains the relevant pom file. You need to provide the mvn command with the life cycle phase or goal to execute.
  2. ---->mvn clean install ====this will delete the old project and rebuilding again
  3. Other thing after the build output goes to target folder.
  4. After the building the project, think you want add unit tests.
How to Do?

  • You remember the POM.xml file right!
  • just add junit dependency to POM file

<dependency>
  <groupId>junit</groupId>
  <artifactId>junit</artifactId>
  <version>4.12</version>
</dependency>

Also You want to write test cases.Um using the java for that. it should include in test folder.

After that what Happen?😂😂😂😎

You have to build the project again.we included junit inside of the pom.xml file.Now it downloads from the internet and rebuild the project.







 Thank You!!!! See you again.

Referrences :






Comments

Popular posts from this blog