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.
- Ensure JAVA_HOME environment variable is set and points to your JDK installation.
- Add the bin directory of the created directory apache-maven-3.5.0 to the PATH environment variable.
- Check to verify , type in CLI ----->>>> mvn -v.
step 2 :
- 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 themvn
command with the life cycle phase or goal to execute. - ---->mvn clean install ====this will delete the old project and rebuilding again
- Other thing after the build output goes to target folder.
- 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
Post a Comment