Wednesday, February 2, 2011

Commands in the MAVEN

1. Maven is a intelligent project management, build and deployment tool provided by
Apache’s software foundation group. Maven deals with application development
lifecycle management.
2. Convention over configuration
3. Actually, for a long time there was a need to standardized project development
lifecycle management system and Maven has emerged as a perfect option that
meets the needs.
4. Project Object Model
A Project Object Model or POM is the fundamental unit of work in Maven. It is an
xml file that contains information about the
project and configuration details used by Maven to build the project. It contains
default values for most projects.
5. Repository
Another concept in Maven is that of a repository. The repository holds the artifacts
on which your project depends. There are two kinds of repository: local and remote.
6. Plugins Maven provides a plugin execution framework and all work is done by
plugins. Maven plugins are available to execute any specific task.
7. the build lifecycle
8. groupId It identifies your project as a whole (it will make more sense when you
start using multi-modules build) and should be unique. Maven enforces a naming
schema following the Java package name rules. Hence, the groupId has to start by
at least a domain name you control followed by any subgroups you want.
9. artifactId It identifies precisely the current project inside the group identified by
the groupId.
10. version: The version number allows you to distinguish your different project
releases. There are two kinds of versions depending of the release type it is
associated with:
◦ Official releases : 1.0, 2.2, ...
◦ Specific releases (nightly build or snapshots) : 1.0-SNAPSHOT,
2.1.2-SNAPSHOT
11. type: default jar
12. scope:
1. classpath management
2. Transitivity of a dependency
1. compile - this is the default scope and is transitive.
2. provided - jdk or container and is not transitive.
3. runtime - not required for compilation, but is for execution.
4. test -
5. system - The artifact is always available and is not looked up in a
repository.
13. Exclusions
1. The Standard Directory Layout
◦ For every new project, you need to learn a new way of structuring your files.
◦ You need to specify a lot of redundant configuration in order to make your
build tool work
2.
◦ src
▪ main
▪ java
▪ resources
▪ test
▪ java
▪ resources
◦ target
◦ pom.xml
3. The Build Lifecycle: Maven is based around the central concept of a build lifecycle.
What this means is that the process for building and distributing a particular artifact
is clearly defined.
4. Repositories: A repository in Maven is used to hold build artifacts and
dependencies of varying types. Repositories allow Maven to manage your project
dependencies and automatically share components between different projects.
5. local and remote.The local repository serves two purposes, it holds a cache of all
the different artifacts retrieved remotly and contains your installed projects. An
installed project is a project which has been built and that you want to be able to
use in some other local projects but you aren't ready to deploy it yet and makes it
available to other developers.
6. Remote repositories allow you to makes your project artifacts available to other
developers.
7. Maven can stores four kind of files associated to a project : the project artifact
archive, some project related content (javadoc archive, source archive), the
project pom file and key signature files so downloaded files integrity can be
verified.
8. Dependency Management: Dependency management is one of the features of
Maven that is best known to users and is one of the areas where Maven excels.
There is not much difficulty in managing dependencies for a single a project, but
when you start getting into dealing with multi-module projects and applications that
consist of tens or hundreds of modules this is where Maven can help you a great
deal in maintaining a high degree of control and stability.
9. transitive dependencies
10. mvn archetype:generate
mvn archetype: create
◦ the selection of the archetype,
◦ the configuration of that archetype,
◦ the effective creation of the project from the collected information.
11. Maven Eclipse Plugin
◦ eclipse:eclipse generates the Eclipse configuration files.(.project
and .classpath files,.setting)
◦ eclipse:clean is used to delete the files used by the Eclipse IDE.
• Maven Help Plugin
• help:active-profiles lists the profiles which are currently active for the
build.
• help:all-profiles lists the available profiles under the current project.
• help:describe describes the attributes of a Plugin and/or a Mojo (Maven
plain Old Java Object).
• help:effective-pom displays the effective POM as an XML for the current
build, with the active profiles factored in.
• help:effective-settings displays the calculated settings as an XML for the
project, given any profile enhancement and the inheritance of the global
settings into the user-level settings.
• help:system displays a list of the platform details like system properties
and environment variables.
• http://maven.apache.org/pom.html#What_is_the_POM
• versioning
• String are compared in lexicographical order, but wait, if one string starts with
and contains the other string, then the shorter string is returned as newer. So
where does this mess up? So 1.0-alpha1 > 1.0-alpha10

No comments:

Post a Comment