如果大家使用Apache MyFace的JSF实现来搭建JSF应用,可以利用Apache提供的便捷maven方法来快速搭建一个初始的应用。
mvn archetype:generate -DarchetypeCatalog=http://myfaces.apache.org
……
Choose archetype:
1: http://myfaces.apache.org -> myfaces-archetype-helloworld (Simple Web application using Apache Myfaces)
2: http://myfaces.apache.org -> myfaces-archetype-helloworld-facelets (Simple Web application using Apache Myfaces and Facelets)
3: http://myfaces.apache.org -> myfaces-archetype-helloworld-portlets (Simple Web application using Apache Myfaces and Portlets)
4: http://myfaces.apache.org -> myfaces-archetype-jsfcomponents (Simple JSF Component using Apache Myfaces)
5: http://myfaces.apache.org -> myfaces-archetype-trinidad (Simple Web application using Apache Myfaces and Trinidad)
Choose a number: (1/2/3/4/5):
……可以看到它提供了你5个初始项目进行选择,你可以根据你的需要选择响应的选项。之后填写响应的参数后,你的应用程序框架就生成了。
然后再使用以下命令,来下载必要的依赖包,假设你的groupId=myAppId,artifactId=yourapp
cd yourapp
mvn package之后你就搭建了一个初始框架,你可以继续使用maven来操作这个框架。