Skip to content
Nikolina Djekic edited this page Mar 3, 2022 · 4 revisions

Maven

  • Software project management, central repository to
  • Artifacts - files, usually a JAR, that gets deployed to a Maven repository
  • GroupId - will indentify project uniquely across all projects
  • archetype:generate - Generates new project from an archetype

Installation

  • Install maven locally - Download link
    • Copy path to file and add to sys variables as MAVEN_HOME
    • Add path to /bin folder to Path - click and then new
  • Link for maven repository
  • Maven in 5 minutes
  • install dependencies in pom.xml
  • choose maven-archetype-quickstart - for quickstarting projects

pom.xml

  • Dependencies / plugins
    • Maven surefire plugin - executes all test cases - + configuration for testng.xml

              <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-surefire-plugin</artifactId>
                 <version>3.0.0-M5</version>
          <configuration>
          <suiteXmlFiles>
            <suiteXmlFile>testng.xml</suiteXmlFile>
          </suiteXmlFiles>
        </configuration>
             </plugin>
    • Maven surefire commands

         mvn --version
         mvn clean - delete all temporary files - recommended before execution
         mvn compile - check syntax errors
         mvn test - trigger test execution
         mvn -Dtest=TestName test - run a single test
    • Maven common problems with compiling Link

    • Profiling

      • Make annotation with id - NAme of them and paste build tag inside to make multiple profiles xml mvn test -PRegression

Clone this wiki locally