-
Notifications
You must be signed in to change notification settings - Fork 592
Building Open Liberty
- Overview Open Liberty Development
If you wish to build Open Liberty with Eclipse then follow these instructions: Building Open Liberty with Eclipse
-
If you don't already have it, install git (> 2.0)
Instructions
-
Download and install Git. Execute the file you downloaded, and accept the defaults.
-
(Windows) Configure Git to use long filepaths
-
Run
Git Bash
as Administrator -
git config --system core.longpaths true
-
-
Windows users performance tip: Always start any git client including the git bash shell with "Run as Administrator"
-
If this is your first time using git, now is a good time to set your name and e-mail address. Your name and e-mail address will be stored in every commit you make. If you don't want to reveal your e-mail address publically, then you can use the noreply e-mail address generated for your github account.
git config --global user.name "John Doe"
git config --global user.email [email protected]
-
If you don't want to use "vi" editor when writing up the description for your commits, point git to your favorite text editor:
git config --global core.editor 'c:/utility/emacs-24.3/bin/emacs.exe'
-
-
(Optionally) set up SSH Keys
If you plan to contribute code to Open Liberty, you should make sure you have SSH keys set up and linked to your Github account now.
Instructions
-
For an existing key do the following:
- Check for Existing SSH keys.
- Add your existing SSH key to your GitHub account via these instructions.
-
For a new SSH key do the following:
- Complete the steps under Generate a new SSH key to generate your key.
- Complete the steps under Adding your SSH key to the ssh-agent to add your key.
NOTE: All git commands which touch the network (fetch, push, pull) use SSH authentication. Ensure that you've started your SSH agent:
eval "$(ssh-agent -s)"
-
-
If you don't already have it, install a Java 17 SDK
-
Java 17 is the recommended version to build Open Liberty. Popular choices are:
-
After installing, make sure
javac
is available on your pathjavac --version
-
-
If you don't already have it, install Apache Ant
-
This is not needed to build Open Liberty but it is needed to run FAT tests.
-
Download from the Apache Ant website and extract. The older 1.8.4 version is recommended.
-
After installing, make sure
ant
is available on your pathant -version
-
Clone the repository to your system.
With SSH Keys:
git clone [email protected]:OpenLiberty/open-liberty.git
Without SSH Keys:
git clone https://github.com/OpenLiberty/open-liberty.git
This will download the whole repository (currently around 900 MB)
cd open-liberty/dev
./gradlew cnf:initialize
./gradlew assemble
Initially, this process is expected to take between 20 to 40 minutes. Note that ./gradlew cnf:initialize
is a one-time action, required only after you first clone the repository.
You should now have a built server in dev/build.image/wlp
If you plan to make modifications to the Open Liberty code, you can now move on to set up Eclipse IDE following these instructions: Building Open Liberty with Eclipse
Now that you've built Open Liberty, you should be able to run tests against it.
./gradlew test
to run all unit tests
./gradlew build.example_fat:buildandrun
to run a FAT project
NOTE: ./gradlew build
runs assemble
and test
tasks
./gradlew releaseNeeded
NOTE: This task releases all projects to the local releaseRepo. The final openliberty zip can be found in
open-liberty\dev\cnf\release\dev\openliberty\<version>\openliberty-xxx.zip
- Overview Open Liberty Development