You are here
Home > Programming > Java > Apache Maven Hello World

Apache Maven Hello World

Maven is a build automation tool used primarily for Java projects. The word maven means “accumulator of knowledge” in Yiddish. Maven addresses two aspects of building software: first, it describes how software is built, and second, it describes its dependencies. Contrary to preceding tools like Apache Ant, it uses conventions for the build procedure, and only exceptions need to be written down. An XML file describes the software project being built, its dependencies on other external modules and components, the build order, directories, and required plug-ins. It comes with pre-defined targets for performing certain well-defined tasks such as compilation of code and its packaging. Maven dynamically downloads Java libraries and Maven plug-ins from one or more repositories such as the Maven 2 Central Repository, and stores them in a local cache. This local cache of downloaded artifacts can also be updated with artifacts created by local projects. Public repositories can also be updated. sumber: wiki

Hari ini akan belajar membuat program java dengan Apache Maven dengan judul

Apache Maven Hello World

Berikut langkah-langkah untuk memulai Apache Maven Hello World :

1).  Buka editor eclipse kita

2). Create new “Maven Project” >>> File > New > Other > Maven Project

3). Centang “Create a simple project”, lalu isi data dengan informasi seperti dibawah ini:

4). Klik finish, tunggu sampai terbentuk sebuah project dengan nama “belajar-maven”

5). Buka file pom.xml, dan tambahkan coding menjadi:

6). Create class dengan nama “MavenHelloWorld” jangan lupa centang method main, tambahkan coding pada method main seperti gambar dibawah ini:

7). Untuk Run bisa langsung dari editor eclipe dengan cara >>> Run > Java Application

8). Atau kita generate file *.jar dengan cara >>> Run > Maven Install

9). File *.jar hasil generate ada di folder “target”

10). Buka cmd/terminal/console jalankan dengan cara:

11). Ouput

Welcome to Apache Maven Hello World !

 

Semoga Membantu,

Salam berbagi,
Yulianto Wijaksana

Leave a Reply

Top