Building Opencms 9.5.x from the sources

(Difference between revisions)
Jump to: navigation, search
(Explain how to reduce the number of gwt permutations)
(Add recommendation about using the branch 9_5_x: opencms-core branch_9_0_x still does not build out of the box.)
Line 5: Line 5:
 
<em>Note: This build process has been tested using Java 7 and Gradle 1.8.</em>
 
<em>Note: This build process has been tested using Java 7 and Gradle 1.8.</em>
  
1. Checkout the sources of the 9_0_x branch<sup>1</sup>:
+
1. Checkout the sources of the 9_5_x branch<sup>1, 2</sup>:
  
<source lang="bash">git clone https://github.com/alkacon/opencms-core.git -b branch_9_0_x</source>
+
<source lang="bash">git clone https://github.com/alkacon/opencms-core.git -b branch_9_5_x</source>
  
 
2. Execute the gradle <tt>bindist</tt> task:
 
2. Execute the gradle <tt>bindist</tt> task:
Line 17: Line 17:
  
  
3. If you want to also build the opencms oamp, v8 or v7 modules, you also need to install in your local maven repository the corresponding jars<sup>2, 3</sup>:
+
3. If you want to also build the opencms oamp, v8 or v7 modules, you also need to install in your local maven repository the corresponding jars<sup>3, 4</sup>:
  
 
<source lang="bash">gradle install</source>
 
<source lang="bash">gradle install</source>
Line 23: Line 23:
 
=== Building alkacom-oamp ===
 
=== Building alkacom-oamp ===
  
1. Checkout the sources of the 9_0_x branch
+
1. Checkout the sources of the 9_5_x branch
  
<source lang="bash">git clone https://github.com/alkacon/alkacon-oamp.git -b branch_9_0_x</source>
+
<source lang="bash">git clone https://github.com/alkacon/alkacon-oamp.git -b branch_9_5_x</source>
  
2. Execute the gradle <tt>bindist</tt> task<sup>4</sup>:
+
2. Execute the gradle <tt>bindist</tt> task<sup>5</sup>:
  
 
<source lang="bash">gradle bindist</source>
 
<source lang="bash">gradle bindist</source>
Line 38: Line 38:
 
  > Could not find property 'distribution' on configuration ':compile'.
 
  > Could not find property 'distribution' on configuration ':compile'.
  
2. The current javadocs are broken and when using Java 8+, gradle fails with the following message:
+
2. In the branch <tt>build_9_0_x</tt> this issue is fixed, but there is still an ISO encoded file <tt>test/org/opencms/search/extractors/TestMsPowerPointExtraction.java</tt> that breaks the javadocs:
 +
 
 +
[...]
 +
:javadocTest
 +
/home/myuser/src/opencms-9.0.x/opencms-core/test/org/opencms/search/extractors/TestMsPowerPointExtraction.java:93: error: unmappable character for encoding UTF8
 +
        // this is "�������"
 +
                    ^
 +
/home/myuser/src/opencms-9.0.x/opencms-core/test/org/opencms/search/extractors/TestMsPowerPointExtraction.java:93: error: unmappable character for encoding UTF8
 +
        // this is "�������"
 +
                    ^
 +
[...]
 +
14 errors
 +
:javadocTest FAILED
 +
 +
FAILURE: Build failed with an exception.
 +
 +
* What went wrong:
 +
Execution failed for task ':javadocTest'.
 +
> Javadoc generation failed.
 +
 
 +
 
 +
3. The current javadocs are broken and when using Java 8+, gradle fails with the following message:
  
 
  [...]
 
  [...]
Line 53: Line 74:
 
I have written a pull-request to work around this issue: https://github.com/alkacon/opencms-core/pull/278
 
I have written a pull-request to work around this issue: https://github.com/alkacon/opencms-core/pull/278
  
3. You need to match the version of the generated opencms-core artifacts to the version of the alkacon-oamp dependencies. Since commit <tt>89e10779f43cd8bcc31f7db9d60193a89994c948</tt> (from 2014-04.02, already in 9_5_x), the property <tt>version.number</tt> in the file <tt>opencms-core/src/org/opencms/main/version.properties</tt> defines the versions of the opencms-core artifacts. The property <tt>opencms_version</tt> of the file <tt>alkacon-oamp/gradle.properties</tt> declares the version of the dependencies:
+
4. You need to match the version of the generated opencms-core artifacts to the version of the alkacon-oamp dependencies. Since commit <tt>89e10779f43cd8bcc31f7db9d60193a89994c948</tt> (from 2014-04.02, already in 9_5_x), the property <tt>version.number</tt> in the file <tt>opencms-core/src/org/opencms/main/version.properties</tt> defines the versions of the opencms-core artifacts. The property <tt>opencms_version</tt> of the file <tt>alkacon-oamp/gradle.properties</tt> declares the version of the dependencies:
  
 
{| class="wikitable"
 
{| class="wikitable"
Line 87: Line 108:
 
|}
 
|}
  
4. Currently, gradle 2.1 fails with the following message:
+
5. Currently, gradle 2.1 fails with the following message:
  
 
  > DOCTYPE is disallowed when the feature "<nowiki>http://apache.org/xml/features/disallow-doctype-decl</nowiki>" set to true.
 
  > DOCTYPE is disallowed when the feature "<nowiki>http://apache.org/xml/features/disallow-doctype-decl</nowiki>" set to true.
  
 
I have written a pull-request to fix this bug: https://github.com/alkacon/alkacon-oamp/pull/30. See also http://opencms.996256.n3.nabble.com/OpenCms-9-0-1-ready-for-download-tp23958p24010.html
 
I have written a pull-request to fix this bug: https://github.com/alkacon/alkacon-oamp/pull/30. See also http://opencms.996256.n3.nabble.com/OpenCms-9-0-1-ready-for-download-tp23958p24010.html

Revision as of 18:02, 30 September 2014

Note: this is work in progress

Building opencms-core

Note: This build process has been tested using Java 7 and Gradle 1.8.

1. Checkout the sources of the 9_5_x branch1, 2:

git clone https://github.com/alkacon/opencms-core.git -b branch_9_5_x

2. Execute the gradle bindist task:

gradle bindist
Tip for developers: Gwt generates code for all the possible permutations of the supported languages and browsers. This compilation takes a significant part of the complete build time. During development builds you could find useful to generate the corresponding gwt code only for a language and a browser restricting the value of the properties locale and user.agent to only one value in the file opencms-core/src-gwt/org/opencms/GwtBase.gwt.xml.


3. If you want to also build the opencms oamp, v8 or v7 modules, you also need to install in your local maven repository the corresponding jars3, 4:

gradle install

Building alkacom-oamp

1. Checkout the sources of the 9_5_x branch

git clone https://github.com/alkacon/alkacon-oamp.git -b branch_9_5_x

2. Execute the gradle bindist task5:

gradle bindist


Notes

1. Checking out the build tagged build_9_0_1 and executing gradle fails with the following message:

> Could not find property 'distribution' on configuration ':compile'.

2. In the branch build_9_0_x this issue is fixed, but there is still an ISO encoded file test/org/opencms/search/extractors/TestMsPowerPointExtraction.java that breaks the javadocs:

[...]
:javadocTest
/home/myuser/src/opencms-9.0.x/opencms-core/test/org/opencms/search/extractors/TestMsPowerPointExtraction.java:93: error: unmappable character for encoding UTF8
        // this is "�������"
                    ^
/home/myuser/src/opencms-9.0.x/opencms-core/test/org/opencms/search/extractors/TestMsPowerPointExtraction.java:93: error: unmappable character for encoding UTF8
       // this is "�������"
                    ^
[...]
14 errors
:javadocTest FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':javadocTest'.
> Javadoc generation failed.


3. The current javadocs are broken and when using Java 8+, gradle fails with the following message:

[...]
100 errors
100 warnings
:javadoc FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':javadoc'.
[...]

I have written a pull-request to work around this issue: https://github.com/alkacon/opencms-core/pull/278

4. You need to match the version of the generated opencms-core artifacts to the version of the alkacon-oamp dependencies. Since commit 89e10779f43cd8bcc31f7db9d60193a89994c948 (from 2014-04.02, already in 9_5_x), the property version.number in the file opencms-core/src/org/opencms/main/version.properties defines the versions of the opencms-core artifacts. The property opencms_version of the file alkacon-oamp/gradle.properties declares the version of the dependencies:

opencms-core/src/org/opencms/main/version.properties alkacon-oamp/gradle.properties
# Static version information file
#
# You should set this to something meaningful before you build.
version.number=9.5.x
version.id=Manual build
build.number=(not set)
build.date=(not set)
nicename.build.number=Build Number
nicename.build.date=Build Date
# This has no nice name on purpose (for test cases)
build.info=Static version file
build_directory=../../BuildOAMP
opencms_version=9.5.x
java_target_version=1.6
max_heap_size=1024m

# all available modules
modules_oamp_all=\
com.alkacon.opencms.commons,\
com.alkacon.opencms.calendar,\
com.alkacon.opencms.documentcenter,\
[...]

5. Currently, gradle 2.1 fails with the following message:

> DOCTYPE is disallowed when the feature "http://apache.org/xml/features/disallow-doctype-decl" set to true.

I have written a pull-request to fix this bug: https://github.com/alkacon/alkacon-oamp/pull/30. See also http://opencms.996256.n3.nabble.com/OpenCms-9-0-1-ready-for-download-tp23958p24010.html

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox