Показ дописів із міткою Maven. Показати всі дописи
Показ дописів із міткою Maven. Показати всі дописи

неділя, 15 лютого 2015 р.

What is Maven

Maven is a framework for automation build project.
All the information about the project is in the pom.xml file.

Pom file consist from project properties and dependencies


Maven Lifecycle:

Compile -  compile the source code of the project
Test - test the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed
Package - take the compiled code and package it in its distributable format, such as a JAR.
Install - install the package into the local repository, for use as a dependency in other projects locally
Deploy - done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects
Clean - clear any compiled files you have, making sure that you're really compiling each module from scratch.



How to install Maven plugin for Eclipse

1. open Eclipse
2. go to Help/Install new software...
3. click Add...
4. type Maven in Name and http://download.eclipse.org/technology/m2e/releases in Location
5. uncheck Hide items which are already installed
6. click Next

Create the project:

1. Select the option “New” -> “Project…” from the menu “File”
2. Select the “Maven Project” type
3. If it is desired, change the default location and the working set for the new project
4. Select the desired archetype. (e.g. maven-archetytpe-quickstart)
5. Define the project parameters
Project Parameters:
Group Id : Name of the group of projects. Can be related to the company or application name. Ideally, must be unique (worldwide).
Artifact Id : Name of the component or application (project)
Version : Identifier for the version of the component. You can define different versions  for the same component.
Package Name : Name of the java package where the initial source code will be generated.

How to install Maven

1. go to http://maven.apache.org/download.cgi
2. download apache-maven-3.2.5-bin.zip
3. unzip the archive to the C:\Program Files\Apache Software Foundation
4. go to Computer/Properties/Advanced system settings/Advanced/Environment variables
5. in User variables for test add new Variable Name M2_HOME with Variable value C:\Program Files\Apache Software Foundation\apache-maven-3.2.5
6.  in User variables for test add new Variable Name M2 with Variable value %M2_HOME%\bin
7.  in User variables for test edit Path by adding %M2_HOME%\bin
8. in cmd run command mvn --version