Software Project Management_JUnit && Maven

Task1:java

Develop the project 「HelloWorld」 apache

-A .java program: Just print out 「Hello」 + your name; maven

-A test case using Junit to verify whether the program works well.ui

Steps to realize:spa

A .java program: Just print out 「Hello」 + your name;3d

Using Eclipse to creat a new java project:blog

Run it:ip

A test case using Junit to verify whether the program works well.get

File->Build path->Add Library->JUnit;cmd

File->new->class "junit" and then run it, shown as follow:

Task2:

Install Maven and Build the 「HelloWorld」 Project

-Create the directories as 「Convention Over Configuration.

-Use 「compile, test, package」 to build the project.

1.Download Maven from http://maven.apache.org/ and then configure environment variables.

控制面板>系統>高級系統設置>環境變量

 2.Check Maven is installed or not "mvn -v"

3.Using Eclipse "File>New>Other>Maven>Maven Project"

In AppTest.java:

 

Then,run it and we got:

 

Yahooo!Finished!

We can also use cmd to creat package. But it is "mafan"/complex . So I used Eclipse to creat maven directly.

相關文章
相關標籤/搜索