Skip to content

Commit

Permalink
纯手工打造的基本Maven项目骨架
Browse files Browse the repository at this point in the history
  • Loading branch information
cqping committed Jan 18, 2019
1 parent 7f20d74 commit c13db3f
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions HelloWorld/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
���ֹ�������Maven��Ŀ�Ǽ�
22 changes: 22 additions & 0 deletions HelloWorld/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<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.example</groupId>
<artifactId>hello-world</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>Maven Hello World Project</name>
<description>Maven Hello World Project Demo</description>


<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.7</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
11 changes: 11 additions & 0 deletions HelloWorld/src/main/java/com/example/helloworld/HelloWorld.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.example.helloworld;

public class HelloWorld{
public String sayHello(){
return "Hello Maven";
}

public static void main(String[] args){
System.out.println(new HelloWorld().sayHello());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.example.helloworld;

import static org.junit.Assert.assertEquals;
import org.junit.Test;

public class HelloWorldTest{
@Test
public void testSayHello(){
HelloWorld helloWorld = new HelloWorld();
String result = helloWorld.sayHello();
assertEquals("Hello Maven", result);
}

}

0 comments on commit c13db3f

Please sign in to comment.