Book Image

Mastering Apache Maven 3

Book Image

Mastering Apache Maven 3

Overview of this book

Table of Contents (16 chapters)
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

A runnable, standalone Maven project


As we covered a lot of ground-related information to the Maven assembly plugin, let's see how to build a complete end-to-end runnable, standalone project with the assembly plugin. You can find the complete sample at https://svn.wso2.org/repos/wso2/people/prabath/maven/chapter06. Proceed with the following steps:

  1. First, create a directory structure in the following manner:

           |-pom.xml
           |-modules
             |- json-parser
                |- src/main/java/com/packt/json/JSONParser.java
                |- pom.xml
             |- distribution
                |- src/main/assembly/dist.xml
                |- pom.xml
  2. JSONParser.java is a simple Java class, which reads a JSON file and prints to the console, shown as follows:

    package com.packt.json;
    
    import java.io.File;
    import java.io.FileReader;
    import org.json.simple.JSONObject;
    
    public class JSONParser {
    
      public static void main(String[] args) {
    
      FileReader fileReader;
      JSONObject json;
      org.json.simple.parser.JSONParser...