How to work with Seam 3 Examples using JBoss Tools, m2eclipse and EGit
Posted by snjeza Feb 28, 2011Seam 3.0.0.CR1 is released. The announcement for the new release is here.
In this blog I will try to show you how to easily import and use seam modules (examples, for instance) in Eclipse.
Installing JBoss Tools 3.2.0 and JBoss AS 6.0 Server
The installation of JBoss Tools 3.2.0 is described here.
Instaling JBoss Maven Git integration
The JBoss Maven Git Integration feature can be installed using the JBoss Maven Git Integration update site.
Notice:
EGit/JGit will be installed automatically.
You can also install the JSch 1.44 feature that fixes bug 326526
Forking Seam 3 examples (optional)
Seam 3 examples are placed on https://github.com/seam/examples.
If you want to contribute to Seam 3, you need to create a GitHub account and fork a module. For more details see:
If you only want to review the examples, simply skip this step and use a read-only URL https://github.com/seam/examples or git://github.com/snjeza/examples.git that fixes some issues described below, at the end of the blog.
Importing Maven Projects from Git
Start Eclipse and call File>Import>Maven>Maven Projects from Git.
What you will get is the following:
This wizard enables you to clone and/or add a Git Repository and import Maven projects from that repository.
If you fork a project, you have to install the JSch 1.44 feature and use your Git/ssh or your https URL.
Otherwise you can use: https://github.com/seam/examples.
Click Clone
On this page enter your URL, select the "ssh" (if you fork a project) or the "https" protocol and click Next.
For more details on using EGit and GitHub refer to GitHub Tutorial.
Click Next.
Click Finish and wait for EGit to clone the repository. You will get the following:
Select the repository and click Next.
This page shows those Maven projects that are recognized by the M2eclipse plugin within the imported Git repository
Select those Maven projects you want to be imported and click Finish.
You will get a completely configured Eclipse Maven Project. The Seam 3 booking example will have the Web Module Facet, JBoss CDI facet, JSF 2.0 Facet, JBoss Maven Integration facet and all the features that are offered by JBoss Tools, WTP, m2eclipse, etc., will be available to you.
You will be able to deploy the project to JBoss AS 6.0.0.
The projects are also connected to EGit so that you can use all the EGit features.
Issues
- Currently the seam-javaee-booking project requires the seam-examples-parent project version 3.0.0-CR1, but the repository includes the seam-examples-parent project version 3.0.0-SNAPSHOT
- If the user doesn't have JBoss Maven repositories in the settings.xml file, the projects won't be built correctly.
I have created the jbosstools branch on git://github.com/snjeza/examples.git that fixes these issues. Here is a patch.
- Some of the WTP facets (the JSF facet probably) unnecessarily changes WEB-INF/web.xml. You can call "git revert" for this file