I create a project JPA/ EJBusing gradleand receiving this warning:
$ gradle jar
:compileJava
Note: Creating static metadata factory ...
Note: The persistence xml file [META-INF/persistence.xml] was not found. NO GENERATION will occur!! Please ensure a persistence xml file is available either from the CLASS_OUTPUT directory [META-INF/persistence.xml] or using the eclipselink.persistencexml property to specify its location.
2 warnings
:processResources UP-TO-DATE
:classes
:jar
My project structure:
ProjectX
|-src
|
|
|
|
|
|
|
The interesting part is that persistence.xml hits the target artifact:
$ jar -tf target/projectx.jar
META-INF/
META-INF/MANIFEST.MF
domain/
domain/Employee.class
ejb/
ejb/EmployeeEJB.class
META-INF/persistence.xml
Why is there a complaint [META-INF/persistence.xml], even if there is one?
Gradle file:
apply plugin: 'java'
project.buildDir = 'target'
sourceSets.all {
output.resourcesDir = output.classesDir
}
jar{
destinationDir=project.buildDir
}
repositories {
mavenCentral()
}
dependencies {
compile 'org.glassfish:javax.ejb:3.0.1','org.eclipse.persistence:javax.persistence:2.0.0'
}
I quickly checked with maven now and there is no such warning.
user3343079
source
share