1--- 2layout: default 3title: Release Build 4parent: Release & Milestone Tasks 5grand_parent: Contributors 6nav_order: 100 7--- 8 9<!-- 10© 2021 and later: Unicode, Inc. and others. 11License & terms of use: http://www.unicode.org/copyright.html 12--> 13 14# Release Build 15{: .no_toc } 16 17## Contents 18{: .no_toc .text-delta } 19 201. TOC 21{:toc} 22 23--- 24 25## Building ICU4J Release Files 26 27<span style="color:red">*Note: This instruction is reviewed for ICU4J 69.1. Some 28description may not apply to previous ICU releases. ICU4J library (as of ICU 69) 29supports JRE 7 or later Java runtime environment. To avoid the Java's system 30library class's backward compatibility problem, ICU4J binary files must be 31compiled with Java system libraries from JRE 7.*</span> 32 33## Prerequisites 34 35* Java SE Development Kit 8 (to run ant, javac, javadoc..) 36* Java Runtime Environment 7 (used as bootclasspath for cross-compilation) 37* Apache Ant 1.10.x (the latest available version) 38 \[<http://ant.apache.org/>\] 39* JCite 1.13.0 \[<https://arrenbrecht.ch/jcite/>\] 40 41### Other Prerequisites only for GA 42 43* Maven Ant Tasks 2.1.3 (GA only) \[<http://maven.apache.org/ant-tasks>\] 44 (Note: This is component is no longer maintained, and ICU project should 45 update the process in near future) 46* gpg (GNU Privacy Guard) 47 * ICU Project PGP key (icuintl@us.ibm.com - [published to MIT key 48 server](https://pgp.mit.edu/pks/lookup?op=vindex&search=0x44CE7BF2825EA2CD)) 49* Sonatype Nexus Repository Manager account for managing artifacts 50 com.ibm.icu.\* on OSSRH (Reference: [OSSRH 51 Guide](http://central.sonatype.org/pages/ossrh-guide.html)) 52 53 <span style="color:red">*Note: Contact Yoshito for the PGP key and Sonatype 54 account.*</span> 55 56### Configuration 57 58* Set environment variable `JAVA_HOME` to point to the JDK directory. 59* Set environment variable `JCITE_DIR` to specify JCite binary location (see[ 60 Building ICU4J API Reference Document with 61 JCite](../../../setup/java/ant/index.md)) 62* See `build.properties` to check version strings are properly set. 63 * `api.report.version` / `api.report.prev.version` are used for locating 64 API signature files and should be integer numbers. 65 * `release.file.ver` is used as a part of build output file name. 66 * `api.doc.version` is used for the API document title 67 * `mavne.pom.ver` is used in pom.xml when release files are uploaded to 68 OSSRH 69 70 For ICU 69.1 GA, the contents of the properties file should be: 71 ``` 72 api.report.version = 69 73 api.report.prev.version = 68 74 release.file.ver = 69_1 75 api.doc.version = 69.1 76 maven.pom.ver = 69.1 77 ``` 78 79* Create `build-local.properties` in the ICU4J root directory 80 81* Edit `build-local.properties` to add a property - `java7.bootclasspath 82 (java6.bootclasspath for ICU57 to ICU62)` 83 84 The value of javaX.bootclasspath should include JRE's system library path. A 85 set of jar files included in the system library path may vary depending on 86 JRE vendor (Oracle, OpenJDK and IBM use different set of jars) and version. 87 The easiest way to get the system library path is to run a simple Java 88 program on the target JRE. 89 90 System.out.println(System.getProperty("sun.boot.class.path")); 91 92 For example, the values on my Linux system (Ubuntu) look like below: 93 94 java7.bootclasspath=/home/yoshito/jdk/oracle/jdk1.7.0_80/jre/lib/resources.jar:/home/yoshito/jdk/oracle/jdk1.7.0_80/jre/lib/rt.jar:/home/yoshito/jdk/oracle/jdk1.7.0_80/jre/lib/sunrsasign.jar:/home/yoshito/jdk/oracle/jdk1.7.0_80/jre/lib/jsse.jar:/home/yoshito/jdk/oracle/jdk1.7.0_80/jre/lib/jce.jar:/home/yoshito/jdk/oracle/jdk1.7.0_80/jre/lib/charsets.jar:/home/yoshito/jdk/oracle/jdk1.7.0_80/jre/lib/jfr.jar:/home/yoshito/jdk/oracle/jdk1.7.0_80/jre/classes 95 96 One Windows system, path separator back slash '\\' should be replaced with 97 forward slash '/'. For example: 98 99 java7.bootclasspath=C:/jdk/oracle/7u80/jre/lib/resources.jar;C:/jdk/oracle/7u80/jre/lib/rt.jar;C:/jdk/oracle/7u80/jre/lib/sunrsasign.jar;C:/jdk/oracle/7u80/jre/lib/jsse.jar;C:/jdk/oracle/7u80/jre/lib/jce.jar;C:/jdk/oracle/7u80/jre/lib/charsets.jar;C:/jdk/oracle/7u80/jre/lib/jfr.jar;C:/jdk/oracle/7u80/jre/classes 100 101### Additional Configuration for GA 102 103* Add 2 more properties to `build-local.properties` 104 * `maven-ant-tasks.jar` - Specify the path to the Maven Ant Tasks jar 105 file. 106 * `gpg.user` - Specify the ICU Project PGP key user name 107 108 For example, build-local.properties look like below: 109 110 ``` 111 java7.bootclasspath=/home/yoshito/jdk/oracle/jdk1.7.0_80/jre/lib/resources.jar:/home/yoshito/jdk/oracle/jdk1.7.0_80/jre/lib/rt.jar:/home/yoshito/jdk/oracle/jdk1.7.0_80/jre/lib/sunrsasign.jar:/home/yoshito/jdk/oracle/jdk1.7.0_80/jre/lib/jsse.jar:/home/yoshito/jdk/oracle/jdk1.7.0_80/jre/lib/jce.jar:/home/yoshito/jdk/oracle/jdk1.7.0_80/jre/lib/charsets.jar:/home/yoshito/jdk/oracle/jdk1.7.0_80/jre/lib/jfr.jar:/home/yoshito/jdk/oracle/jdk1.7.0_80/jre/classes 112 maven-ant-tasks.jar = /home/yoshito/java-libs/maven-ant-tasks/maven-ant-tasks-2.1.3.jar 113 gpg.user = ICU Project 114 ``` 115 116 <span style="color:red">*Note: Maven Ant Tasks is no longer maintained. ICU team should find out another method to publish ICU artifacts to the repository (ticket [ICU-12811](https://unicode-org.atlassian.net/browse/ICU-12811)).*</span> 117 118* Create maven local setting file `$HOME/.m2/settings.xml` if absent. Then add 119 the Sonatype Nexus Repository Manager account information in the file. For 120 example: 121 ```xml 122 <settings> 123 <servers> 124 <server> 125 <id>icu4j-releases</id> 126 <username>yumaoka</username> 127 <password>OSSRH-SonaType-Password</password> 128 </server> 129 <server> 130 <id>icu4j-snapshots</id> 131 <username>yumaoka</username> 132 <password>OSSRH-SonaType-Password</password> 133 </server> 134 </servers> 135 </settings> 136 ``` 137 138### Building Release Files for Milestones/Release Candidates 139 1401. Checkout tagged version - Use clean checkout of Git (SVN up to ICU62) tag 141 (e.g. release-61-0-1, release-61-rc..) for building release files. 1422. Run `$ ant releaseVer` - This build target generates ICU release files with 143 version number in a folder `release` under the ICU4J root directory. 144 145 This ant target prints out warning messages as below if the build system is 146 not properly configured. 147 ``` 148 _verify_config_for_release: 149 [echo] ################################################################ 150 [echo] [WARNING] Insufficient Build Configuration for ICU4J Release 151 [echo] JDK Tools Version: 1.8.0_152 152 [echo] JRE 7 System Library Path: Not Defined! 153 [echo] JCite Library Path: /home/yoshito/java-libs/jcite-1.13.0/build/jcite.jar:/home/yoshito/java-libs/jcite-1.13.0/lib/commons-discovery-0.4.jar:/home/yoshito/java-libs/jcite-1.13.0/lib/commons-logging-1.1.jar:/home/yoshito/java-libs/jcite-1.13.0/lib/java2html.jar` 154 [echo] ################################################################ 155 156 BUILD SUCCESSFUL 157 Total time: 5 minutes 31 seconds 158 ``` 159 If you see such warnings at the end of build log, fix the issue and run the 160 target again. 1613. Upload all files generated under the `release` directory to the ICU site. 162 163## Building Release Files for Final Release (GA) 164 165A final (official) release files will be posted to the Maven Central Repository 166as well as the ICU project site. The build target `releaseFinal` generates all 167necessary files for the Maven repository and upload them after regular release 168build target is executed. 1691. Checkout tagged version - Use clean checkout of Git (SVN up to ICU62) tag 170 (e.g. release-61-1, release-61-2) for building release files. 1712. Run `$ ant releaseVer` once to make sure there are no build configuration 172 issues. Run `$ ant clean` to clean up build. 1733. \[Optional\] In the next step, the build target invokes gpg to generate 174 signature of build output files. gpg will request you to type in the 175 passphrase for the ICU Project (icuintl@us.ibm.com) PGP key once. gpg 176 pinentry is used for this purpose, but it may not work well on some systems 177 when pgp was invoked from ant (such as Mac OS X). If this is the case, you 178 would want to run gpg-agent to cache passphrase. More specifically, once you 179 set up gpg-agent, run `$ gpg -ab -u "ICU Project" foo.txt` to sign arbitrary 180 file. This operation will prompt you to type in the ICU Project key's 181 passphrase and cache it. So it does not need to ask you to type passphrase 182 again while running the ant release target. 1834. Run `$ ant releaseFinal` . This target generates release files for ICU site, 184 as well as files for Maven Central Repository, then upload the files to OSSRH 185 staging repository. You should see build log as below at the end. 186 ``` 187 [deploy] Transferring 37K from icu4j-releases 188 [deploy] Uploaded 37K 189 [deploy] Uploading: com/ibm/icu/icu4j-localespi/61.1/icu4j-localespi-61.1-sources.jar.asc to repository icu4j-releases at https://oss.sonatype.org/service/local/staging/deploy/maven2 190 [deploy] Transferring 0K from icu4j-releases 191 [deploy] Uploaded 0K 192 [deploy] Uploading: com/ibm/icu/icu4j-localespi/61.1/icu4j-localespi-61.1-javadoc.jar to repository icu4j-releases at https://oss.sonatype.org/service/local/staging/deploy/maven2 193 [deploy] Transferring 22K from icu4j-releases 194 [deploy] Uploaded 22K 195 [deploy] Uploading: com/ibm/icu/icu4j-localespi/61.1/icu4j-localespi-61.1-javadoc.jar.asc to repository icu4j-releases at https://oss.sonatype.org/service/local/staging/deploy/maven2 196 [deploy] Transferring 0K from icu4j-releases 197 [deploy] Uploaded 0K 198 199 BUILD SUCCESSFUL 200 Total time: 6 minutes 19 seconds 201 ``` 202 After the successful target execution, copy files generated under `release` 203 directory and upload them to ICU site. 2045. Log on to [OSSRH Nexus Repository Manager](https://oss.sonatype.org/). Select 205 "Staging Repositories" under "Build Promotion" on the left navigation pane, 206 then type "com.ibm.icu" on the search field on the upper right corner. You 207 should find a repository entry corresponding to the one just uploaded. Select 208 the entry, and sanity check content. Once you confirm the contents, click 209 "Close" on the menu. If the repository is closed successfully, you can 210 "Release" after that. The release operation will promote the staging 211 repository to production. It usually takes 20 to 30 minutes. 212 213 214