-
Notifications
You must be signed in to change notification settings - Fork 1
Maven Archetype Quickstart
Zhamri Che Ani edited this page Oct 24, 2019
·
1 revision
$ mvn archetype:generate
- Archetype (Type of Development: eg. web, spring)
- Group ID (package/folder directory)
- Artifact ID (Project Name)
- Version
- Package (Jar file)
$ mvn archetype:generate -DgroupId=com.zhamri.stiw3054 -DartifactId=HelloMavenApp -DarchetypeArtifactId=maven-archetype-quickstart -Dversion=1.0-SNAPSHOT -DinteractiveMode=false
pom.xml
/src/main/java/com/zhamri/stiw3054/App.java
/src/test/java/com/zhamri/stiw3054/AppTest.java
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.zhamri.stiw3054</groupId>
<artifactId>HelloMavenApp</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>HelloMavenApp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
</dependencies>
</project>
package com.zhamri.stiw3054;
/**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}
package com.zhamri.stiw3054;
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 );
}
}