Source code for the code examples in the Book of Vaadin and some more.
Requirements:
- Eclipse IDE for Java EE Developers
- Java 8 JDK installed in Eclipse
- Apache TomEE 1.7 or newer
- Vaadin Plugin for Eclipse
- Cloning
You have two options:
a) To clone the repository read-only from Github:
$ git clone https://github.com/vaadin/book-examples
b) To clone the repository from the read-write code review repository:
$ git clone ssh://<username>@dev.vaadin.com:29418/book-examples.git
Where <username> is your username in the review system.
See the contribution instructions for information about registering: https://vaadin.com/wiki/-/wiki/Main/Contributing+Code. Also note the required repository configuration for submitting code for review.
- Importing
You should create the server before importing, as the project files may refer to it as a compilation target. Not sure if it is relevant
-
Create TomEE server in Eclipse
-
In the Servers view, right-click → New → Server
-
In the "New Server" wizard: - Select Apache → Tomcat 7.0 Server - Set Server name: "Apache TomEE 1.7 at localhost" - Click Next
-
In the Tomcat Servet step: - Name: "Apache TomEE 1.7 at localhost" - Installation Directory: "/opt/apache-tomee-webprofile-1.7.1" - JRE: Workbench default or Java 8 JRE - Click Finish
-
Import project
-
File → Import → Existing projects intro workspace
-
In the import wizard: - Select the cloned project directory - Click Finish
-
Building
-
Some Vaadin add-ons may require a snapshot version, which must be built and installed to the local Maven repository.
For example, for Vaadin Charts:
$ git clone https://github.com/vaadin/charts
$ cd charts
$ mvn install -DskipTests
- Refresh Ivy
- Right-click on project, select Ivy → Refresh
-
Install license keys for commercial Vaadin add-ons (Charts, etc.)
-
Compile the widget set
-
Select Java Resources → src/com.vaadin.book.widgetset/BookExamplesWidgetSet.gwt.xml
-
Click Compile Widgetset in the toolbar (requires Vaadin Plugin for Eclipse)
You can also compile the themes here, or let them be compiled on-the-fly.
- Deployment
Just add the project to the previously created TomEE server.
You should then be able to run the application with:
http://localhost:8080/book-examples-vaadin7/book
- Development
Things you should notice:
- The examples are formatted by hand, so you must not have any automatic code formatting enabled in your Eclipse default settings.
- Contributions
Contributions must go through the Gerrit code review system.
- You must install the
commit-msg
hook as instructed - You must push to review as instructed