Vaadin is a Java framework for building modern web applications that look great, perform well and make you and your users happy.
For instructions about using Vaadin to develop applications, please refer to https://vaadin.com/learn
To contribute, first refer to https://vaadin.com/wiki/-/wiki/Main/Contributing+Code for general instructions and requirements for contributing code to the Vaadin framework.
Instructions on how to set up a working environment for developing the Vaadin framework follow below.
Vaadin 7 consists of three separate repositories
- https://github.com/vaadin/vaadin.git
- https://github.com/vaadin/gwt.git
- https://github.com/vaadin/gwt-tools.git
Start by cloning these repositories into the same folder:
git clone https://github.com/vaadin/vaadin.git
git clone https://github.com/vaadin/gwt.git
git clone https://github.com/vaadin/gwt-tools.git
The vaadin and gwt repositories contain project code. The gwt-tools project only contain dependency jars used by the other projects.
Do not rename the repositories as the rest of this document relies on using the standard naming.
Assuming you have cloned the repositories as described in “Cloning the project repositories” above, you can import the vaadin and gwt projects into Eclipse as follows:
Start Eclipse and use the root checkout folder (the one containing the vaadin, gwt and gwt-tools folders) as the workspace folder
You'll need the Apache Ivy plug-in for Eclipse to build the project later on, in “Compiling the Default Widget Set and Themes”.
- Go to Help -> Install New Software...
- Enter
http://www.apache.org/dist/ant/ivyde/updatesite
in the "Work with:" text field - Select and install all items
If you have installed IvyDE via the Eclipse Marketplace previously, make sure that you also have Apache Ivy Ant Tasks installed, which is not included in that IvyDE installation:
- Go to Help -> Install New Software...
- Click the hyperlink in the "What is already installed?" sentence near the bottom right-hand corner
- Verify that the list includes Apache Ivy Ant Tasks
If it isn't included, follow the installation process above, but select only Apache Ivy library > Apache Ivy Ant Tasks
- Open Window -> Preferences (Windows) or Eclipse -> Preferences (Mac)
- Go to General -> Workspace
- Set Text file encoding to UTF-8
- Set New text file line delimiter to Unix
- Go to General -> Workspace -> Linked Resources
- Add a new Path Variable GWT_ROOT referring to the gwt folder containing the gwt project
- Go to Java -> Build Path -> Classpath Variables
- Add two new variables
- GWT_TOOLS referring to the gwt-tools folder containing the dependency jars
- JDK_HOME referring to your jdk installation directory
- Go to Java -> Compiler
- Check that the compliance level has been set to 1.6
- Go to XML -> XML Files -> Editor
- Ensure the settings are follows:
Line width: 72
Format comments: true
Join lines: true
Insert whitespace before closing empty end-tags: true
Indent-using spaces: true
Indentation size: 4
- Do File -> Import -> General -> Existing Projects into Workspace
- Select the workspace folder as root directory
- Click “deselect all” and select
- gwt-dev
- gwt-user
- Click “finish” to complete the import of GWT
- Then repeat by doing File -> Import -> General -> Existing Projects into Workspace
- Select the workspace folder as root directory
- Click “deselect all” and select
- vaadin
- Click “finish” to complete the import of Vaadin Framework
You should now have three projects in your workspace. If the vaadin project does not compile without errors, choose Ivy -> Resolve from the vaadin project popup menu. Now all projects should compile without errors (there might be warnings).
Note that the first compilation takes a while to finish as Ivy downloads dependencies used in the projects.
Compile the default widget set by executing the default target in build/ide.xml in the vaadin project. In Eclipse this is done by opening build/ide.xml, right clicking on it and choosing Run As -> Ant Build.
The vaadin project includes an embedded Jetty which is used for running the UI tests. It is a standard Java application: com.vaadin.launcher.DevelopmentServerLauncher. Launch it in debug mode in Eclipse by right clicking on it and selecting Debug As -> Java Application.
This launches a Jetty on port 8888 which allows you to run any UI class in the project by opening http://localhost:8888/run/<UI class name>?restartApplication in your browser, e.g. http://localhost:8888/run/com.vaadin.tests.components.label.LabelModes?restartApplication (Add ?restartApplication to ensure).
The JUnit tests for the projects can be run using
ant test
Running this in the gwt directory will run the GWT JUnit tests. Running it in the vaadin directory will run the Vaadin JUnit tests.
Note that the included Vaadin TestBench (browser) tests currently requires access to a TestBench cluster, which is currently only available internally at Vaadin Ltd.
The distribution files can be built in a few steps. First build the gwt project by running
ant
in the gwt directory. The elemental package needs to be built separately:
ant elemental
Building the elemental package is not possible on Windows as it requires gcc.
Move to the vaadin project directory and unpack the previously built gwt jars
ant -f gwt-files.xml unpack.gwt
Then build the vaadin project by running
ant
in the vaadin directory.