Saturday, April 11, 2015

Some of Maven

It's a plugin framework.

It has three life cycles: clean, default and site
Each life cycle has multiple phases. for example, clean life cycle has pre-clean, clean and post-clean phases.

Plugins contains certain goals, goals are bound to phases. mvn clean will execute clean phase in clean life cycle, here clean is lean phase defined in clean life cycle. if a clean plugin is introduced and its clean goal is bound to clean phase, then it will be executed. mvn clean:clean invokes clean plugin's clean goal directly.

POM has super pom that is resides in maven's shipped jar. root pom is in root project folder, children pom are local poms defined in sub projects.

Maven's settings.xml is located in installation directory and user's local repository.

Maven coordination is groupid, artifactid and version. you use this to find components in maven repository. each component is treated as a project and thus has such coordination defined.

user_home/.m2/repository is default local repository, you can redefine it with /path/to/local/repo

Repository is where to find dependent plugins and components, as well as where to deploy the release candidates.

is where to find source code to prepare the release used by release plugin. release plugin does not allow uncommitted changes in working folder(I am bothered by this). it  copies the trunk to a tag location and tag/name it as the tag you give during release. it then perform a release from the tagged branch.

repository in distributionManagement is where the artifact are released to.

mvn release:prepare -DautoVersionSubmodules=true -DscmCommentPrefix=xxxx -Darguments="-DskipTests -Dmaven.test.skip" -Dresume=false -DdryRun=true

mvn release:perform actually won't do compilation and testing anymore, so it does not need to skip test.

No comments: