Permalink
Fetching contributors…
Cannot retrieve contributors at this time
143 lines (122 sloc) 4.76 KB
发布指南
源码库地址
=========
Git Read-Only: git://github.com/webx/citrus.git
HTTP Read+Write https://github.com/webx/citrus.git
SSH Read+Write git@github.com: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. 创建新的开发分支