1) Create new WEB project (with or without server)
2) Convert it to maven project
3) Add persistance - version 2.1 or 2.2
- open project explorer, select project and open context menu
- select "New" -> "Other..."
- select "XML" -> "XML File"
- next
- set the parent folder - projectName + "/src/META-INF"
- set filename - "persistence.xml"
- finish
- replace the content of "persistence.xml" file with: persistence_jpa_2.1.xm_or persistence_jpa_2.2.xm_
4) Update the project using maven -> update project -> check the Force Update
5) Open project properties, navigate to Project Facets
ASSERT: The JPA is checked and set to the right version - 2.1 or 2.2 according to the choice in step 3