Friday, October 25, 2013

Coupling and Cohesion

What is Coupling ?
- Coupling indicates the degree of dependence among components. Higher coupling tends to indicate poor design of classes, since it makes modifying parts of the system difficult, as modifying a component affects all the components to which the component is connected.
- Class A has behaviourA and propertiesA, and Class B has behaviourB and propertiesB. Class A uses the properties and behaviours in Class B, and Class B also uses the properties and behaviours in Class A.
- We call High Coupling (Tighly Coupling)

What is the solution ?
- Lower Coupling is better .

Problem: Sample code High Coupling
package com.scjp6.oop.coupling;
public class CalculateTaxes {
    float rate;
    float doIndia() {
    TaxRatesInIndia str = new TaxRatesInIndia();
    return rate = str.salesRate; // ouch again
    }
}

package com.scjp6.oop.coupling;

public class TaxRatesInIndia {
    public float salesRate; // should be private

    public float adjustedSalesRate; // should be private
    public float getSalesTaxRates() {
        adjustedSalesRate = new CalculateTaxes().doIndia();
        return adjustedSalesRate;
    }
}
package com.scjp6.oop.coupling;


public class LowCoupling {


    public static void main(String[] args) {
    // TODO Auto-generated method stub

    Calculate calculate = new CalculateTaxeRateIndiaImpl();
    System.out.println(calculate.doIndia());
    System.out.println(calculate.getSalesTaxRates());
    }
}
Solution: Sample code Low/ Tigh Coupling

package com.scjp6.oop.coupling;

public interface Calculate {
    float doIndia();
    float getSalesTaxRates();   
}


package com.scjp6.oop.coupling;
public class CalculateTaxeRateIndiaImpl implements Calculate {
    @Override
    public float doIndia() {
       return 0;
    }


    @Override
    public float getSalesTaxRates() {
      return 0;
    }
}


package com.scjp6.oop.coupling;

public class LowCoupling {

    public static void main(String[] args) {
     Calculate calculate = new CalculateTaxeRateIndiaImpl();
     System.out.println(calculate.doIndia());
     System.out.println(calculate.getSalesTaxRates());
    }
}


What is Cohesion
- Cohesion is the extent to which methods in a class are related. It means, a class has many methods are related.
- We can call Low Cohesion

What is the solution ?
- High Cohesion is better .

Problem: Sample code Low Cohesion
package com.scjp6.oop.cohesion;

public class ReportGrade {
    Student getStudent() {
      return new Student();
    }

    Subject getSubject() {
      return new Subject();
    } 

    Grade getGrade(){
      return new Grade();
    }
}

package com.scjp6.oop.cohesion;

public class RunLowerCohesion {

    public static void main(String[] args) {
      ReportGrade reportGrade = new ReportGrade();
      reportGrade.getGrade();
      reportGrade.getStudent();
      reportGrade.getSubject();
    }
}

Solution: Sample code High Cohesion

public class Grade {
    String studentID;
    String subjectID;
    float grade01;
    float grade02;
}

package com.scjp6.oop.cohesion;
public class Student {
    String studentID;
    String name;
    int age;
}


package com.scjp6.oop.cohesion;
public class Subject {
    String subjectID;
    String subjectName;
}


package com.scjp6.oop.cohesion;
public class ReportGradeHighCohesion {   
     Grade getGrade(){
       return new Grade();
    }
}


package com.scjp6.oop.cohesion;
public class ReportStudentHighCohesion {
    Student getStudent() {
      return new Student();
    }   
}


package com.scjp6.oop.cohesion;
public class ReportSubjectHighCohesion {
    Subject getSubject() {
      return new Subject();
    }
}


package com.scjp6.oop.cohesion;
public class RunHighCohesion {


    public static void main(String[] args) {
    ReportGradeHighCohesion reportGradeHighCohesion = new ReportGradeHighCohesion();
    reportGradeHighCohesion.getGrade();

    ReportStudentHighCohesion reportStudentHighCohesion = new ReportStudentHighCohesion();
    reportStudentHighCohesion.getStudent();

    ReportSubjectHighCohesion reportSubjectHighCohesion = new ReportSubjectHighCohesion();
    reportSubjectHighCohesion.getSubject();
    }
}




Wednesday, October 23, 2013

MDC Logger

What is MDC?
- MDC stands for Mapped Diagnostic Context.
- It is a map which stores the context data of the particular thread where the context is running
Where do we use it ?
- For Jersey: ContainerRequestFilter, ContainerResponseFilter
- For Spring MVC : HttpServletRequest, HttpServletResponse
Why do we use it ?
- It helps you to distinguish inter-leaving logs from multiple sources.
- When we have multiple user-requests coming in for a given servlet, each request of an user is serviced using a thread. This leaves multiple users logging to the same log file and the log statements get inter-mixed.
- Now, to filter out logs of a particular user, we need to append the user-id to the log statements so that we can search them in the log file easily.
- An obvious way of logging, is to append the user-id in the log statements i.e. log.info(userId+” logged something “);
- A non-invasive way of logging is to use MDC.
- With MDC, you put the user-id in a context-map which is attached to the thread (of each user request) by the logger.

public class SimpleMDC {
    static public void main(String[] args) throws Exception {
    // You can put values in the MDC at any time. Before anything else

    // we put the USER-ID

    MDC.put("USER-ID""DirecTV");
    Logger logger = LoggerFactory.getLogger(SimpleMDC.class);
    // We now put the IP-ADDRESS
    MDC.put("IP-ADDRESS""10.88.68.11");
  
    logger.info("Start Logging");
    logger.debug("Mapped Diagnostic Context");
    logger.error("One of the design goals of logback is to audit and debug complex distributed applications");
    logger.error("Most real-world distributed systems need to deal with multiple clients simultaneously. ");
    logger.error("In a typical multithreaded implementation of such a system");
    MDC.put("USER-ID""FPT");
    MDC.put("IP-ADDRESS""100.888.688.111");
  
    logger.info("Start Logging");
    logger.debug("Mapped Diagnostic Context");
    logger.error("One of the design goals of logback is to audit and debug complex distributed applications");
    logger.error("Most real-world distributed systems need to deal with multiple clients simultaneously. ");
    logger.error("In a typical multithreaded implementation of such a system");
    }
}

Source Code

Saturday, August 3, 2013

Rest Spring 3.1: Using RestTemplate For Get/Add/Update/Delete

Hi All,

I posted Sample with using RestTemplate, it is quite simple Example.
I have just implemented for Get, but Add,Update, Delete not yet.
Dowload Source code

-------------------------------------------------

package com.fpt.family.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.client.RestTemplate;

import com.fpt.family.dto.Father;
import com.jaxb.family.Family;

@Controller
public class FamilyController {

    private static RestTemplate restTemplate = new RestTemplate();

    private static final String serviceURL1 = "http://localhost:8080/springrestfuljaxb/ws/fpt/family/get";
    private static final String serviceURL2 = "http://localhost:8080/springrestfuljaxb/ws/fpt/family/get/";

    /**
     * Get All Family. You can implement for Mother, Children
     * 
     * @return
     */


    // http://localhost:8080/springrestful-client/getall
    @RequestMapping(value = "/getall", method = RequestMethod.GET)
    public @ResponseBody
    com.fpt.family.dto.Family getAll() {

    Family result = null;
    result = restTemplate.getForObject(serviceURL1, Family.class);

    Father father = new Father();
    father.setFatherName(result.getFather().getFatherName());
    father.setCompany(result.getFather().getCompany());

    com.fpt.family.dto.Family familyDto = new com.fpt.family.dto.Family();
    familyDto.setFather(father);

    return familyDto;
    }

    /**
     * 
     * Get family with flag.
     * 
     * @param flag
     * @return
     */

    // http://localhost:8080/springrestful-client/get/false
    // http://localhost:8080/springrestful-client/get/true
    @RequestMapping(value = "/get/{flag}", method = RequestMethod.GET)
    public @ResponseBody
    com.fpt.family.dto.Family getFamily(@PathVariable("flag") Boolean flag) {

    Family result = null;
    result = restTemplate.getForObject(serviceURL2 + flag, Family.class);
    if (flag) {
        Father father = new Father();
        father.setFatherName(result.getFather().getFatherName());
        father.setCompany(result.getFather().getCompany());

        com.fpt.family.dto.Family familyDto = new com.fpt.family.dto.Family();
        familyDto.setFather(father);
        return familyDto;
    } else {
        // Implelement
    }

    return null;
    }

}
Source Code

Friday, July 26, 2013

Using SOAP UI vs RestClient

I-Using RestClient tool:
II-Using SOAP UI tool:
- I have just uploaded TestCases for using SOAP UI. And, i have added GET/POST testCases,but not DELETE/PUT method.
- Dowload SOAP UI tool
- File/Import Project
- Hopefully, you enjoy.
SOAP UI Test Cases

Friday, July 12, 2013

Spring Restful: Get,Add,Update,Delete Restfull WS at Server Side

package com.fpt.family.controler;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.fpt.family.util.DateConverter;
import com.jaxb.family.Children;
import com.jaxb.family.Family;
import com.jaxb.family.Father;
import com.jaxb.family.Mother;

@Controller
@RequestMapping(\"fpt/family\")
public class FamilyController {

    // http://localhost:8080/springrestfuljaxb/ws/fpt/family/get
    @RequestMapping(value = \"/get\", method = RequestMethod.GET)
    public @ResponseBody
    Family getAllFamily() {

        Children children01 = new Children();
        children01.setFullName(\"Nguyen Trung Hieu Brother\");
        children01.setDateOfBirth(DateConverter
                .convertStringDateToXmlGregorianCalendar(\"2010/11/20\",
                        \"yyyy/MM/dd\"false));
        children01.setJob(\"Java Engineer\");
        children01.setCompany(\"Fsoft Company\");

        Children children02 = new Children();
        children02.setFullName(\"Nguyen Trung Hieu Brother\");
        children02.setDateOfBirth(DateConverter
                .convertStringDateToXmlGregorianCalendar(\"2010/11/20\",
                        \"yyyy/MM/dd\"false));
        children02.setJob(\"Java Engineer\");
        children02.setCompany(\"Fsoft Company\");

        Father father = new Father();
        father.setCompany(\"Fsoft Company\");
        father.setDateOfBirth(DateConverter
                .convertStringDateToXmlGregorianCalendar(\"2010/11/20\",
                        \"yyyy/MM/dd\"false));
        father.setFatherName(\"Nguyen Trung Hieu Father\");
        father.setJob(\"Java Engineer\");

        Mother mother = new Mother();
        mother.setCompany(\"Fsoft Company\");
        mother.setDateOfBirth(DateConverter
                .convertStringDateToXmlGregorianCalendar(\"2010/11/20\",
                        \"yyyy/MM/dd\"false));
        mother.setMotherName(\"Nguyen Trung Hieu Mother\");
        mother.setJob(\"Java Engineer\");

        Family family = new Family();

        family.setMother(mother);
        family.setFather(father);
        family.getChildren().add(children01);
        family.getChildren().add(children02);

        return family;
    }

    // http://localhost:8080/springrestfuljaxb/ws/fpt/family/get/true
    // http://localhost:8080/springrestfuljaxb/ws/fpt/family/get/false
    /**
     * Get Family
     * @param flag
     * @return
     */

    @RequestMapping(value = \"/get/{flag}\", method = RequestMethod.GET)
    public @ResponseBody
    Family getFamily(@PathVariable(\"flag\") Boolean flag) {
        Family family = null;
        if (flag) {
            Children children01 = new Children();
            children01.setFullName(\"Nguyen Trung Hieu Brother\");
            children01.setDateOfBirth(DateConverter
                    .convertStringDateToXmlGregorianCalendar(\"2010/11/20\",
                            \"yyyy/MM/dd\"false));
            children01.setJob(\"Java Engineer\");
            children01.setCompany(\"Fsoft Company\");

            Children children02 = new Children();
            children02.setFullName(\"Nguyen Trung Hieu Brother\");
            children02.setDateOfBirth(DateConverter
                    .convertStringDateToXmlGregorianCalendar(\"2010/11/20\",
                            \"yyyy/MM/dd\"false));
            children02.setJob(\"Java Engineer\");
            children02.setCompany(\"Fsoft Company\");

            Father father = new Father();
            father.setCompany(\"Fsoft Company\");
            father.setDateOfBirth(DateConverter
                    .convertStringDateToXmlGregorianCalendar(\"2010/11/20\",
                            \"yyyy/MM/dd\"false));
            father.setFatherName(\"Nguyen Trung Hieu Father\");
            father.setJob(\"Java Engineer\");

            Mother mother = new Mother();
            mother.setCompany(\"Fsoft Company\");
            mother.setDateOfBirth(DateConverter
                    .convertStringDateToXmlGregorianCalendar(\"2010/11/20\",
                            \"yyyy/MM/dd\"false));
            mother.setMotherName(\"Nguyen Trung Hieu Mother\");
            mother.setJob(\"Java Engineer\");

            family = new Family();

            family.setMother(mother);
            family.setFather(father);
            family.getChildren().add(children01);
            family.getChildren().add(children02);
        } else {
            Children children01 = new Children();
            children01.setFullName(\"Nguyen Trung Hieu Brother\");
            children01.setDateOfBirth(DateConverter
                    .convertStringDateToXmlGregorianCalendar(\"2010/11/20\",
                            \"yyyy/MM/dd\"false));
            children01.setJob(\"Java Engineer\");
            children01.setCompany(\"Fsoft Company\");

            Children children02 = new Children();
            children02.setFullName(\"Nguyen Trung Hieu Brother\");
            children02.setDateOfBirth(DateConverter
                    .convertStringDateToXmlGregorianCalendar(\"2010/11/20\",
                            \"yyyy/MM/dd\"false));
            children02.setJob(\"Java Engineer\");
            children02.setCompany(\"Fsoft Company\");

            Father father = new Father();
            father.setCompany(\"Fsoft Company\");
            father.setDateOfBirth(DateConverter
                    .convertStringDateToXmlGregorianCalendar(\"2010/11/20\",
                            \"yyyy/MM/dd\"false));
            father.setFatherName(\"Nguyen Trung Hieu Father\");
            father.setJob(\"Java Engineer\");

            Mother mother = new Mother();
            mother.setCompany(\"Fsoft Company\");
            mother.setDateOfBirth(DateConverter
                    .convertStringDateToXmlGregorianCalendar(\"2010/11/20\",
                            \"yyyy/MM/dd\"false));
            mother.setMotherName(\"Nguyen Trung Hieu Mother\");
            mother.setJob(\"Java Engineer\");

            family = new Family();
            family.setMother(mother);
            family.setFather(father);
            family.getChildren().add(children01);
            family.getChildren().add(children02);
        }

        return family;
    }

    // http://localhost:8080/springrestfuljaxb/ws/fpt/family/
    /**
     * For updating family
     * 
     * @param familyRequest
     * @return
     */

    @RequestMapping(value = \"/\", method = RequestMethod.PUT)
    public @ResponseBody
    Family updateFamily(@RequestBody Family familyRequest) {

        Family family = new Family();
        family.setFather(familyRequest.getFather());
        family.setMother(familyRequest.getMother());

        return family;
    }

    // http://localhost:8080/springrestfuljaxb/ws/fpt/family/
    /**
     * For add new family
     * 
     * @param familyRequest
     * @return
     */

    @RequestMapping(value = \"/\", method = RequestMethod.POST)
    public @ResponseBody
    Family addFamily(@RequestBody Family familyRequest) {

        Family family = new Family();
        family.setFather(familyRequest.getFather());
        family.setMother(familyRequest.getMother());

        return family;
    }

    // http://localhost:8080/springrestfuljaxb/ws/fpt/family/delete/true
    // http://localhost:8080/springrestfuljaxb/ws/fpt/family/delete/false
    /**
     * For Delete family: True delete All
     * 
     * @param flag
     * @param familyRequest
     * @return
     */

    @RequestMapping(value = \"/delete/{flag}\", method = RequestMethod.DELETE)
    public @ResponseBody
    Family deleteFamily(@PathVariable(\"flag\") Boolean flag,
            @RequestBody Family familyRequest) {

        Family family = null;

        if (flag) {
            family = new Family();
            family.setFather(familyRequest.getFather());
            family.setMother(familyRequest.getMother());
        } else {
            family = new Family();
            family.setFather(familyRequest.getFather());
            family.setMother(familyRequest.getMother());
        }

        return family;
    }
}
Source Code

Saturday, July 6, 2013

Spring Testing 3.1: Context Configuration Inheritance For XML

Step 01:

package com.config.inheritance.xml;

public class Department {
    private String departmentId;
    private String departmentName;

    public String getDepartmentId() {
        return departmentId;
    }

    public void setDepartmentId(String departmentId) {
        this.departmentId = departmentId;
    }

    public String getDepartmentName() {
        return departmentName;
    }

    public void setDepartmentName(String departmentName) {
        this.departmentName = departmentName;
    }
}

Step 02:

package com.config.inheritance.xml;

public class User {
    private String userName;
    private Long salary;

    public Long getSalary() {
        return salary;
    }

    public void setSalary(Long salary) {
        this.salary = salary;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }
}

Step 03: src/main/resources

"http://www.springframework.org/schema/beans\"
    xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" 
    xmlns:context=\"http://www.springframework.org/schema/context\"
    xsi:schemaLocation=\"http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context-3.0.xsd\">
 
    "departmentBean\"
 class=\"com.config.inheritance.xml.Department\">
        "departmentId\"
 value=\"ID-01\"/>
        "departmentName\"
 value=\"ACCOUNT\"/>
    
    


Step 04: src/main/resources

"http://www.springframework.org/schema/beans\"
    xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" 
    xmlns:context=\"http://www.springframework.org/schema/context\"
    xsi:schemaLocation=\"http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context-3.0.xsd\">
 
    "userBean\"
 class=\"com.config.inheritance.xml.User\">
        "userName\"
 value=\"Nguyen Trung Hieu\"/>
        "salary\"
 value=\"15000000\"/>
    
    


Step 05:src/test/java

package com.config.inheritance.xml.TEST;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertThat;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.config.inheritance.xml.User;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = \"classpath:userContext.xml\")
public class UserBeanTest {

    @Autowired
    User userBean;

    @Test
    public void testAddUser() {
        assertThat(userBean.getUserName(), equalTo(\"Nguyen Trung Hieu\"));
        assertThat(userBean.getSalary(), equalTo(15000000L));
    }
}

Step 06:src/test/java

package com.config.inheritance.xml.TEST;

import static org.hamcrest.CoreMatchers.equalTo;
import static org.junit.Assert.assertThat;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.config.inheritance.xml.Department;

@ContextConfiguration(locations = \"classpath:departmentContext.xml\")
public class DepartmentBeanTest extends UserBeanTest {
    @Autowired
    Department departmentBean;

    @Test
    public void testAddDepartment() {
        assertThat(departmentBean.getDepartmentId(), equalTo(\"ID-01\"));
        assertThat(departmentBean.getDepartmentName(), equalTo(\"ACCOUNT\"));
    }
}

Source Code

JAXB: Using Maven Plugin XJC tool to generate POJO objects

Step 01: Family.xsd
<?xml version="1.0" encoding="UTF-8"?>
<!-- (c) 2010 DIRECTV, Inc. All rights reserved. -->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb">

    <xsd:complexType name="father">
            <xsd:sequence>
                <xsd:element name="fatherName" type="xsd:string"
                    minOccurs="0" />
                <xsd:element name="dateOfBirth" type="xsd:date"
                    minOccurs="0" />
                <xsd:element name="job" type="xsd:string" minOccurs="0" />
                <xsd:element name="age" type="xsd:int" minOccurs="0" />
            </xsd:sequence>
    </xsd:complexType>
    
    <xsd:complexType name="mother">
        <xsd:sequence>
            <xsd:element name="motherName" type="xsd:string"/>
            <xsd:element name="dateOfBirth" type="xsd:date"/>
            <xsd:element name="job" type="xsd:string"/>
            <xsd:element name="age" type="xsd:int"/>
        </xsd:sequence>
    </xsd:complexType>
    
    <xsd:complexType name="children">
        <xsd:sequence>
            <xsd:element name="fullName" type="xsd:string"
                minOccurs="0" />
            <xsd:element name="dateOfBirth" type="xsd:date"
                minOccurs="0" />
            <xsd:element name="job" type="xsd:string" minOccurs="0" />
            <xsd:element name="age" type="xsd:int" minOccurs="0" />
        </xsd:sequence>
    </xsd:complexType>
    
    <xsd:element name="family">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element name="father" type="father"/>
                <xsd:element name="mother" type="mother"/>
                <xsd:element name="children" type="children" maxOccurs="unbounded"/>
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>
    
</xsd:schema>
Step 02: Pom.xsd
<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.sample.common</groupId>
    <artifactId>restfuljaxb</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>war</packaging>
    <name>restfuljaxb Maven Webapp</name>
    <url>http://maven.apache.org</url>

    <repositories>
        <repository>
            <id>maven2-repository.java.net</id>
            <name>Java.net Repository for Maven</name>
            <url>http://download.java.net/maven/2/</url>
            <layout>default</layout>
        </repository>
    </repositories>

    <properties>
        <jersey.version>1.16</jersey.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.8.2</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <finalName>restfuljaxb</finalName>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <!-- Plugin to generate POJOs -->
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jaxb2-maven-plugin</artifactId>
                <version>1.3</version>
                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>xjc</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <packageName>com.jaxb.family</packageName>
                    <schemaDirectory>${basedir}/src/main/resources</schemaDirectory>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>
Step 03: Maven Build maven install
Step 04: Output