Before going through this documentation, you might want to check my development environment configuration to setup your system.
- Page Editor Dev Server (until we have something more stable).
- Testing Fragments.
- Some antivirus software.
Setup
- Install OracleJDK 8.
- Install Apache ANT.
- Install Apache Maven.
- Ensure
/usr/lib/jvm/default-java
points to Java home. - Ensure
/usr/lib/jvm/default-ant
points to ANT home. - Ensure
/usr/lib/jvm/default-maven
points to Maven home. mkdir -p ~/Projects/community-portal
ln -s $CHACHI_PATH/liferay ~/Projects/community-portal/config
cd ~/Projects/community-portal && ln -s config/liferay-editorconfig .editorconfig
git clone git@github.com:p2kmgcl/liferay-portal.git ~/Projects/community-portal/liferay-portal
ln -s ~/Projects/chachi-shell/liferay/git-config ~/Projects/community-portal/liferay-portal/.git/config
git clone https://github.com/liferay/liferay-binaries-cache-2020.git ~/Projects/community-portal/liferay-binaries-cache-2020
buildLiferayPortal
cd ~/Projects/community-portal/bundles && ln -s ../config/portal-ext.properties portal-ext.properties
git clone https://github.com/holatuwol/liferay-intellij ~/Projects/community-portal/liferay-intellij
cd ~/Projects/community-portal/liferay-portal && ../liferay-intellij/intellij
Github Token for source format
Since 2023-04-13, SF is looks for vulnerabilities in build.gradle files. In order to make this work, we need to generate a GitHub Legacy/Classic token with the read:repo_hook
permission and place it in $HOME/github.token
.
Build portal drama
If portal doesn't compile some steps must you follow, check this options each by each, and if it doesn't work go back to sleep.
- Update master and try again.
git clean -fd
.git clean -fdX
.- Reinstall Java, MySQL, Ant, Maven and Node.
- Try to use the latest docker nightly.
- Use this day to check bugs and PTRs.
- Tell someone to stream their computer and pair-program the whole day.
- Try on a brand-new pc.
Random notes
- Liferay Loader full dependency graph:
Control Panel -> Configuration -> System Settings -> Infrastructure -> Javascript Loader -> Explain Module Resolutions
- Format source all changes in branch:
cd ~/Projects/community-portal/liferay-portal/portal-impl && ant format-source-current-branch
- Create language files:
gradlew buildLang
- Format code:
gradlew formatSource
- Run FrontEnd tests:
gradlew packageRunTest
- Toggle jQuery:
Product menu -> Configuration -> System settings -> Third party -> jQuery
- IE11 polyfills:
IETopHeadDynamicInclude.java
- Run poshi tests locally (docs):
ant -f build-test.xml run-selenium-test -Dbrowser.chrome.bin.file=/path/to/chrome/binary -Dtest.class=FileName#TestName
- Specific chromium releases can be downloaded from cypress.io.
- If tests doesn't run, try emptying
bundles/logs
directory, but keeping the directory itself.
- CSS RTL Conversion is made here:
frontend-css-rtl-servlet
andCSSRTLConverter.java
- Fragment bundler rendering process:
FragmentEntryLinkModelListener.java
- Upgrade database:
cd ~/Projects/community-portal/bundles/tools/portal-tools-db-upgrade-client && ./db_upgrade.sh
- Connect to telnet:
telnet localhost 11311
- Liferay<=7.0 supports MySQL<=5.7 using driver
com.mysql.jdbc.Driver
(newer versions will fail). - Run Java tests with Ant:
ant test-method -Dtest.class=JSONUtilTest -Dtest.methods=testCacafutiNiceParty -Djunit-debug=true
- Running integration tests:
gradlew testIntegration --tests com.liferay.cacafuti.test.CacafutiTest