Jpa erro para criar tabela

Não consigo criar tabela editora

persistence.xml

<?xml version="1.0" encoding="UTF-8"?>
<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 ">
	<persistence-unit name="" />

	<persistence-unit name="livraria -pu"
		transaction-type="RESOURCE_LOCAL">
		<provider>org.hibernate.ejb.HibernatePersistence</provider>
		<properties>
			<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect" />
			<property name="hibernate.hbm2ddl.auto" value="create" />
			<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" />
			<property name="javax.persistence.jdbc.user" value="root" />
			<property name="javax.persistence.jdbc.password" value="1234" />
			<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/livraria" />
		</properties>
	</persistence-unit>
</persistence>

Editora.class

package br.com.k19.jpa;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

@Entity
public class Editora {

	@Id
	@GeneratedValue
	private Long id;

	private String nome;

	private String email;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getNome() {
		return nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}
}

Teste.class

package br.com.k19.jpa;

import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

public class Teste {

	public static void main(String[] args) {

		EntityManagerFactory factory = 
				Persistence.createEntityManagerFactory("livraria -pu");
		factory.close();
	}
}

Erro no console

abr 05, 2016 2:37:15 PM org.hibernate.annotations.common.Version <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {4.0.2.Final}
abr 05, 2016 2:37:15 PM org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {4.2.8.Final}
abr 05, 2016 2:37:15 PM org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
abr 05, 2016 2:37:15 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
Exception in thread "main" javax.persistence.PersistenceException: Invalid persistence.xml.
Error parsing XML (line-1 : column -1): cvc-elt.1: Não pode localizar a declaração do elemento 'persistence'.

	at org.hibernate.ejb.packaging.PersistenceXmlLoader.loadURL(PersistenceXmlLoader.java:147)
	at org.hibernate.ejb.packaging.PersistenceXmlLoader.deploy(PersistenceXmlLoader.java:171)
	at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:326)
	at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:58)
	at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:63)
	at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47)
	at br.com.k19.jpa.Teste.main(Teste.java:11)

Talvez não seja a causa do erro, mas pq você tem um persistence unit vazio no seu arquivo de configuração?

<persistence-unit name="" />

eu criei ele devo ter parado de programar quando voltei fui continuar e nem percebi D=

persistence-unit name=“livraria -pu”

Tira esse espaco do nome também

igor olhos de lince. Vi o xml várias vezes e não percebi isso kkkkk

Ja tirei o espaço, mas mesmo assim o erro persiste.

O erro era da versão, agora estou utilizando a 2.0 porem está dando outro erro.
Erro no console

abr 05, 2016 5:21:48 PM org.hibernate.annotations.common.Version <clinit>
INFO: HCANN000001: Hibernate Commons Annotations {4.0.2.Final}
abr 05, 2016 5:21:48 PM org.hibernate.Version logVersion
INFO: HHH000412: Hibernate Core {4.2.8.Final}
abr 05, 2016 5:21:48 PM org.hibernate.cfg.Environment <clinit>
INFO: HHH000206: hibernate.properties not found
abr 05, 2016 5:21:48 PM org.hibernate.cfg.Environment buildBytecodeProvider
INFO: HHH000021: Bytecode provider name : javassist
abr 05, 2016 5:21:48 PM org.hibernate.ejb.Ejb3Configuration configure
INFO: HHH000318: Could not find any META-INF/persistence.xml file in the classpath
Exception in thread "main" javax.persistence.PersistenceException: No Persistence provider for EntityManager named livraria-pu
	at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:69)
	at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47)
	at br.com.k19.jpa.Teste.main(Teste.java:10)

persistence.xml

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
	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://xmlns.jcp.org/xml/ns/persistence/persistence_2_0.xsd ">
	<persistence-unit name="livraria-pu"
		transaction-type="RESOURCE_LOCAL">
		<provider>org.hibernate.ejb.HibernatePersistence</provider>
		<properties>
			<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect" />
			<property name="hibernate.hbm2ddl.auto" value="create" />
			<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" />
			<property name="javax.persistence.jdbc.user" value="root" />
			<property name="javax.persistence.jdbc.password" value="1234" />
			<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/livraria" />
		</properties>
	</persistence-unit>
</persistence>

Em qual pasta você está colocando o persistence.xml no seu projeto?

`para gerar as tabelas via main vc deve adicionar a depêndencia do hibernate-envers
e deve também inicializar o EntityManager

EntityManager em = factory.CreateEntityManager ( );
em.clear( );
`

no seu main esta assim

    EntityManagerFactory factory = Persistence.createEntityManagerFactory("livraria -pu"); // tem espaço aqui
factory.close();

src/META-INF

Sei que é meio antigo esse post, fiz um tutorial sobre JPA, ele é simples, por favor, veja se ajuda.
Seguem os links:
http://www.tidicas.com.br/?p=1864
http://www.tidicas.com.br/?p=130