将Maven 2 生成的Tapestry 5 项目导入到MyEclipse 7.5 之后,来看看里面的文件组织结构(layout of the project):
-----myapp(我的项目名称)
|--src/main/java,includes Java source files
|--src/main/resources ,includes Non-code resources
|--src/main/webapp (including src/main/webapp/WEB-INF),includes Web application files
|--src/test/java,includes Java test sources
|--src/test/resources ,includes Non-code resources
|--target ,includes the results of compilation
以上是以 -DarchetypeArtifactId=quickstart 作为 mvn 命令的参数生成的项目 layout 。
下面使用小巧玲珑的 Jetty 作为 Container ,运行刚导入的项目。步骤如下:
1.右击项目,Run As --> Run Configurations ...
2.在对话框的左侧右击 Maven Build -->New
3.在右侧 Name 输入框中输入运行配置的名称,最好用项目名称;点击 Base directory 输入框下的 Browse Workspace 按钮,选中要运行的项目;在 Goals 输入框右侧点击 Select按钮,选中 jetty6,点击 Apply,再点击 Run,Console 中就开始显示相关信息,等出现 [INFO] Started Jetty Server 这个信息时,在浏览器的输入框中输入 http://localhost:8080/myapp,就可以看到首页。