- ·上一篇文章:Apache Maven 工程文档
- ·下一篇文章:Apache Maven 快照
Apache Maven 工程模版
p.java 如下所示:路径:C:\ > MVN > health > src > main > java > com > companyname > insurance > App.javapackage com.companyname.insurance;/*** Hello world!**/public class App { public static void main( String[] args ) { System.out.println( "Hello World!" ); }}创建 AppTest.javaMaven 生成一个 java 源文件示例,工程的 AppTest.java 如下所示:路径为: C:\ > MVN > health > src > test > java > com > companyname > insurance > AppTest.javapackage com.companyname.insurance;import junit.framework.Test;import junit.framework.TestCase;import junit.framework.TestSuite;/*** Unit test for simple App.*/public class AppTest extends TestCase{ /** * Create the test case * * @param testName name of the test case */ public AppTest( String testName ) { super( testName ); } /** * @return the suite of tests being tested */ public static Test suite() { return new TestSuite( AppTest.class ); } /** * Rigourous Test :-) */ public void testApp() { assertTrue( true ); }} 就这样。现在你可以看到 Maven 的强大之处。你可以用 maven 简单的命令创建任何类型的工程,并且可以启动您的开发。
Apache Maven 工程模版