Note that there are some explanatory texts on larger screens.

plurals
  1. POGenerate the JPA 2.0 metamodel via maven without persistence.xml?
    text
    copied!<p>Is there any way to generate the JPA 2.0 metamodel via maven without having a persistence.xml file. I'm using eclipselink.</p> <p>In my Java EE-projects I'm doing something like the following wich works fine because in that case I have a persistence.xml.</p> <pre><code>&lt;plugin&gt; &lt;groupId&gt;org.bsc.maven&lt;/groupId&gt; &lt;artifactId&gt;maven-processor-plugin&lt;/artifactId&gt; &lt;version&gt;2.0.5&lt;/version&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;process&lt;/id&gt; &lt;goals&gt; &lt;goal&gt;process&lt;/goal&gt; &lt;/goals&gt; &lt;phase&gt;generate-sources&lt;/phase&gt; &lt;configuration&gt; &lt;!-- there must no line break between the two compiler arguments! --&gt; &lt;compilerArguments&gt;-Aeclipselink.persistencexml=${basedir}/src/main/resources/META-INF/persistence.xml&lt;/compilerArguments&gt; &lt;processors&gt; &lt;processor&gt;org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor&lt;/processor&gt; &lt;/processors&gt; &lt;/configuration&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;org.eclipse.persistence&lt;/groupId&gt; &lt;artifactId&gt;javax.persistence&lt;/artifactId&gt; &lt;version&gt;2.0.3&lt;/version&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;org.eclipse.persistence&lt;/groupId&gt; &lt;artifactId&gt;org.eclipse.persistence.jpa.modelgen&lt;/artifactId&gt; &lt;version&gt;2.3.2&lt;/version&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;/plugin&gt; </code></pre> <p>Now I have a spring project which configures the jpa via spring context. Is the only way to create the metamodel to create a persistence.xml or can I somehow stay with the configuration in the spring context?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload