Pessoal, estou com um problema..
Após configurar um projeto de teste com o Maven, Hibernate e o SQLServer, ao subir o serviço no servidor o projeto não cria as tabela e nem faz nenhuma menção ao Hibernate no Log.
O persistense está na pasta META-INF normalmente e os jars do Hibernate foram aplicados, conseguem me ajudar?
Persistence.xml
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="livraria" transaction-type="RESOURCE_LOCAL">
<description> ARQUIVO DE PERSISTÊNCIA JPA E HIBERNATE</description>
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<class>br.com.caelum.livraria.model.Autor</class>
<class>br.com.caelum.livraria.model.Livro</class>
<properties>
<property name="javax.persistence.jdbc.driver" value="com.microsoft.sqlserver.jdbc.SQLServerDriver" />
<property name="javax.persistence.jdbc.url" value="jdbc:sqlserver://localhost:1433/HIBERNATE_ESTUDO" />
<property name="javax.persistence.jdbc.user" value="sa" />
<property name="javax.persistence.jdbc.password" value="senha" />
<property name="hibernate.dialect" value="org.hibernate.dialect.SQLServerDialect" />
<property name="hibernate.hbm2ddl.auto" value="update" />
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.hbm2ddl.auto" value="update" />
</properties>
</persistence-unit>
</persistence>
Livro
package br.com.caelum.livraria.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
public class Livro {
@Id @GeneratedValue(strategy=GenerationType.IDENTITY)
private Integer id;
private String titulo;
private String isbn;
private double preco;
private String dataLancamento;
public Livro() {
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getTitulo() {
return titulo;
}
public void setTitulo(String titulo) {
this.titulo = titulo;
}
public String getIsbn() {
return isbn;
}
public void setIsbn(String isbn) {
this.isbn = isbn;
}
public double getPreco() {
return preco;
}
public void setPreco(double preco) {
this.preco = preco;
}
public String getDataLancamento() {
return dataLancamento;
}
public void setDataLancamento(String dataLancamento) {
this.dataLancamento = dataLancamento;
}
}
pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>br.com.teste.maven</groupId>
<artifactId>livrariaJsf</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>livrariaJsf Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<!-- PrimeFaces -->
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>5.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.glassfish/javax.faces -->
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.faces</artifactId>
<version>2.2.14</version>
</dependency>
<!-- Métodos uteis para manipulação de String, métodos e etc -->
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.4</version>
</dependency>
<!-- PROVIDER JPA(HIBERNATE) -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.3.0.Final</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/sqljdbc4 -->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>sqljdbc4</artifactId>
<version>4.0</version>
</dependency>
</dependencies>
<build>
<finalName>livrariaJsf</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
</plugins>
</build>
</project>