maven

others

PMD plugin 代码检查插件

三大生命周期 clean default site 各自独立,各包含若干阶段。


maven

For every Apache Maven project, regardless of the packaging type,the default build lifecycle
is applied and the build is automated. As we just witnessed, the default build lifecycle consists
of phases that can be executed from the command-line terminal.
These phases are:
ff Validate: Validates that all project information is available and correct
ff Compile: Compiles the source code
ff Test: Runs unit tests within a suitable framework
ff Package: Packages the compiled code in its distribution format
ff Integration-test: Processes the package in the integration test environment
ff Verify: Runs checks to verify if the package is valid
ff Install: Installs the package in the local repository
ff Deploy: Installs the final package in a remote repository
Each of the build lifecycle phases is a Maven plugin. We will have a detailed look at Apache
Maven plugins in Chapter 9, Extending Apache Maven. When you execute them for the
first time, Apache Maven will download the plugin from the default online Maven Central
Repository that can be found at http:// repo1.maven.org/maven2 and will install
it in your local Apache Maven repository.


Maven dependencies have six possible scopes:
ff Compile: This is the default scope. Compile dependencies are available in
the classpaths.
ff Provided: This scope assumes that the JDK or the environment provides
dependencies at runtime.
ff Runtime: Dependencies that are required at runtime and are specified in the
runtime classpaths.
ff Test: Dependencies required for test compilation and execution.
ff System: Dependency is always available, but the JAR is provided nonetheless.
ff Import: Imports dependencies specified in POM included via the
<dependencyManagement/> element.

The dependency plugin provides the capability to manipulate artifacts. It can copy
and/or unpack artifacts from local or remote repositories to a specified location."

<dependencies>
<dependency>
<groupId>...</groupId>
<artifactId>...</artifactId>
<version>...</version>
<scope>...</scope>
</dependency>
</dependencies>

System dependencies are not looked for in the repository. For them, we need to specify the
path to the JAR:
<dependencies>
<dependency>
<groupId>sun.jdk</groupId>
<artifactId>tools</artifactId>
<version>1.5.0</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
</dependencies>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值