mvn使用笔记

mvn命令格式:

You must specify a valid lifecycle phase
or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>.
第一种格式:lifecycle phase 

Available lifecycle phases are:
default生命周期    validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy,
clean生命周期    pre-clean, clean, post-clean,
site生命周期    pre-site, site, post-site, site-deploy.

第二种格式:a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>

举例说明:

查看help插件的帮助信息mvn help:help[INFO] Maven Help Plugin 2.2
  The Maven Help plugin provides goals aimed at helping to make sense out of the
  build environment. It includes the ability to view the effective POM and
  settings files, after inheritance and active profiles have been applied, as
  well as a describe a particular plugin goal to give usage information.

This plugin has 9 goals:

help:active-profiles
  Displays a list of the profiles which are currently active for this build.

help:all-profiles
  Displays a list of available profiles under the current project.
  Note: it will list all profiles for a project. If a profile comes up with a
  status inactive then there might be a need to set profile activation
  switches/property.

help:describe
  Displays a list of the attributes for a Maven Plugin and/or goals (aka Mojo -
  Maven plain Old Java Object).

help:effective-pom
  Displays the effective POM as an XML for this build, with the active profiles
  factored in.

help:effective-settings
  Displays the calculated settings as XML for this project, given any profile
  enhancement and the inheritance of the global settings into the user-level
  settings.

help:evaluate
  Evaluates Maven expressions given by the user in an interactive mode.

help:expressions
  Displays the supported Plugin expressions used by Maven.

help:help
  Display help information on maven-help-plugin.
  Call mvn help:help -Ddetail=true -Dgoal=<goal-name> to display parameter
  details.

help:system
  Displays a list of the platform details like system properties and environment
  variables.
查看dependency的帮助信息
mvn dependency:help

[INFO] Apache Maven Dependency Plugin 2.10
Provides utility goals to work with dependencies like copying, unpacking,
analyzing, resolving and many more.

This plugin has 22 goals:

dependency:analyze
Analyzes the dependencies of this project and determines which are: used and
declared; used and undeclared; unused and declared. This goal is intended to
be used standalone, thus it always executes the test-compile phase - use the
dependency:analyze-only goal instead when participating in the build
lifecycle.
By default, maven-dependency-analyzer is used to perform the analysis, with
limitations due to the fact that it works at bytecode level, but any analyzer
can be plugged in through analyzer parameter.
。。。。。
dependency:build-classpath
This goal will output a classpath string of dependencies from the local
repository to a file or log.

dependency:copy
Goal that copies a list of artifacts from the repository to defined locations.

dependency:copy-dependencies
Goal that copies the project dependencies from the repository to a defined
location.

dependency:display-ancestors
Displays all ancestor POMs of the project. This may be useful in a continuous
integration system where you want to know all parent poms of the project.

dependency:get
Resolves a single artifact, eventually transitively, from the specified remote
repositories. Caveat: will always check thecentral repository defined in the
super pom. You could use a mirror entry in your settings.xml

dependency:go-offline
Goal that resolves all project dependencies, including plugins and reports and
their dependencies.

dependency:help
Display help information on maven-dependency-plugin.
Call mvn dependency:help -Ddetail=true -Dgoal=<goal-name> to display parameter
details.

dependency:list
Displays the list of dependencies for this project.

dependency:list-repositories
Goal that resolves all project dependencies and then lists the repositories
used by the build and by the transitive dependencies

dependency:properties
Goal that sets a property pointing to the artifact file for each project
dependency. For each dependency (direct and transitive) a project property
will be set which follows the groupId:artifactId:type:[classifier] form and
contains the path to the resolved artifact.

dependency:purge-local-repository
Remove the project dependencies from the local repository, and optionally
re-resolve them.

dependency:resolve
Goal that resolves the project dependencies from the repository.

dependency:resolve-plugins
Goal that resolves all project plugins and reports and their dependencies.

dependency:sources
Goal that resolves the project source dependencies from the repository.

dependency:tree
Displays the dependency tree for this project.
。。。
其他说明:

-Ddetail=true 显示详细的执行信息
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

-P 显示的激活一个profile
-D 显示的指定系统属性
时间: 2024-12-28 21:17:41

mvn使用笔记的相关文章

spring 笔记1: mvn 中Controller方法的参数不能是嵌套类(内部类)。

最近做spring开发,个人认为,Controller和客户端js通讯时传递的参数类 只使用某几个方法,为了减少对其他功能的影响,想把参数类定义为Controller类的 嵌套类(内部类).但是实践发现不行. 系统会报错: Servlet.service() for servlet [kingkoo] in context with path [] threw exception [Request processing failed; nested exception is org.spring

Spring Boot 学习笔记1---初体验之3分钟启动你的Web应用

前言 早在去年就简单的使用了一下Spring Boot,当时就被其便捷的功能所震惊.但是那是也没有深入的研究,随着其在业界被应用的越来越广泛,因此决定好好地深入学习一下,将自己的学习心得在此记录,本文主要围绕以下几点进行说明: Spring Boot 简介 使用Spring Boot快速搭建一个Web应用如有不对的地方,请指正. 1. Spring Boot简介 Spring Boot是一个基于Spring的衍生框架,其主要的目的是帮助我们快速构建独立.生产级别的Spring的应用,其崇尚的理念

storm学习笔记完整记录(一)

storm有两种运行模式(本地模式和集群模式) 1. 首先创建一个类似于HelloWorld的简单程序,以便进入storm的大门,包结构如下: 2.从包结构可以知道,这是一个Maven Project,pom.xml的内容如下: <project xmlns="http://maven.apache.org/POM/4.0.0"          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    

mvn deploy 报错:Return code is: 400, ReasonPhrase: Bad Request. ->

mvn deploy 报错:Return code is: 400, ReasonPhrase: Bad Request. -> TEST通过没有报错,但是最终部署到Nexus中时出现错误. 后检查发现,pom中的上传releases 和 snapshots的配置颠倒了. 要跟nexus上的配置一对一对应 来自为知笔记(Wiz) ,mamicode.com" style="color:#ffffff" target="_blank">mvn d

maven权威指南学习笔记(三)&mdash;&mdash;一个简单的maven项目

目标: 对构建生命周期 (build  lifecycle),Maven仓库 (repositories),依赖管理 (dependency management)和项目对象模型 (Project Object Model)有一个基本的理解 目前不准备深入学习maven故此使用工具ideaj 来帮助学习, 用idea创建一个默认的maven工程,结构如下: 相关命令: 打包:mvn package 编译:mvn compile 编译测试程序:mvn test-compile 清空:mvn cle

Maven学习笔记

Maven学习笔记 Maven是项目管理工具 1. 安装Maven 在apache官网(http://maven.apache.org/download.cgi) 下载apache-maven-3.3.3-bin.zip和apache-maven-3.3.3-src.zip:解压,把bin的位置设在环境变量里, 新建环境变量名:MAVEN_HOME 值:C:\Users\pengtao.yue\apache-maven-3.3.3\bin 在path中加入:%MAVEN_HOME% 在DOS中输

Maven配置笔记

android-m2e插件与maven 自定义用户配置路径 不管插件还是maven,默认的用户配置路径是统一的:${user.home}/.m2/settings.xml 但是插件可以通过eclipse设置用户配置的路径(配置方法参考<ADT+Android-m2e环境搭建>):而maven不能永久指定,只能在每次使用mvn命令时加上"-s 新路径"参数. 依赖 如果使用android-m2d,在eclipse中写好依赖配置(<dependency>),保存之后

[转载]Maven初级入门笔记

最近在研究Maven,写了一个简单的学习笔记. 本文所有资料百度云地址:http://pan.baidu.com/s/1jGn27PG 首先需要在本机上搭建一个nexus私服. 第一步,将Maven总结资料\工具目录下的nexus-2.1.2.war直接放在D:\Tomcat 7.0\webapps目录下. 第二步,启动tomcat后,在webapps目录下生成一个nexus-2.1.2目录. 第三步,停掉tomcat,修改nexus-2.1.2目录名称为nexus.再次启动tomcat,访问h

Samsung_tiny4412(笔记)--&gt;ASM with C,MMU,Exception,GIC

/**************************************************************************** * Samsung_tiny4412(笔记)-->ASM with C,MMU,Exception,GIC * * 声明: * 1. 以下所有的shell命令都是在root权限下运行的; * 2. 文中在需要往文件中写入内容的时候使用了如下2方式: * 1.如果文件不存在,创建文件;如果存在,以覆盖的方式往文件中添加内容: * cat >