title: How to use JPA with Java EE 7, Glassfish 4.1 and Maven on JavaDB
body: <p>I've got a simple Web Java EE 7 project from Maven Archetype (NetBeans: New Project... -> Maven -> Project from Archetype -> webapp-javaee 7) and
  I'd like to use JPA in order to map classes to database-tables.
  So I created a new JavaDB database and created the corresponding Connection Pool and JDBC-Ressource in Glassfish. 
  Now i generated a very simple Entity-Class, having all the necessary annotations.
  NetBeans gives me a hint, saying that a persistence unit is not declared, so i created a persistence.xml file as follows:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"&gt;
    &lt;persistence-unit name="com.mycompany_mavenproject1_war_1.0-SNAPSHOTPU" transaction-type="JTA"&gt;
      &lt;jta-data-source&gt;jdbc/testDb&lt;/jta-data-source&gt;
      &lt;properties&gt;
        &lt;property name="javax.persistence.schema-generation.database.action" value="create"/&gt;
      &lt;/properties&gt;
    &lt;/persistence-unit&gt;
  &lt;/persistence&gt;
  </code></pre>
  
  <p>Maven automatically added following dependencies:</p>
  
  <pre><code>&lt;dependency&gt;
          &lt;groupId&gt;org.eclipse.persistence&lt;/groupId&gt;
          &lt;artifactId&gt;eclipselink&lt;/artifactId&gt;
          &lt;version&gt;2.5.2&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.eclipse.persistence&lt;/groupId&gt;
          &lt;artifactId&gt;org.eclipse.persistence.jpa.modelgen.processor&lt;/artifactId&gt;
          &lt;version&gt;2.5.2&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>Then i built the project and deployed it on Glassfish. Even though I don't get any errors it just doesn't work, meaning that no corresponding table is being created in the database. </p>
  
  <p>I'm pretty sure that the connection with the database is ok, because it does work with those Sample Projects which are delivered with NetBeans.
  So i presume that one needs some extra maven-dependency or some special property in the persistence.xml file.
  I tried just about anything i could find on the internet but nothing seems to work...</p>