文档章节

Java Web开发入门 - 第4章 Maven核心概念

抢小孩糖吃
 抢小孩糖吃
发布于 2016/08/25 22:22
字数 3780
阅读 77
收藏 2

#POM继承与多模块构建 ##约定(管理)优先于配置

  • 标准的目录结构
    • *.java放到src/main/java
    • *.classtarget/classes目录下
    • 对于web项目,配置及静态文件src/webapp
    • resources目录存放在src/resources
    • ...
  • 项目描述符,pom.xml ##POM
  • xml文件,pom.xml
    一个pom.xml定义了一个项目,告诉项目类型、构建所需要的配置
  • project <-> artifact
    构建概念,我们假定认为一个构建就是一个项目
  • 项目类型<packaging></packaging>
    • pom、jar、war
  • 坐标
    • 由groupId、artifactId、version三个属性唯一确定其坐标
  • 属性,${property}
    • 通过在properties中定义属性,可以在其他地方通过${property}直接进行引用
  <properties>
  	<spring.version>4.3.2.RELEASE</spring.version>
  	<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  	<jdk.version>1.7</jdk.version>
  	<spring.amqp.version>1.6.1.RELEASE</spring.amqp.version>
  	<spring-security.version>4.1.3.RELEASE</spring-security.version>
  </properties>
  • 依赖dependencies
<dependencies>
<dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <version>3.1.0</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>
  • 构建配置build
  <build>
    <finalName>Restaurant</finalName>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
          <encoding>UTF-8</encoding>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.tomcat.maven</groupId>
        <artifactId>tomcat7-maven-plugin</artifactId>
        <version>2.2</version>
        <configuration>
          <uriEncoding>UTF-8</uriEncoding>
          <finalName>Restaurant</finalName>
          <server>tomcat</server>
        </configuration>
      </plugin>
    </plugins>
  </build>
  • 多项目、继承parent
  <!-- 添加总管理依赖 -->
  <parent>
    <groupId>com.netease.restaurant</groupId>
    <artifactId>restarant-parent</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <relativePath>../pom.xml</relativePath>
  </parent>
  • 项目总体信息

##问题 大项目分为多个子项目进行管理,会造成如下问题:

  • 多个项目配置重复
  • 修改繁琐
  • 依赖版本不一致
  • 配置管理混乱

以上问题如何解决?
##继承 pom叫做项目对象模型,可以借助面向对象的思想,把公共的配置,放到父配置子项目进行继承

  • 继承或者覆盖,Override
  • 可继承项
    • 坐标属性,如groupId
    • 依赖配置
    • 插件配置
    • 一般性信息,如开发者信息

继承的根在哪里?Java中的Object类 ##Super POM

  • 所有的Maven项目的POM都继承Super POM
  • 是Maven的组成部分
  • 超级POM定义了一组被所有项目共享的默认设置
    • 默认的文件位置(约定的位置)
    • 统一的插件配置
    • 默认的中央仓库配置
    • ...
      输入图片说明
      显示继承Super POM的pom内容命令:
      由于内容过长自行查看
mvn help:effective-pom
  • 继承配置
    • 使用parent元素进行配置

##多模块构建

  • parent项目,类型pom
    • 定义多个modules
  • 子模块中配置parent,进行继承
    输入图片说明
  • 统一配置提到parent项目中
  • 既使用继承又使用组合

#依赖管理、仓库及构建生命周期 ##依赖配置

  • 依赖坐标 groupId、artifactId、version
  • scope配置
    • compile、provided
    • compile:如果不进行配置则compile为默认值,在编译使用,在打包时打进包内
    • provided:需要进行配置,在编译使用,在打包时不打进包内
  • 用于继承的pom配置
    • dependencyManagement
      输入图片说明
  <dependencies>
     ...
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <version>3.1.0</version>
      <scope>provided</scope>
    </dependency>
     ...
  </dependencies>

##仓库

  • 用于统一存储所有Maven项目,共享的构建空间
    • 通过坐标去仓库中查询
  • 仓库分类
    • 本地仓库
      Maven本地仓库默认路径为${user.home}/.m2/repository
      输入图片说明
    • 远程仓库 ##远程仓库
  • 本地仓库优先查找
  • 提供Maven项目访问并下载构建至本地仓库
  • /<groupId>/<artifactId>/<version>/<artifactId>-<version>.<packagin>
  • 分类
    • 中央仓库The Central Repository
      国内速度慢
    • 其他公共仓库(镜像仓库)
    • 私服 - 常见的artifactory
  • 配置(远程仓库)
    • 全局:使用配置文件settings.xml
    • 某项目:在pom.xml为依赖制定repositories

##构建生命周期

  • 一个构建生命周期是一组精心组织的有序的阶段
  • 每一个阶段执行预先定义的动作
    • 编译
    • 构建
    • 运行
    • ...
  • 这些动作会根据项目类型进行选择

###三套独立的生命周期 输入图片说明
一些命令

  • mvn clean
  • mvn clean install - 先执行clean在执行install
  • mvn site - 生成文档
  • mvn package - 打包

##默认生命周期 mvn default 如果想知道mvn default的所有生命周期过程,则需要查询文档 Introduction to the Build Lifecycle
输入图片说明

  • validate 验证-验证项目是正确的,所有必要的信息是可用的
  • process-resources 复制-将资源文件复制到目录下,为了打包使用
  • compile 编译-编译项目的源代码
  • test 测试-使用合适的单元测试框架测试编译后的源代码。这些测试不应该要求被打包或部署的代码
  • package 打包-包以编译的代码在其分配的格式封装,如JAR。
  • verify 验证-对集成测试的结果进行检查,以确保质量标准得到满足
  • install 安装-将软件包安装到本地存储库中,作为本地其他项目的依赖项
  • deploy 部署-在生成环境中进行部署,将最终包复制到远程存储库,用于与其他开发人员和项目共享

##插件和目标

  • 插件(Plugin)式架构
  • 所有的插件本身也是一个Maven构建,由Maven仓库管理
  • 每一个插件提供多个目标(Goal)
  • 调用目标的格式
    • mvn <Plugin>:<Goal>,举例mvn tomcat7:run
      输入图片说明

##插件目标绑定构建生命周期

  • 生命周期阶段与目标绑定 当你调用mvn 命令时,实际上调用的是mvn对应的目标
  • 用户通过制定生命周期阶段就能够隐式的通过插件执行任务
    Maven默认生命周期与目标

当我们调用mvn compile时,实际上调用的是mvn comppiler:compile目标

  • 对于package阶段,会根据项目类型不同,绑定到不同的目标 ##插件配置
  • 插件配置元素
  • configuration配置 - 不同插件的配置项查询,查询模板如下
mvn help:describe -Dplugin=<plugin_name> -Dgoal=<goal> -Ddetail
  • 对于继承的父pom
    • pluginManagement

查询实例:

mvn help:describe -Dplugin=tomcat7 -Dgoal=run -Ddetail

插件的例子:

<build>
    <finalName>Restaurant</finalName>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
          <encoding>UTF-8</encoding>
        </configuration>
      </plugin>

备注:mvn help插件查看详细内容

#插件及总结演示 ##mvn compile 插件compiler的目标compile的配置项:

mvn help:describe -Dplugin=compiler -Dgoal=compile -Ddetail=true

##Plugins

  • mvn内建插件
  • help
    • mvn help:help -Ddetail=true
  • tomcat7
  • exec - 我们简单跑jar包
  • 更多插件内容
  • 自定义插件

##pom.xml描述内容 输入图片说明

##使用Maven的大致过程 我们使用pom.xml,来描述项目构建。 远端有依赖仓库。 首先要根据pom.xml解析项目对象模型,去依赖仓库查找对应依赖。项目依赖管理从项目对象模型pom.xml配置。构建生命周期,不同的构建阶段。不同的构建阶段,实际上是由对应的构建插件所完成的。一个构建阶段可以绑定到一个或者多个目标。一个目标,可以认为是构建逻辑。
输入图片说明
##mvn的全局配置settings mvn的配置文件是${M2_HOME}/conf/settings.xml

#总结

  • 默认标准的目录结构
  • pom继承、Super POM、多项目管理
  • 依赖及依赖配置
  • 仓库的概念
  • 构建生命周期
  • 插件及目标

#附录 ##教学项目的目录树结构

.
├── Kitchen
│   ├── Kitchen.iml
│   ├── pom.xml
│   ├── src
│   │   ├── main
│   │   │   ├── java
│   │   │   │   └── com
│   │   │   │       └── netease
│   │   │   │           ├── App.java
│   │   │   │           └── Kitchen.java
│   │   │   └── resources
│   │   └── test
│   │       └── java
│   │           └── com
│   │               └── netease
│   │                   └── AppTest.java
│   └── target
│       ├── classes
│       │   └── com
│       │       └── netease
│       │           ├── App.class
│       │           └── Kitchen.class
│       ├── generated-sources
│       │   └── annotations
│       ├── generated-test-sources
│       │   └── test-annotations
│       ├── Kitchen-1.0.0-SNAPSHOT.jar
│       ├── maven-archiver
│       │   └── pom.properties
│       ├── surefire
│       ├── surefire-reports
│       │   ├── com.netease.AppTest.txt
│       │   └── TEST-com.netease.AppTest.xml
│       └── test-classes
│           └── com
│               └── netease
│                   └── AppTest.class
├── pom.xml
├── pom.xml~
├── restarant-parent.iml
└── Restaurant
    ├── pom.xml
    ├── Restaurant.iml
    ├── src
    │   ├── main
    │   │   ├── java
    │   │   │   └── com
    │   │   │       └── netease
    │   │   │           ├── HelloServlet.java
    │   │   │           └── NoodlesServlet.java
    │   │   ├── resources
    │   │   └── webapp
    │   │       ├── index.jsp
    │   │       ├── SoybeanMilk.html
    │   │       └── WEB-INF
    │   │           ├── web.xml
    │   │           └── web.xml~
    │   └── test
    │       └── java
    └── target
        ├── apache-tomcat-maven-plugin
        ├── classes
        │   └── com
        │       └── netease
        │           ├── HelloServlet.class
        │           └── NoodlesServlet.class
        ├── generated-sources
        │   └── annotations
        ├── maven-archiver
        │   └── pom.properties
        ├── maven-status
        │   └── maven-compiler-plugin
        │       └── compile
        │           └── default-compile
        │               ├── createdFiles.lst
        │               └── inputFiles.lst
        ├── Restaurant
        │   ├── index.jsp
        │   ├── META-INF
        │   │   └── MANIFEST.MF
        │   ├── SoybeanMilk.html
        │   └── WEB-INF
        │       ├── classes
        │       │   └── com
        │       │       └── netease
        │       │           ├── HelloServlet.class
        │       │           └── NoodlesServlet.class
        │       ├── lib
        │       │   ├── javax.servlet-api-3.1.0.jar
        │       │   └── Kitchen-1.0.0-SNAPSHOT.jar
        │       └── web.xml
        ├── Restaurant.war
        ├── surefire
        ├── test-classes
        └── tomcat
            ├── conf
            │   ├── logging.properties
            │   ├── tomcat-users.xml
            │   └── web.xml
            ├── logs
            │   ├── access_log.2016-08-24
            │   └── access_log.2016-08-25
            ├── webapps
            └── work
                └── Tomcat
                    └── localhost
                        └── Restaurant
                            └── org
                                └── apache
                                    └── jsp
                                        ├── index_jsp.class
                                        └── index_jsp.java

##pom.xml示例

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.netease.restaurant</groupId>
  <artifactId>Restaurant</artifactId>
  <packaging>war</packaging>
  <version>1.0.0-SNAPSHOT</version>
  <name>Restaurant Maven Webapp</name>
  <url>http://maven.apache.org</url>

  <!-- 添加总管理依赖 -->
  <parent>
    <groupId>com.netease.restaurant</groupId>
    <artifactId>restarant-parent</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <relativePath>../pom.xml</relativePath>
  </parent>

  <dependencies>
    <!-- 依赖Kitchen -->
    <dependency>
      <groupId>com.netease.restaurant</groupId>
      <artifactId>Kitchen</artifactId>
      <version>1.0.0-SNAPSHOT</version>
    </dependency>

    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <version>3.1.0</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>
  <build>
    <finalName>Restaurant</finalName>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
          <encoding>UTF-8</encoding>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.tomcat.maven</groupId>
        <artifactId>tomcat7-maven-plugin</artifactId>
        <version>2.2</version>
        <configuration>
          <uriEncoding>UTF-8</uriEncoding>
          <finalName>Restaurant</finalName>
          <server>tomcat</server>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

##mvn compiler:compile的配置项查询

zhanpeng@GE70:~$  mvn help:describe -Dplugin=compiler -Dgoal=compile -Ddetail=true
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-help-plugin:2.2:describe (default-cli) @ standalone-pom ---
[INFO] Mojo: 'compiler:compile'
compiler:compile
  Description: Compiles application sources
  Implementation: org.apache.maven.plugin.compiler.CompilerMojo
  Language: java
  Bound to phase: compile

  Available parameters:

    annotationProcessorPaths
      Classpath elements to supply as annotation processor path. If specified,
      the compiler will detect annotation processors only in those classpath
      elements. If omitted, the default classpath is used to detect annotation
      processors. The detection itself depends on the configuration of
      annotationProcessors.
      
      Each classpath element is specified using their Maven coordinates
      (groupId, artifactId, version, classifier, type). Transitive dependencies
      are added automatically. Example:
      
      <configuration>
        <annotationProcessorPaths>
          <path>
            <groupId>org.sample</groupId>
            <artifactId>sample-annotation-processor</artifactId>
            <version>1.2.3</version>
          </path>
          <!-- ... more ... -->
        </annotationProcessorPaths>
      </configuration>

    annotationProcessors
      Names of annotation processors to run. Only applies to JDK 1.6+ If not
      set, the default annotation processors discovery process applies.

    compilerArgs
      Sets the arguments to be passed to the compiler if fork is set to true.
      Example:
      
      <compilerArgs>
        <arg>-Xmaxerrs=1000</arg>
        <arg>-Xlint</arg>
        <arg>-J-Duser.language=en_us</arg>
      </compilerArgs>

    compilerArgument
      Sets the unformatted single argument string to be passed to the compiler
      if fork is set to true. To pass multiple arguments such as -Xmaxerrs 1000
      (which are actually two arguments) you have to use compilerArguments.
      
      This is because the list of valid arguments passed to a Java compiler
      varies based on the compiler version.

    compilerArguments
      Sets the arguments to be passed to the compiler (prepending a dash) if
      fork is set to true.
      
      This is because the list of valid arguments passed to a Java compiler
      varies based on the compiler version.
      
      To pass -Xmaxerrs 1000 -Xlint -Xlint:-path -Averbose=true you should
      include the following:
      
      <compilerArguments>
        <Xmaxerrs>1000</Xmaxerrs>
        <Xlint/>
        <Xlint:-path/>
        <Averbose>true</Averbose>
      </compilerArguments>
      Deprecated. use {@link #compilerArgs} instead.

    compilerId (Default: javac)
      User property: maven.compiler.compilerId
      The compiler id of the compiler to use. See this guide for more
      information.

    compilerReuseStrategy (Default: ${reuseCreated})
      User property: maven.compiler.compilerReuseStrategy
      Strategy to re use javacc class created:
      - reuseCreated (default): will reuse already created but in case of
        multi-threaded builds, each thread will have its own instance
      - reuseSame: the same Javacc class will be used for each compilation even
        for multi-threaded build
      - alwaysNew: a new Javacc class will be created for each compilation
      Note this parameter value depends on the os/jdk you are using, but the
      default value should work on most of env.

    compilerVersion
      User property: maven.compiler.compilerVersion
      Version of the compiler to use, ex. '1.3', '1.5', if fork is set to true.

    debug (Default: true)
      User property: maven.compiler.debug
      Set to true to include debugging information in the compiled class files.

    debuglevel
      User property: maven.compiler.debuglevel
      Keyword list to be appended to the -g command-line switch. Legal values
      are none or a comma-separated list of the following keywords: lines,
      vars, and source. If debug level is not specified, by default, nothing
      will be appended to -g. If debug is not turned on, this attribute will be
      ignored.

    encoding (Default: ${project.build.sourceEncoding})
      User property: encoding
      The -encoding argument for the Java compiler.

    excludes
      A list of exclusion filters for the compiler.

    executable
      User property: maven.compiler.executable
      Sets the executable of the compiler to use when fork is true.

    failOnError (Default: true)
      User property: maven.compiler.failOnError
      Indicates whether the build will continue even if there are compilation
      errors.

    fileExtensions
      file extensions to check timestamp for incremental build default contains
      only .class

    forceJavacCompilerUse (Default: false)
      User property: maven.compiler.forceJavacCompilerUse
      compiler can now use javax.tools if available in your current jdk, you
      can disable this feature using
      -Dmaven.compiler.forceJavacCompilerUse=true or in the plugin
      configuration

    fork (Default: false)
      User property: maven.compiler.fork
      Allows running the compiler in a separate process. If false it uses the
      built in compiler, while if true it will use an executable.

    generatedSourcesDirectory (Default:
    ${project.build.directory}/generated-sources/annotations)
      Specify where to place generated source files created by annotation
      processing. Only applies to JDK 1.6+

    includes
      A list of inclusion filters for the compiler.

    maxmem
      User property: maven.compiler.maxmem
      Sets the maximum size, in megabytes, of the memory allocation pool, ex.
      '128', '128m' if fork is set to true.

    meminitial
      User property: maven.compiler.meminitial
      Initial size, in megabytes, of the memory allocation pool, ex. '64',
      '64m' if fork is set to true.

    optimize (Default: false)
      User property: maven.compiler.optimize
      Set to true to optimize the compiled code using the compiler's
      optimization methods.

    outputFileName
      Sets the name of the output file when compiling a set of sources to a
      single file.
      expression='${project.build.finalName}'

    proc
      Sets whether annotation processing is performed or not. Only applies to
      JDK 1.6+ If not set, both compilation and annotation processing are
      performed at the same time.
      
      Allowed values are:
      
      - none - no annotation processing is performed.
      - only - only annotation processing is done, no compilation.

    showDeprecation (Default: false)
      User property: maven.compiler.showDeprecation
      Sets whether to show source locations where deprecated APIs are used.

    showWarnings (Default: false)
      User property: maven.compiler.showWarnings
      Set to true to show compilation warnings.

    skipMain
      User property: maven.main.skip
      Set this to 'true' to bypass compilation of main sources. Its use is NOT
      RECOMMENDED, but quite convenient on occasion.

    skipMultiThreadWarning (Default: false)
      User property: maven.compiler.skipMultiThreadWarning
      (no description available)

    source (Default: 1.5)
      User property: maven.compiler.source
      The -source argument for the Java compiler.

    staleMillis (Default: 0)
      User property: lastModGranularityMs
      Sets the granularity in milliseconds of the last modification date for
      testing whether a source needs recompilation.

    target (Default: 1.5)
      User property: maven.compiler.target
      The -target argument for the Java compiler.

    useIncrementalCompilation (Default: true)
      User property: maven.compiler.useIncrementalCompilation
      to enable/disable incrementation compilation feature

    verbose (Default: false)
      User property: maven.compiler.verbose
      Set to true to show messages about what the compiler is doing.


[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.768s
[INFO] Finished at: Fri Aug 26 22:25:55 CST 2016
[INFO] Final Memory: 9M/180M
[INFO] ------------------------------------------------------------------------

##mvn help:help -Ddetail=true

zhanpeng@GE70:~$ mvn help:help -Ddetail=true
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-help-plugin:2.2:help (default-cli) @ standalone-pom ---
[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.

  Available parameters:

    output
      Optional parameter to write the output of this help in a given file,
      instead of writing to the console.
      Note: Could be a relative path.

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.

  Available parameters:

    output
      Optional parameter to write the output of this help in a given file,
      instead of writing to the console.
      Note: Could be a relative path.

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

  Available parameters:

    artifactId
      The Maven Plugin artifactId to describe.
      Note: Should be used with groupId parameter.

    cmd
      A Maven command like a single goal or a single phase following the Maven
      command line:
      mvn [options] [<goal(s)>] [<phase(s)>]

    detail
      This flag specifies that a detailed (verbose) list of goal (Mojo)
      information should be given.

    goal
      The goal name of a Mojo to describe within the specified Maven Plugin. If
      this parameter is specified, only the corresponding goal (Mojo) will be
      described, rather than the whole Plugin.

    groupId
      The Maven Plugin groupId to describe.
      Note: Should be used with artifactId parameter.

    medium
      This flag specifies that a medium list of goal (Mojo) information should
      be given.

    minimal
      This flag specifies that a minimal list of goal (Mojo) information should
      be given.

    output
      Optional parameter to write the output of this help in a given file,
      instead of writing to the console.
      Note: Could be a relative path.

    plugin
      The Maven Plugin to describe. This must be specified in one of three ways:
      
      1.  plugin-prefix, i.e. 'help'
      2.  groupId:artifactId, i.e. 'org.apache.maven.plugins:maven-help-plugin'
      3.  groupId:artifactId:version, i.e.
        'org.apache.maven.plugins:maven-help-plugin:2.0'

    version
      The Maven Plugin version to describe.
      Note: Should be used with groupId/artifactId parameters.

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

  Available parameters:

    output
      Optional parameter to write the output of this help in a given file,
      instead of writing to the console.
      Note: Could be a relative path.

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.

  Available parameters:

    output
      Optional parameter to write the output of this help in a given file,
      instead of writing to the console.
      Note: Could be a relative path.

    showPasswords
      For security reasons, all passwords are hidden by default. Set this to
      true to show all passwords.

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

  Available parameters:

    artifact
      An artifact for evaluating Maven expressions.
      Note: Should respect the Maven format, i.e.
      groupId:artifactId[:version][:classifier].

    expression
      An expression to evaluate instead of prompting. Note that this must not
      include the surrounding ${...}.

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

  Available parameters:

    output
      Optional parameter to write the output of this help in a given file,
      instead of writing to the console.
      Note: Could be a relative path.

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

  Available parameters:

    detail
      If true, display all settable properties for each goal.

    goal
      The name of the goal for which to show help. If unspecified, all goals
      will be displayed.

    indentSize
      The number of spaces per indentation level, should be positive.

    lineLength
      The maximum length of a display line, should be positive.

help:system
  Displays a list of the platform details like system properties and environment
  variables.

  Available parameters:

    output
      Optional parameter to write the output of this help in a given file,
      instead of writing to the console.
      Note: Could be a relative path.


[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.853s
[INFO] Finished at: Fri Aug 26 22:33:07 CST 2016
[INFO] Final Memory: 8M/180M
[INFO] ------------------------------------------------------------------------

© 著作权归作者所有

抢小孩糖吃

抢小孩糖吃

粉丝 74
博文 258
码字总数 247185
作品 0
东城
程序员
私信 提问
Java程序员必读书单,家族又添新成员

点击关注异步图书,置顶公众号 每天与你分享IT好书 技术干货 职场知识 参与文末话题讨论,每日赠送异步图书。 ——异步小编 有些革命出其不意地吸引了全世界的眼球。Twitter、Linux操作系统和...

异步社区
2018/05/09
0
0
java 7 入门书籍

一、Java从入门到精通 《Java从入门到精通(第3版)》从初学者角度出发,通过通俗易懂的语言、丰富多彩的实例,详细介绍了使用Java语言进行程序开发需要掌握的知识。 《Java从入门到精通(第3版...

modernizr
2014/05/15
7.6K
9
【Java学习路线】新手该如何一步步的学习 Java

新手该如何一步步的学习 Java? 如果真的想学Java,最好要循序渐进,有章有法的学习它! 今天小慕就不说一些学习方法和技巧了,直接来谈每个阶段要学习的内容。 首先,给大家分享一张以 企业...

Eddie_yang
2018/11/15
2.4K
0
阿里大牛力荐6篇实战文档:JVM+多线程+Kafka+Redis+Nginx+MySQL

深入理解Java虚拟机:JVM高级特性与最佳实践 第一部分 走近Java 第1章 走近Java 第二部分 自动内存管理机制 第2章 Java内存区域与内存溢出异常 第3章 垃圾收集器与内存分配策略 第4章 虚拟机...

Java微服务
07/16
0
0
JAVA区块链项目实战视频课程

课程介绍 全国首套,基于java的区块链实战教程。目的是让更多的java编程者了解区块链,掌握区块链开发。 1、区块链理论:以node.js例子区块链原理有深刻理解; 2、区块链java实战:深刻理解区...

小红牛
2018/09/14
0
0

没有更多内容

加载失败,请刷新页面

加载更多

关于运维,该怎么决定它的方向,这个似工作又似兴趣的存在

我之前主要从事网络、桌面、机房管理等相关工作,这些工作使我迷惘,这应该是大多数运维人都经历过的过程; 18年国庆,我从国内前三的消费金融公司裸辞,下海创业,就是想要摆脱这样的困境。...

网络小虾米
10分钟前
2
0
Java Timer的用法

Timer timer = new Timer(); timer.schedule(new TimerTask() { public void run() { System.out.println("11232"); } }, 200000 , 1000); public void schedule(TimerTask task, long delay......

林词
14分钟前
3
0
使用js动态加载外部js文件以及动态创建script脚本

动态脚本指的是在页面加载时不存在,但将来的某一时刻通过修改该DOM动态添加的脚本。和操作HTML元素一样,创建动态脚本也有两种方式:插入外部文件和直接插入JavaScript代码。 动态加载外的外...

Bing309
21分钟前
2
0
从零开始入门 K8s | Kubernetes 网络概念及策略控制

作者 | 阿里巴巴高级技术专家 叶磊 一、Kubernetes 基本网络模型 本文来介绍一下 Kubernetes 对网络模型的一些想法。大家知道 Kubernetes 对于网络具体实现方案,没有什么限制,也没有给出特...

阿里巴巴云原生
25分钟前
2
0
天气获取

本文转载于:专业的前端网站➨天气获取 $.get("http://wthrcdn.etouch.cn/WeatherApi", { citykey: cityCode }, function (d) { //创建文档对象 var parser = new ......

前端老手
25分钟前
2
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部