Monday, November 28, 2022

Maven

 

  • Maven is an OS, Java Based, Build tool.
  • Maven is going to support only "Java Projects".
  • To create Packages/ Build Artifacts we will use Maven.
    • Java--------->  Ant, Maven, Gradle
    • .Net ---------> Nant, MS-Build
    • Python------> PYBuilder
    • Puby--------> Rake
    • JS, Node JS, Angular-------> Grunt, Gulp 
1. How to know which version we are using?

        cat /etc/release                     (Latest version is ---11)

Types of Applications in Java:
  • Java Standalone apps
      • Jar------Java Archive
      • Java Code
      • .Class-files
  • Java Web apps
      • War------Web Archive
      • War = Jar + Web content ------(Html,CSS,js,XML,HTMLImage)
  • Java Enterprise Apps
      • Ear------Enterprise Archive
      • Ear =  Jar + 1 War
Default Build Script File Name

        Pom.xml -------------------- Package Object Model

<project>

<groupId>         com.Company_Name      </groupId>
<artifactId>       Project_Name                 </artifactId>
<packaging>     jar                                   </packaging>
<version>         0.0.1-SNAPSHOT        </version>
</project>

        
2. Is it possible to change the Pom.xml file name?
    Yes 
    Maybe didn't we can give it. I didn't try it
  • Along with the Source Code Developer will prepare Build Script also.
Directory Structure:
  • Bin:      binaries--mvn   
  • Conf:    Settings.xml
  • Lib:       libraries---java files
  • Boot:
Installation:
  • Java 8 -----Java 1.8
  • java -version
  • mvn -version
Maven Repositories:
  • Maven Local Repo
    • C:\Users\Reddy Shekar\.m2\repository------------Windows
    • /home/ReddySekhar/.m2/repository----------------Linux
  • Maven Central Repo
    • it will be by the Maven community team.
Remote Repo
    • It will be used within the organization
3. Is there any chance of changing the default path to a custom one?
      
    Yes Can change that custom path
  • Setting.xml
    • LocalRepository <Tag>

 Maven life Cycles:

life Cycles              Goals

Clean----------------It will delete the previous build files.
Site------------------To generate a document for your source code.
Default-------------
  • Validate------------It will validate your project Structure and resource files.
  • Compile-----------It will compile your source code.
  • Test----------------It will use to run Junit Test cases.
  • Package-----------It will create packages / Build Artifacts.
  • Install-------------It will store your build Build Artifacts in a local Repo.
  • Deploy-----------It will store your build Build Artifacts in a Remote Repo.
4. What is the difference between the Maven Local Repo & Remote Repo?
  • Install-------------It will store your build Build Artifacts in a local Repo.
  • Deploy-----------It will store your build Build Artifacts in a Remote Repo.
5. How to skip the Test cases?
    
    



0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home