38- Packaging Structure of the project

 

Image 1:  packaging structure for student-management-system

_______________________________________________________

  YELLOW IS for Java Project 

  BLUE IS for   Folder

  GREEN IS for Package

  RED IS for Class 

Pink is for  pom.xml

_________________________________________

student-management-system

     -->  src/main/java

                 net.javaguides.springboot

                            StudentManagementSystemApplication.java

                 net.javaguides.springboot.controller

                             StudentController.java

                 net.javaguides.springboot.entity

                              Student.java

                net.javaguides.springboot.repository

                               StudentRepository.java

                net.javaguides.springboot.service   

                                StudentService.java

                net.javaguides.springboot.service.impl

                                 StudentServiceImpl.java

                         

         -->   src/main/resources

                            static

                             templates

                                        create_student.html      

                                         edit_student.html         

                                         students.html               

                             application.properties


           -->   src/test/java

           -->  JRE System Library

           -->  MavenDependencies

           -->  src

           --> target

        

           --> mvnw

           --> mvnw.cmd

         

        --> pom.xml

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

student-management-system   --> pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.6.6</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>net.javaguides.sms</groupId>
    <artifactId>student-management-system</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>student-management-system</name>
    <description>RESTful web services</description>
    <properties>
        <java.version>17</java.version>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>


        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>


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

Explaining Each component of project structure


src/main/java

This is the main method to launch project...

Java source code for the artifact.

The main folder contains your application code and resources.


src/main/resources

Resources used in the project.

Static resources like css,js,images inside static folder  

jsp or html files under templates folder

Configuring all application level configuration in application.properties


In this project we are using  html files inside template folder

        template ---->      create_student.html     

        template ---->      edit_student.html        

        template ---->       students.html               

      

pom.xml

 It is an XML file that contains information about the project and configuration details used by Maven to build the project.

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

JRE System Library

Basically the  library of project(managed by IDE)


src/test/java

 The test folder contains  test code and resources.

Places your test use case code, like junit test.

 These codes would be executed when doing maven package things. These codes won't be packaged to your war or jar file.


src  

The src directory contains all of the source material for building the project, its site and so on. 

It contains a subdirectory for each type: main for the main build artifacttest for the unit test code and resources, site and so on.


 target 

 The target directory is used to house all output of the build.


mvnw 

The mvnw file is for Linux (bash) environment


mvnw.cmd

   The mvnw.cmd is for the Windows environment.


Comments

Popular posts from this blog

INDEX OF Zeek Spring Boot