maven
2019-06-28 10:23:16 7 举报
AI智能生成
maven使用配置
作者其他创作
大纲/内容
常用命令
mvn clean test
单元测试
mvn clean package
项目打包
mvn clean install
生成jar包
mvn compile
编译class
mvn clean
清楚编译目录,也就是target文件夹
概述
默认目录结构
source code
${basedir}/src/main/java
resources
${basedir}/src/main/resources
Tests
${basedir}/src/test
Complied byte code
${basedir}/target
distributable JAR
${basedir}/target/classes
什么是maven
安装环境配置
系统要求
jdk要求
Maven 3.3 要求 JDK 1.7 或以上
Maven 3.2 要求 JDK 1.6 或以上
Maven 3.0/3.1 要求 JDK 1.5 或以上
磁盘要求
设置Java运行环境
classPath设置
Windows
Linux
Mac
bin的path设置
Windows
Linux
Mac
maven安装
下载解压
设置 Maven 环境变量
Windows
Linux
Mac
Maven的bin的path设置
Windows
Linux
Mac
验证maven安装
setting配置
localRepository
interactiveMode
usePluginRegistry
offline
pluginGroups
pluginGroup
proxies
proxy
id
active
protocol
host
port
username
password
nonProxyHosts
servers
server
id
username
password
privateKey
passphrase
filePermissions
directoryPermissions
configuration
mirrors
mirror
id
name
url
mirrorOf
profiles
profile
id
activation
activeByDefault
jdk
os
name
family
arch
version
property
name
value
file
exists
missing
properties
user.install
repositories
repository(多个)
id
name
url
layout
releases
enabled
updatePolicy
checksumPolicy
snapshots
enabled
updatePolicy
checksumPolicy
pluginRepositories
pluginRepository(多个,同repository)
activeProfiles
pom.xml配置
基础设置
project (必须)
modelVersion 一次(必须)
groupId (必须)
artifactId (必须)
version (必须)
packaging
name
url
dependencies
dependency
groupId
artifactId
version
scope
type
systemPath
optional
parent,不写默认有maven自己定义的
groupId
artifactId
version
relativePath(默认../pom.xml)
dependencyManagement
modules
module
properties
更多项目描述信息
description
inceptionYear
licenses
license多个
name
url
distribution
comments
organization
name
url
developers
developer(多个)
id
name
email
url
organization
organizationUrl
roles
role(多个)
timezone
properties
picUrl
contributors
contributor(多个)
id
name
email
url
organization
organizationUrl
roles
role(多个)
timezone
properties
picUrl
环境设置
issueManagement
system
url
ciManagement
system
url
notifiers
notifier(多个)
type
sendOnError
sendOnFailure
sendOnSuccess
sendOnWarning
address
configuration
mailingLists
mailingList(多个)
name
archive
otherArchives
post
subscribe
unsubscribe
scm
connection
developerConnection
tag
url
prerequisites
maven
repositories
repository(多个)
id
name
url
layout
releases
enabled
updatePolicy
checksumPolicy
snapshots
enabled
updatePolicy
checksumPolicy
pluginRepositories
pluginRepository(多个,同repository)
distributionManagement
repository
snapshotRepository
site
id
name
url
downloadUrl
relocation
message
status
profiles
profile(多个)
id
activation
activeByDefault
jdk
os
name
family
arch
version
property
name
value
file
exists
missing
构建设置
build
directory
outputDirectory
finalName
testOutputDirectory
sourceDirectory
scriptSourceDirectory
testSourceDirectory
resources
resource
directory
testResources
testResource
directory
pluginManagement
plugins
plugin
groupId
artifactId
version
extensions
executions
execution
id
phase
goals
goal
inherited
configuration
dependencies
goals(已经废弃)
inherited
configuration
extensions
extension
groupId
artifactId
version
defaultGoal
directory
filters
filter
reporting
outputDirectory
Eclipse集成
1.添加maven
Window->Preferences->Maven->Installations->Add
2.maven的Setting本地仓库修改
3.修改Eclipse的setting
Window->Preferences->Maven->User settings
0 条评论
下一页