SlideShare une entreprise Scribd logo
1  sur  11
by Holasz Kati & Ilies Amelia
MAVEN
SureFire vs. FailSafe
by Holasz Kati & Ilies Amelia
Contents
Running tests in parallel................................................................................................................. 3
Skipping Tests ................................................................................................................................ 3
Inclusions and Exclusions of Tests............................................................................................... 4
Inclusions .................................................................................................................................... 4
Exclusions.................................................................................................................................... 4
Running a Single Test.................................................................................................................... 5
Running a set of methods in a Single Test Class.......................................................................... 5
Install Plugin.................................................................................................................................. 6
The install:install-file goal.......................................................................................................... 6
QUESTIONS….............................................................................................................................. 7
How To Include Custom Library Into Maven Local Repository?............................................... 7
How To Add Remote Repository In Maven? ............................................................................... 7
How To Display Maven Plugin Goals And Parameters? ........................................................... 8
Useful Explanations....................................................................................................................... 9
Unit Testing................................................................................................................................. 9
Integration Testing...................................................................................................................... 9
Mojo ............................................................................................................................................ 9
Plug-in......................................................................................................................................... 9
Build Lifecycle........................................................................................................................... 10
References .................................................................................................................................... 11
by Holasz Kati & Ilies Amelia
Running tests in parallel
To do this, you must set the parallel parameter, and may change the threadCount or
useUnlimitedThreads attribute. For example:
<plugins>
[...]
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
<configuration>
<parallel>methods</parallel>
<threadCount>10</threadCount>
</configuration>
</plugin>
[...]
</plugins>
Skipping Tests
To skip running the tests for a particular project, set the skipTests property to true.
<project>
[...]
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
</plugins>
</build>
[...]
by Holasz Kati & Ilies Amelia
</project>
You can also skip the tests via command line by executing the following command:
mvn install -DskipTests
Inclusions and Exclusions of Tests
Inclusions
By default, the Surefire Plugin will automatically include all test classes with the following wildcard
patterns: "**/Test*.java" , “**/*Test.java", "**/*TestCase.java".
<project>
[...]
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
<configuration>
<includes>
<include>Sample.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
[...]
</project>
Exclusions
Exclusions can be done by configuring the excludes property of the plugin.
<project>
[...]
<build>
<plugins>
by Holasz Kati & Ilies Amelia
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
<configuration>
<excludes>
<exclude>**/TestCircle.java</exclude>
<exclude>**/TestSquare.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
[...]
</project>
Running a Single Test
To run this through Maven, set the test property to a specific test case.
mvn -Dtest=TestCircle test
You may also use patterns to run a number of tests:
mvn -Dtest=TestCi*le test
And you may use multiple names/patterns, separated by commas:
mvn -Dtest=TestSquare,TestCi*le test
Running a set of methods in a Single Test Class
You must use the following syntax
mvn -Dtest=TestCircle#mytest test
You can use patterns too
mvn -Dtest=TestCircle#test* test
As of surefire 2.12.1, you can select multiple methods:
by Holasz Kati & Ilies Amelia
mvn -Dtest=TestCircle#testOne+testTwo test
Install Plugin
With the maven-install-plugin you can put your artifacts in the local repository.
The install:install-file goal
The install:install-file goal is used primarily for installing artifacts to the local repository
which were not built by Maven. The project's development team may or may not
provide a POM for the artifact. Here's a list of some of the available parameters for
the install-file goal:
mvn install:install-file -Dfile=your-artifact-1.0.jar 
[-DpomFile=your-pom.xml] 
[-Dsources=src.jar] 
[-Djavadoc=apidocs.jar] 
[-DgroupId=org.some.group] 
[-DartifactId=your-artifact] 
[-Dversion=1.0] 
[-Dpackaging=jar] 
[-Dclassifier=sources] 
[-DgeneratePom=true] 
[-DcreateChecksum=true]
the groupId, artifactId, version and packaging of the file to install. These can be taken
from the specified pomFile, extracted from the pom.xml inside the artifact, and
overridden or specified using the command line. When the pomFile contains
a parent section, the parent's groupId can be considered if the groupId is not specified
further for the current project or on the command line.
Ex:
mvn -X install:install-file
-Dfile=path/to/mly/jar
-DgroupId=j<groupname>
-DartifactId=<artifactname>
-Dversion=<version>
-Dpackaging=jar
by Holasz Kati & Ilies Amelia
QUESTIONS…
How To Include Custom Library Into Maven Local Repository?
For example, kaptcha, a popular third party Java library, which is used to generate “captcha”
image to stop spam, but it’s not available in the Maven center repository.
In this tutorial, we will show you how to install the “kaptcha” jar into your Maven’s local
repository.
mvn install
Download the “kaptcha“, extract it and copy the kapcha-version.jar to somewhere else, for
example, c drive. Issue following command:
mvn install:install-file -Dfile=c:kaptcha-{version}.jar
-DgroupId=com.google.code
-DartifactId=kaptcha
-Dversion={version}
-Dpackaging=jar
pom.xml
o declare the kaptcha coordinate in pom.xml.
<dependency>
<groupId>com.google.code</groupId>
<artifactId>kaptcha</artifactId>
<version>2.3</version>
</dependency>
Done
Build it, now the “kaptcha” jar is able to retrieve from your Maven local repository.
How To Add Remote Repository In Maven?
By default, Maven download all dependencies from Maven Central Repository. But, some
libraries are missing in central repository, and only available in remote repository.
by Holasz Kati & Ilies Amelia
Ex: Java.net Repository
Add Java.net remote repository details in pom.xml file.
<project ...>
<repositories>
<repository>
<id>java.net</id>
<url>https://maven.java.net/content/repositories/public/</url>
</repository>
</repositories>
</project>
How To Display Maven Plugin Goals And Parameters?
mvn help:describe -Dplugin=eclipse
List all of the available goals of maven-eclipse plugin.
mvn help:describe -Dplugin=eclipse
mvn help:describe -Dplugin=eclipse -Dmojo=eclipse
Display the detail of “eclipse” parameter of maven-eclipse plugin, with full explanation.
mvn help:describe -Dplugin=eclipse -Dmojo=eclipse -Dfull=true
Note : “mojo” is means the parameter of plugin.
by Holasz Kati & Ilies Amelia
Useful Explanations
Unit Testing
The primary goal of unit testing is to take the smallest piece of testable software in the
application, isolate it from the remainder of the code, and determine whether it behaves
exactly as you expect. Each unit is tested separately before integrating them into modules
to test the interfaces between modules.
Integration Testing
Integration testing is a logical extension of unit testing. In its simplest form, two units
that have already been tested are combined into a component and the interface between
them is tested.
The idea is to test combinations of pieces and eventually expand the process to test your
modules with those of other groups. Eventually all the modules making up a process are
tested together. Beyond that, if the program is composed of more than one process, they
should be tested in pairs rather than all at once.
Integration testing identifies problems that occur when units are combined. By using a
test plan that requires you to test each unit and ensure the viability of each before
combining units, you know that any errors discovered when combining units are likely
related to the interface between units. This method reduces the number of possibilities to
a far simpler level of analysis.
It occurs after unit testing and before validation testing.
Mojo
A Mojo is really just a goal in Maven 2, and plug-ins consist of any number of goals
(Mojos). Mojos can be defined as annotated Java classes or Beanshell script. A Mojo
specifies metadata about a goal: a goal name, which phase of the lifecycle it fits into, and
the parameters it is expecting.
MOJO is a play on POJO (Plain-old-Java-object), substituting "Maven" for "Plain".
Plug-in
"Maven" is really just a core framework for a collection of Maven Plugins. In other
words, plugins are where much of the real action is performed, plugins are used to: create
jar files, create war files, compile code, unit test code, create project documentation, and
on and on. Almost any action that you can think of performing on a project is
implemented as a Maven plugin.
Plugins are the central feature of Maven that allow for the reuse of common build logic
across multiple projects. They do this by executing an "action" (i.e. creating a WAR file
or compiling unit tests) in the context of a project's description - the Project Object Model
by Holasz Kati & Ilies Amelia
(POM). Plugin behavior can be customized through a set of unique parameters which are
exposed by a description of each plugin goal (or Mojo).
Build Lifecycle
is a series of common stages through which all project builds naturally progress. Plugin
goals are bound to specific stages in the lifecycle.
by Holasz Kati & Ilies Amelia
References
http://maven.apache.org
http://maven.apache.org/plugins/index.html
SureFire Plug-in details: http://maven.apache.org/surefire/
FailSafe Plug-in details: http://maven.apache.org/surefire/maven-failsafe-plugin/
http://en.wikipedia.org/wiki/Integration_testing
http://en.wikipedia.org/wiki/Unit_testing
http://en.wikipedia.org/wiki/Apache_Maven
http://maven.apache.org/guides/introduction/introduction-to-plugins.html
http://maven.apache.org/plugins/index.html

Contenu connexe

Tendances

New Features PHPUnit 3.3 - Sebastian Bergmann
New Features PHPUnit 3.3 - Sebastian BergmannNew Features PHPUnit 3.3 - Sebastian Bergmann
New Features PHPUnit 3.3 - Sebastian Bergmann
dpc
 

Tendances (20)

Introduction to Unit Testing with PHPUnit
Introduction to Unit Testing with PHPUnitIntroduction to Unit Testing with PHPUnit
Introduction to Unit Testing with PHPUnit
 
Efficient JavaScript Unit Testing, March 2013
Efficient JavaScript Unit Testing, March 2013Efficient JavaScript Unit Testing, March 2013
Efficient JavaScript Unit Testing, March 2013
 
ScalaUA - distage: Staged Dependency Injection
ScalaUA - distage: Staged Dependency InjectionScalaUA - distage: Staged Dependency Injection
ScalaUA - distage: Staged Dependency Injection
 
Android Meetup Slovenija #3 - Testing with Robolectric by Ivan Kust
Android Meetup Slovenija #3 - Testing with Robolectric by Ivan KustAndroid Meetup Slovenija #3 - Testing with Robolectric by Ivan Kust
Android Meetup Slovenija #3 - Testing with Robolectric by Ivan Kust
 
New Features PHPUnit 3.3 - Sebastian Bergmann
New Features PHPUnit 3.3 - Sebastian BergmannNew Features PHPUnit 3.3 - Sebastian Bergmann
New Features PHPUnit 3.3 - Sebastian Bergmann
 
JAVASCRIPT TDD(Test driven Development) & Qunit Tutorial
JAVASCRIPT TDD(Test driven Development) & Qunit TutorialJAVASCRIPT TDD(Test driven Development) & Qunit Tutorial
JAVASCRIPT TDD(Test driven Development) & Qunit Tutorial
 
Arquillian : An introduction
Arquillian : An introductionArquillian : An introduction
Arquillian : An introduction
 
Spring hibernate jsf_primefaces_intergration
Spring hibernate jsf_primefaces_intergrationSpring hibernate jsf_primefaces_intergration
Spring hibernate jsf_primefaces_intergration
 
Hyper-pragmatic Pure FP testing with distage-testkit
Hyper-pragmatic Pure FP testing with distage-testkitHyper-pragmatic Pure FP testing with distage-testkit
Hyper-pragmatic Pure FP testing with distage-testkit
 
Glassfish JEE Server Administration - Clustering
Glassfish JEE Server Administration - ClusteringGlassfish JEE Server Administration - Clustering
Glassfish JEE Server Administration - Clustering
 
Implementing Quality on a Java Project
Implementing Quality on a Java ProjectImplementing Quality on a Java Project
Implementing Quality on a Java Project
 
Izumi 1.0: Your Next Scala Stack
Izumi 1.0: Your Next Scala StackIzumi 1.0: Your Next Scala Stack
Izumi 1.0: Your Next Scala Stack
 
Unit testing with PHPUnit - there's life outside of TDD
Unit testing with PHPUnit - there's life outside of TDDUnit testing with PHPUnit - there's life outside of TDD
Unit testing with PHPUnit - there's life outside of TDD
 
Selenium Training | TestNG Framework For Selenium | Selenium Tutorial For Beg...
Selenium Training | TestNG Framework For Selenium | Selenium Tutorial For Beg...Selenium Training | TestNG Framework For Selenium | Selenium Tutorial For Beg...
Selenium Training | TestNG Framework For Selenium | Selenium Tutorial For Beg...
 
PHPUnit: from zero to hero
PHPUnit: from zero to heroPHPUnit: from zero to hero
PHPUnit: from zero to hero
 
Test Driven Development with PHPUnit
Test Driven Development with PHPUnitTest Driven Development with PHPUnit
Test Driven Development with PHPUnit
 
(Unit )-Testing for Joomla
(Unit )-Testing for Joomla(Unit )-Testing for Joomla
(Unit )-Testing for Joomla
 
Testing w-mocks
Testing w-mocksTesting w-mocks
Testing w-mocks
 
Scala, Functional Programming and Team Productivity
Scala, Functional Programming and Team ProductivityScala, Functional Programming and Team Productivity
Scala, Functional Programming and Team Productivity
 
jUnit
jUnitjUnit
jUnit
 

Similaire à MAVEN - Short documentation

Apache maven, a software project management tool
Apache maven, a software project management toolApache maven, a software project management tool
Apache maven, a software project management tool
Renato Primavera
 
Unit testing php-unit - phing - selenium_v2
Unit testing   php-unit - phing - selenium_v2Unit testing   php-unit - phing - selenium_v2
Unit testing php-unit - phing - selenium_v2
Tricode (part of Dept)
 
Coldbox developer training – session 4
Coldbox developer training – session 4Coldbox developer training – session 4
Coldbox developer training – session 4
Billie Berzinskas
 

Similaire à MAVEN - Short documentation (20)

Java, Eclipse, Maven & JSF tutorial
Java, Eclipse, Maven & JSF tutorialJava, Eclipse, Maven & JSF tutorial
Java, Eclipse, Maven & JSF tutorial
 
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-AppsSelenium-Browser-Based-Automated-Testing-for-Grails-Apps
Selenium-Browser-Based-Automated-Testing-for-Grails-Apps
 
Testing Java Web Apps With Selenium
Testing Java Web Apps With SeleniumTesting Java Web Apps With Selenium
Testing Java Web Apps With Selenium
 
Exploring Maven SVN GIT
Exploring Maven SVN GITExploring Maven SVN GIT
Exploring Maven SVN GIT
 
Maven 2 features
Maven 2 featuresMaven 2 features
Maven 2 features
 
Continuous Integration Testing in Django
Continuous Integration Testing in DjangoContinuous Integration Testing in Django
Continuous Integration Testing in Django
 
Presentation
PresentationPresentation
Presentation
 
Maven, Eclipse and OSGi Working Together - Carlos Sanchez
Maven, Eclipse and OSGi Working Together - Carlos SanchezMaven, Eclipse and OSGi Working Together - Carlos Sanchez
Maven, Eclipse and OSGi Working Together - Carlos Sanchez
 
Oscon 2012 tdd_cassandra
Oscon 2012 tdd_cassandraOscon 2012 tdd_cassandra
Oscon 2012 tdd_cassandra
 
Apache maven, a software project management tool
Apache maven, a software project management toolApache maven, a software project management tool
Apache maven, a software project management tool
 
Test ng for testers
Test ng for testersTest ng for testers
Test ng for testers
 
StreamSets DataOps Platform Fundamentals.pptx
StreamSets DataOps Platform Fundamentals.pptxStreamSets DataOps Platform Fundamentals.pptx
StreamSets DataOps Platform Fundamentals.pptx
 
Jbossworld Presentation
Jbossworld PresentationJbossworld Presentation
Jbossworld Presentation
 
Testing in Craft CMS
Testing in Craft CMSTesting in Craft CMS
Testing in Craft CMS
 
Introduction to maven, its configuration, lifecycle and relationship to JS world
Introduction to maven, its configuration, lifecycle and relationship to JS worldIntroduction to maven, its configuration, lifecycle and relationship to JS world
Introduction to maven, its configuration, lifecycle and relationship to JS world
 
Maven advanced
Maven advancedMaven advanced
Maven advanced
 
Unit testing php-unit - phing - selenium_v2
Unit testing   php-unit - phing - selenium_v2Unit testing   php-unit - phing - selenium_v2
Unit testing php-unit - phing - selenium_v2
 
Using Maven2
Using Maven2Using Maven2
Using Maven2
 
Coldbox developer training – session 4
Coldbox developer training – session 4Coldbox developer training – session 4
Coldbox developer training – session 4
 
Integration Testing on Steroids: Run Your Tests on the Real Things
Integration Testing on Steroids: Run Your Tests on the Real ThingsIntegration Testing on Steroids: Run Your Tests on the Real Things
Integration Testing on Steroids: Run Your Tests on the Real Things
 

Plus de Holasz Kati (7)

Testing types functional and nonfunctional - Kati Holasz
Testing types   functional and nonfunctional - Kati HolaszTesting types   functional and nonfunctional - Kati Holasz
Testing types functional and nonfunctional - Kati Holasz
 
Four schools of testing context driven school
Four schools of testing   context driven schoolFour schools of testing   context driven school
Four schools of testing context driven school
 
Your body language shapes who you are - K.H.
Your body language shapes who you are - K.H.Your body language shapes who you are - K.H.
Your body language shapes who you are - K.H.
 
Transformational Management
Transformational ManagementTransformational Management
Transformational Management
 
Maven Presentation - SureFire vs FailSafe
Maven Presentation - SureFire vs FailSafeMaven Presentation - SureFire vs FailSafe
Maven Presentation - SureFire vs FailSafe
 
Maven Setup
Maven SetupMaven Setup
Maven Setup
 
SEO Testing v2.0
SEO Testing v2.0SEO Testing v2.0
SEO Testing v2.0
 

MAVEN - Short documentation

  • 1. by Holasz Kati & Ilies Amelia MAVEN SureFire vs. FailSafe
  • 2. by Holasz Kati & Ilies Amelia Contents Running tests in parallel................................................................................................................. 3 Skipping Tests ................................................................................................................................ 3 Inclusions and Exclusions of Tests............................................................................................... 4 Inclusions .................................................................................................................................... 4 Exclusions.................................................................................................................................... 4 Running a Single Test.................................................................................................................... 5 Running a set of methods in a Single Test Class.......................................................................... 5 Install Plugin.................................................................................................................................. 6 The install:install-file goal.......................................................................................................... 6 QUESTIONS….............................................................................................................................. 7 How To Include Custom Library Into Maven Local Repository?............................................... 7 How To Add Remote Repository In Maven? ............................................................................... 7 How To Display Maven Plugin Goals And Parameters? ........................................................... 8 Useful Explanations....................................................................................................................... 9 Unit Testing................................................................................................................................. 9 Integration Testing...................................................................................................................... 9 Mojo ............................................................................................................................................ 9 Plug-in......................................................................................................................................... 9 Build Lifecycle........................................................................................................................... 10 References .................................................................................................................................... 11
  • 3. by Holasz Kati & Ilies Amelia Running tests in parallel To do this, you must set the parallel parameter, and may change the threadCount or useUnlimitedThreads attribute. For example: <plugins> [...] <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.16</version> <configuration> <parallel>methods</parallel> <threadCount>10</threadCount> </configuration> </plugin> [...] </plugins> Skipping Tests To skip running the tests for a particular project, set the skipTests property to true. <project> [...] <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.16</version> <configuration> <skipTests>true</skipTests> </configuration> </plugin> </plugins> </build> [...]
  • 4. by Holasz Kati & Ilies Amelia </project> You can also skip the tests via command line by executing the following command: mvn install -DskipTests Inclusions and Exclusions of Tests Inclusions By default, the Surefire Plugin will automatically include all test classes with the following wildcard patterns: "**/Test*.java" , “**/*Test.java", "**/*TestCase.java". <project> [...] <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.16</version> <configuration> <includes> <include>Sample.java</include> </includes> </configuration> </plugin> </plugins> </build> [...] </project> Exclusions Exclusions can be done by configuring the excludes property of the plugin. <project> [...] <build> <plugins>
  • 5. by Holasz Kati & Ilies Amelia <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.16</version> <configuration> <excludes> <exclude>**/TestCircle.java</exclude> <exclude>**/TestSquare.java</exclude> </excludes> </configuration> </plugin> </plugins> </build> [...] </project> Running a Single Test To run this through Maven, set the test property to a specific test case. mvn -Dtest=TestCircle test You may also use patterns to run a number of tests: mvn -Dtest=TestCi*le test And you may use multiple names/patterns, separated by commas: mvn -Dtest=TestSquare,TestCi*le test Running a set of methods in a Single Test Class You must use the following syntax mvn -Dtest=TestCircle#mytest test You can use patterns too mvn -Dtest=TestCircle#test* test As of surefire 2.12.1, you can select multiple methods:
  • 6. by Holasz Kati & Ilies Amelia mvn -Dtest=TestCircle#testOne+testTwo test Install Plugin With the maven-install-plugin you can put your artifacts in the local repository. The install:install-file goal The install:install-file goal is used primarily for installing artifacts to the local repository which were not built by Maven. The project's development team may or may not provide a POM for the artifact. Here's a list of some of the available parameters for the install-file goal: mvn install:install-file -Dfile=your-artifact-1.0.jar [-DpomFile=your-pom.xml] [-Dsources=src.jar] [-Djavadoc=apidocs.jar] [-DgroupId=org.some.group] [-DartifactId=your-artifact] [-Dversion=1.0] [-Dpackaging=jar] [-Dclassifier=sources] [-DgeneratePom=true] [-DcreateChecksum=true] the groupId, artifactId, version and packaging of the file to install. These can be taken from the specified pomFile, extracted from the pom.xml inside the artifact, and overridden or specified using the command line. When the pomFile contains a parent section, the parent's groupId can be considered if the groupId is not specified further for the current project or on the command line. Ex: mvn -X install:install-file -Dfile=path/to/mly/jar -DgroupId=j<groupname> -DartifactId=<artifactname> -Dversion=<version> -Dpackaging=jar
  • 7. by Holasz Kati & Ilies Amelia QUESTIONS… How To Include Custom Library Into Maven Local Repository? For example, kaptcha, a popular third party Java library, which is used to generate “captcha” image to stop spam, but it’s not available in the Maven center repository. In this tutorial, we will show you how to install the “kaptcha” jar into your Maven’s local repository. mvn install Download the “kaptcha“, extract it and copy the kapcha-version.jar to somewhere else, for example, c drive. Issue following command: mvn install:install-file -Dfile=c:kaptcha-{version}.jar -DgroupId=com.google.code -DartifactId=kaptcha -Dversion={version} -Dpackaging=jar pom.xml o declare the kaptcha coordinate in pom.xml. <dependency> <groupId>com.google.code</groupId> <artifactId>kaptcha</artifactId> <version>2.3</version> </dependency> Done Build it, now the “kaptcha” jar is able to retrieve from your Maven local repository. How To Add Remote Repository In Maven? By default, Maven download all dependencies from Maven Central Repository. But, some libraries are missing in central repository, and only available in remote repository.
  • 8. by Holasz Kati & Ilies Amelia Ex: Java.net Repository Add Java.net remote repository details in pom.xml file. <project ...> <repositories> <repository> <id>java.net</id> <url>https://maven.java.net/content/repositories/public/</url> </repository> </repositories> </project> How To Display Maven Plugin Goals And Parameters? mvn help:describe -Dplugin=eclipse List all of the available goals of maven-eclipse plugin. mvn help:describe -Dplugin=eclipse mvn help:describe -Dplugin=eclipse -Dmojo=eclipse Display the detail of “eclipse” parameter of maven-eclipse plugin, with full explanation. mvn help:describe -Dplugin=eclipse -Dmojo=eclipse -Dfull=true Note : “mojo” is means the parameter of plugin.
  • 9. by Holasz Kati & Ilies Amelia Useful Explanations Unit Testing The primary goal of unit testing is to take the smallest piece of testable software in the application, isolate it from the remainder of the code, and determine whether it behaves exactly as you expect. Each unit is tested separately before integrating them into modules to test the interfaces between modules. Integration Testing Integration testing is a logical extension of unit testing. In its simplest form, two units that have already been tested are combined into a component and the interface between them is tested. The idea is to test combinations of pieces and eventually expand the process to test your modules with those of other groups. Eventually all the modules making up a process are tested together. Beyond that, if the program is composed of more than one process, they should be tested in pairs rather than all at once. Integration testing identifies problems that occur when units are combined. By using a test plan that requires you to test each unit and ensure the viability of each before combining units, you know that any errors discovered when combining units are likely related to the interface between units. This method reduces the number of possibilities to a far simpler level of analysis. It occurs after unit testing and before validation testing. Mojo A Mojo is really just a goal in Maven 2, and plug-ins consist of any number of goals (Mojos). Mojos can be defined as annotated Java classes or Beanshell script. A Mojo specifies metadata about a goal: a goal name, which phase of the lifecycle it fits into, and the parameters it is expecting. MOJO is a play on POJO (Plain-old-Java-object), substituting "Maven" for "Plain". Plug-in "Maven" is really just a core framework for a collection of Maven Plugins. In other words, plugins are where much of the real action is performed, plugins are used to: create jar files, create war files, compile code, unit test code, create project documentation, and on and on. Almost any action that you can think of performing on a project is implemented as a Maven plugin. Plugins are the central feature of Maven that allow for the reuse of common build logic across multiple projects. They do this by executing an "action" (i.e. creating a WAR file or compiling unit tests) in the context of a project's description - the Project Object Model
  • 10. by Holasz Kati & Ilies Amelia (POM). Plugin behavior can be customized through a set of unique parameters which are exposed by a description of each plugin goal (or Mojo). Build Lifecycle is a series of common stages through which all project builds naturally progress. Plugin goals are bound to specific stages in the lifecycle.
  • 11. by Holasz Kati & Ilies Amelia References http://maven.apache.org http://maven.apache.org/plugins/index.html SureFire Plug-in details: http://maven.apache.org/surefire/ FailSafe Plug-in details: http://maven.apache.org/surefire/maven-failsafe-plugin/ http://en.wikipedia.org/wiki/Integration_testing http://en.wikipedia.org/wiki/Unit_testing http://en.wikipedia.org/wiki/Apache_Maven http://maven.apache.org/guides/introduction/introduction-to-plugins.html http://maven.apache.org/plugins/index.html