-
Notifications
You must be signed in to change notification settings - Fork 360
/
DEPLOY.txt
142 lines (122 loc) · 4.76 KB
/
DEPLOY.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
发布指南
源码库地址
=========
Git Read-Only: git://github.com/webx/citrus.git
HTTP Read+Write https://github.com/webx/citrus.git
SSH Read+Write [email protected]:webx/citrus.git
Maven的配置($HOME/.m2/settings.xml)
====================================
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>sonatype-nexus-snapshots</id>
<username>your-jira-id</username>
<password>your-jira-pwd</password>
</server>
<server>
<id>sonatype-nexus-staging</id>
<username>your-jira-id</username>
<password>your-jira-pwd</password>
</server>
</servers>
<profiles>
<profile>
<id>sonatype</id>
<repositories>
<repository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Snapshots</name>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
<releases>
<enabled>false</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</releases>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</repository>
<repository>
<id>sonatype-nexus-staging</id>
<name>Sonatype Staging</name>
<snapshots>
<enabled>false</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</releases>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Snapshots</name>
<snapshots>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
<releases>
<enabled>false</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</releases>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</pluginRepository>
<pluginRepository>
<id>sonatype-nexus-staging</id>
<name>Sonatype Staging</name>
<snapshots>
<enabled>false</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</snapshots>
<releases>
<enabled>true</enabled>
<updatePolicy>always</updatePolicy>
<checksumPolicy>fail</checksumPolicy>
</releases>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
</settings>
Maven库管理 - Staging
=====================
为了将项目的成果发布到central maven repository中,需要先将项目deploy到staging repository中
进行测试,然后再将它promote到central maven repository中。此步骤请参考文档:
Sonatype OSS Maven Repository Usage Guide
https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide
Sonatype OSS Staging 库管理: https://oss.sonatype.org/
编译测试
========
cd citrus
mvn clean install // 编译和测试全部代码,在servlet 3.1环境下(默认)
mvn clean install -Dservlet30 // 编译和测试全部代码,在servlet 3.0环境下
mvn clean install -Dservlet2 // 编译和测试全部代码,在servlet 2.5环境下
发布步骤
========
1. 确保所有源代码提交
2. checkout要发布的分支,例如:git checkout dev-3.0.8
3. 分别项目:
cd citrus
mvn clean deploy -Pdeployment
确保使用deployment profile,以便生成sonatype所需要的数字签名。
并非所有子项目都会被发布,只有那些 maven-deploy-plugin.skip=false 的项目才会被发布。
4. 如果还需要发布其余的分支,切换到该分支,并重作2-3
5. 在应用中测试staging库,用sonatype profile,例如在应用的目录下执行:mvn jetty:run -Psonatype
6. 在sonatype管理界面中promote项目到central maven repository
7. 对发布版本创建tags
8. 删除已发布的分支
9. 创建新的开发分支