Maven 3 How-to Generate a Java J2EE Project on Ubuntu Linux Easy Guide

June 15th, 2014 by thelinuxevangelist

Ubuntu Maven 3 Create Basic J2EE Project

The Tutorial Shows You Step-by-Step How-to Create a Standard Java J2EE Project Folders Structure by Maven 3 Command on Ubuntu GNU/Linux.

Inside the Guide is Included a Link for Installing and Getting-Started with Maven 3 for Ubuntu Linux.

Maven, a Yiddish word meaning “accumulator of knowledge”, was originally started as an attempt to Simplify the Build Processes in the Jakarta Turbine project.

Maven‘s primary goal is to allow a developer to comprehend the complete state of a development effort in the shortest period of time.

Maven‘s Objectives:

  • Making the build process easy
  • Providing a uniform build system
  • Providing quality project information
  • Providing guidelines for best practices development
  • Allowing transparent migration to new features
  1. Open a Command Line Terminal Window
    Ctrl+Alt+t on desktop
    (Press “Enter” to Execute Commands)

    Maven 3 Create Basic J2EE Project - Open Terminal
  2. How-to Getting-Started with Latest Apache Maven on Ubuntu:

    Maven Quick-Start on Ubuntu
  3. Maven 3 Command to Create a Simple Java Web App

    mvn archetype:generate \
    -DgroupId=[yourPackagingId] \
    -DartifactId=[yourProjectName] \
    -DarchetypeArtifactId=maven-archetype-j2ee-simple
    

    For Example:

    mvn archetype:generate \
    -DgroupId=com.tutorialforlinux \
    -DartifactId=myJ2eePro \
    -DarchetypeArtifactId=maven-archetype-j2ee-simple
    

    This should then create a Maven Project Structure like:

    .
    |-- ear
    |  `-- pom.xml
    |-- ejb
    |  |-- src  
    |  |  `-- main
    |  |    `-- resources
    |  |      `-- META-INF
    |  |        `-- ejb-jar.xml
    |  `-- pom.xml
    |-- primary-source
    |  `-- pom.xml
    |-- projects
    |  |-- logging
    |  |  `-- pom.xml
    |  `-- pom.xml
    |-- servlets
    |  |-- servlet
    |  |  |-- src
    |  |  |  `-- main
    |  |  |    `-- webapp
    |  |  |      |-- WEB-INF
    |  |  |      |  `-- web.xml
    |  |  |      `-- index.jsp
    |  |  `-- pom.xml
    |  `-- pom.xml
    |-- src
    |  `-- main
    |    `-- resources
    `-- pom.xml
    
  4. How-to Install Latest Eclipse JEE IDE on Linux Ubuntu: SetUp Eclipse on Ubuntu

  5. How-to Integrate a Maven J2EE Project into Eclipse:

    Maven Eclipse Integration

Tags: , , , , , , , , , , , ,