- Java EE 8 Development with Eclipse
- Ram Kulkarni
- 228字
- 2021-06-18 19:00:00
Maven project structure
The Maven project wizard creates src and target folders under the main project folder. As the name suggests, all source files go under src. However, Java package structure starts under the main folder. By convention, Maven expects Java source files under the java folder. Therefore, create a java folder under src/main. The Java package structure starts from the java folder, that is, src/main/java/<java-packages>. Web content such as HTML, JS, CSS, and JSP goes in the webapp folder under src/main. Compiled classes and other output files generated by the Maven build process are stored in the target folder:

Figure 2.35: Maven web application project structure
The source code for our login JSF page is the same as in the previous example of LoginJSFApp. Therefore, copy the packt folder from the src folder of that project to the src/main/java folder of this Maven project. This adds LoginBean.java to the project. Then, copy web.xml from the WEB-INF folder to the src/main/webapp/WEB-INF folder of this project. Copy index.xhtml and welcome.xhtml to the src/main/webapp folder:

Figure 2.36: Project structure after adding source files
No change is required in the source code. To run the application, right-click on index.xhtml and select Run As | Run on Server.
We will be using Maven for project management in the rest of this book.
- 大學計算機基礎(chǔ)(第三版)
- Implementing Modern DevOps
- R語言數(shù)據(jù)分析從入門到精通
- Python量化投資指南:基礎(chǔ)、數(shù)據(jù)與實戰(zhàn)
- What's New in TensorFlow 2.0
- 前端跨界開發(fā)指南:JavaScript工具庫原理解析與實戰(zhàn)
- C和C++安全編碼(原書第2版)
- 算法訓練營:入門篇(全彩版)
- INSTANT MinGW Starter
- MATLAB定量決策五大類問題
- Mastering Apache Spark 2.x(Second Edition)
- Java項目實戰(zhàn)精編
- 高級語言程序設(shè)計(C語言版):基于計算思維能力培養(yǎng)
- PySpark Cookbook
- INSTANT Silverlight 5 Animation