Comments (6)
Please put your persistence.xml
.
BTW, provider will use defined in persistence.xml
.
from jpa-schema-gradle-plugin.
not responding, closing issue.
from jpa-schema-gradle-plugin.
Sorry, got busy with other issues.
This is my 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="default">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<class>com.app.web.model.jpa.NewsItemPK</class>
<class>com.app.web.model.jpa.NewsItem</class>
<class>com.app.web.model.jpa.BinaryContentNewsItem</class>
<class>com.app.web.model.jpa.TextContentNewsItem</class>
<class>com.app.web.model.jpa.Category</class>
<class>com.app.web.model.jpa.eclipselink.DateTimeJPA21Converter</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<property name="eclipselink.weaving" value="static"/>
<property name="eclipselink.logging.logger" value="com.app.web.model.jpa.eclipselink.SLF4JLogger"/>
<property name="eclipselink.logging.level" value="finest"/>
</properties>
</persistence-unit>
</persistence>
The config in gradle is:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "io.github.divinespear:jpa-schema-gradle-plugin:0.1.12"
}
}
apply plugin: "jpa-schema-generate"
generateSchema {
databaseProductName = "MySQL"
scriptAction = "drop-and-create"
format = true
persistenceXml = file("src/main/resources/META-INF/persistence.xml")
}
When I run generateSchema I get this result, quoting Hibernate and saying that a Persistence Provider can't be found:
sts] -----------------------------------------------------
[sts] Starting Gradle build for the following tasks:
[sts] clean
[sts] generateSchema
[sts] -----------------------------------------------------
:news-nx-scrollers2-common:clean
:news-nx-scrollers2-common:compileJava
:news-nx-scrollers2-common:processResources
:news-nx-scrollers2-common:classes
:news-nx-scrollers2-common:weave
:news-nx-scrollers2-common:generateSchema
HHH015016: Encountered a deprecated javax.persistence.spi.PersistenceProvider [org.hibernate.ejb.HibernatePersistence]; use [org.hibernate.jpa.HibernatePersistenceProvider] instead.
HHH015016: Encountered a deprecated javax.persistence.spi.PersistenceProvider [org.hibernate.ejb.HibernatePersistence]; use [org.hibernate.jpa.HibernatePersistenceProvider] instead.
HHH015016: Encountered a deprecated javax.persistence.spi.PersistenceProvider [org.hibernate.ejb.HibernatePersistence]; use [org.hibernate.jpa.HibernatePersistenceProvider] instead.
:news-nx-scrollers2-common:generateSchema FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':news-nx-scrollers2-common:generateSchema'.
> No Persistence provider to generate schema named default
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 1.397 secs
[sts] Build failed
org.gradle.tooling.BuildException: Could not execute build using Gradle installation '/opt/gradle-2.2.1'.
...
...
Caused by: javax.persistence.PersistenceException: No Persistence provider to generate schema named default
at io.github.divinespear.JpaSchemaGenerateTask$_generate_closure9.doCall(JpaSchemaGenerateTask.groovy:301)
at io.github.divinespear.JpaSchemaGenerateTask.generate(JpaSchemaGenerateTask.groovy:284)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:63)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.doExecute(AnnotationProcessingTaskFactory.java:218)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:211)
at org.gradle.api.internal.project.taskfactory.AnnotationProcessingTaskFactory$StandardTaskAction.execute(AnnotationProcessingTaskFactory.java:200)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:579)
at org.gradle.api.internal.AbstractTask$TaskActionWrapper.execute(AbstractTask.java:562)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:80)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:61)
... 55 more
Note that my project does not declare Hibernate as a depedency.
from jpa-schema-gradle-plugin.
You can ignore persistenceXml option if your persistence xml path is META-INF/persistence.xml
remove it and retry please.
from jpa-schema-gradle-plugin.
... any luck?
from jpa-schema-gradle-plugin.
Yes, now it works.
I have a suggestion though: please add a log line thatn states the
persistence engine the plugin selected in the end. This way it is always
clear which Persistence Provider is generating your DDL.
Thanks!
2015-02-24 19:59 GMT-05:00 divinespear [email protected]:
... any luck?
—
Reply to this email directly or view it on GitHub
#15 (comment)
.
from jpa-schema-gradle-plugin.
Related Issues (20)
- Support for Hibernate 5.2.10.Final HOT 1
- "Key ... is missing in the map" in version 0.3.0 HOT 2
- skip option is missed. HOT 1
- Spring Boot 2.0.0.RELEASE + Hibernate 5.2.12.Final - NoSuchFieldError: parallelCapableClassLoaderAvailable (0.3.1) HOT 4
- StackOverflow on EclipseLink 2.7 + Kotlin HOT 1
- java.io.NotSerializableException after migration from 0.2.1-1 to 0.3.5.1 HOT 2
- How can I use it in build.gradle.kts HOT 3
- Generate schema task throws kotlin.KotlinNullPointerException HOT 5
- Schema cannot be generated starting from Hibernate 5.4.7.Final HOT 3
- NPE while running generateSchema HOT 3
- Gradle keeps file handles on loaded jars
- kotlin dsl support HOT 1
- eclipselink 2.5 without persistence.xml
- change sql formatter
- migrate 0.3.x to 4.0 with 6.0 source HOT 1
- apply jacoco to functional test
- automate gradle plugin release HOT 2
- Could not find method generateSchema() HOT 7
- Successful generation but getting exception: The application must supply JDBC connections HOT 1
- Support Spring Boot 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jpa-schema-gradle-plugin.