ramverma | af74a62 | 2018-07-31 18:25:39 +0100 | [diff] [blame] | 1 | // |
| 2 | // ============LICENSE_START======================================================= |
| 3 | // Copyright (C) 2016-2018 Ericsson. All rights reserved. |
| 4 | // ================================================================================ |
| 5 | // This file is licensed under the CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE |
| 6 | // Full license text at https://creativecommons.org/licenses/by/4.0/legalcode |
| 7 | // |
| 8 | // SPDX-License-Identifier: CC-BY-4.0 |
| 9 | // ============LICENSE_END========================================================= |
| 10 | // |
| 11 | // @author Sven van der Meer (sven.van.der.meer@ericsson.com) |
| 12 | // |
| 13 | |
| 14 | == Build APEX Site |
| 15 | |
| 16 | The APEX Maven build comes with full support to build a web site using Maven Site. |
| 17 | Use Maven to build the APEX Site. |
| 18 | Stage the APEX web site. |
| 19 | The target folder for the staged site is |
| 20 | |
liamfallon | a41c877 | 2018-09-05 15:46:31 +0100 | [diff] [blame] | 21 | - Unix: `/usr/local/src/apex/target/ad-site` |
| 22 | - Windows: `C:\dev\apex\target\ad-site` |
| 23 | - Cygwin: `/cygdrive/c/dev/apex/target/ad-site` |
ramverma | af74a62 | 2018-07-31 18:25:39 +0100 | [diff] [blame] | 24 | |
| 25 | Once the web site is staged, copy the full site to a folder of choice or into a web server. |
| 26 | |
| 27 | |
| 28 | [IMPORTANT] |
| 29 | .Building a Site takes Time |
| 30 | ==== |
| 31 | Building and staging the APEX web site can take very long. |
| 32 | The stand-alone documentation will take about 2 minutes. |
| 33 | The sites for all modules and projects and the main APEX site can take between 10-30 minutes depending on your build machine |
| 34 | (~10 minutes without generating source and test-source reports, closer to 30 minutes with all reports). |
| 35 | ==== |
| 36 | |
| 37 | |
| 38 | Start the build deleting the staging directory that might have been created by a previous site build. |
| 39 | Then go to the APEX packaging directory. |
| 40 | |
| 41 | [width="100%",options="header",cols="5a,5a,5a"] |
| 42 | |==================== |
| 43 | | Unix | Windows | Cygwin |
| 44 | | |
| 45 | [source%nowrap,sh] |
| 46 | ---- |
| 47 | cd /usr/local/src/apex |
liamfallon | a41c877 | 2018-09-05 15:46:31 +0100 | [diff] [blame] | 48 | rm -fr target/ad-site |
ramverma | af74a62 | 2018-07-31 18:25:39 +0100 | [diff] [blame] | 49 | ---- |
| 50 | | |
| 51 | [source%nowrap,bat] |
| 52 | ---- |
| 53 | c: |
| 54 | cd \dev\apex |
liamfallon | a41c877 | 2018-09-05 15:46:31 +0100 | [diff] [blame] | 55 | rmdir /s /q target\ad-site |
ramverma | af74a62 | 2018-07-31 18:25:39 +0100 | [diff] [blame] | 56 | ---- |
| 57 | | |
| 58 | [source%nowrap,sh] |
| 59 | ---- |
| 60 | cd /cygdrive/c/dev/apex |
liamfallon | a41c877 | 2018-09-05 15:46:31 +0100 | [diff] [blame] | 61 | rm -fr target/ad-site |
ramverma | af74a62 | 2018-07-31 18:25:39 +0100 | [diff] [blame] | 62 | ---- |
| 63 | |==================== |
| 64 | |
| 65 | the workflow for building a complete site then is as follows: |
| 66 | |
| 67 | [source%nowrap,sh] |
| 68 | ---- |
| 69 | mvn clean -DapexAll #<1> |
| 70 | mvn install -DskipTests #<2> |
| 71 | mvn generate-resources -N -DapexDocs #<3> |
| 72 | mvn initialize site:attach-descriptor site site:stage -DapexSite #<4> |
| 73 | ---- |
| 74 | . First clean all modules to remove any site artifacts, use the _apexXtext_ profile to make sure these modules are processed as well |
| 75 | . Next run a simple install without tests |
| 76 | . Now generate the APEX stand -alone documentation, they are in the local package only so we can use the _-N_ switch |
| 77 | . Last build the actual sites and stage (copy to the staging directory) with the profile _apexSite_ (do not forget the initialize goal, otherwise the staging directory will not be correctly set and sites are staged in every model in a directory called `docs`). |
| 78 | |
| 79 | If you want to build the site for a particular project for testing, the Maven command is simpler. |
| 80 | Since only the main project has APEX documentation (stand-alone), you can use Maven as follow. |
| 81 | |
| 82 | [source%nowrap,sh] |
| 83 | ---- |
| 84 | mvn clean site -DapexSite |
| 85 | ---- |
| 86 | |
| 87 | If you want to stage the tested site, then use |
| 88 | |
| 89 | [source%nowrap,sh] |
| 90 | ---- |
| 91 | mvn clean initialize site:attach-descriptor site site:stage -DapexSite |
| 92 | ---- |
| 93 | |