| [news.eclipse.technology.dali] Re: JPA dali, moving the persistence.xml |
<veröffentlicht & per E-Mail versendet>
Thanks Philippe,
your tipp works great, but only since I restart my Eclipse Galileo. After
the restart is the persistence.xml gone under "JPA Content". When I load my
entity class the "JPA Details" view shows "Details where not available for
the current selection" again.
In short, this solution works if delete your JPA project and import it as a
Maven project again, since the next restart.
I put the following plugin definition in my pom.xml:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.7</version>
<configuration>
<wtpversion>1.5</wtpversion>
<additionalProjectFacets>
<jpt.jpa>1.0</jpt.jpa>
<jst.ejb>3.0</jst.ejb>
<jst.java>6.0</jst.java>
</additionalProjectFacets>
</configuration>
</plugin>
I delete my test project and enter:
mvn clean
mvn eclipse:clean
mvn eclipse:m2eclipse
The second step is under Eclipse is "File"->"import" and then "Import
existing Maven Project". After a mintute everthing is fine. The "JPA
Details" view shows me the details und the persitence.xml shows up
under "JPA Content". Since the next restart ...
I append my example project. The entity class is "message.java". You can
test the project under Maven:
mvn test
or under Eclipse as an Junit Test - it works fine.
Thanks in advance.
Jochen
Philippe Marschall wrote:
> Jochen Buchholz wrote:
>> This does not help for me. I use a Galileo installation, also with maven2
>> plugin. I follow your instructions, but the "JPA Content" Descriptor is
>> empty and after selecting an Entity Class the "JPA Details" view
>> shows: "Details are not available for current selection".
>>
>> Did you use the stable Maven Plugin or the development release?
>
> There are a couple of tricks to get Dali working with Maven. The first
> is that it needs to be a WTP project (actually faceted). For this you
> need to set <wtpversion> [1]. Then you need to add the jpt.jpa facet.
> You can do this manually or with <additionalProjectFacets>. In the later
> case you'll probably also need some configuration files, see
> <additionalConfig>.
>
> [1]
> [http://maven.apache.org/plugins/maven-eclipse-plugin/eclipse-mojo.html
>
> Cheers
> Philippe
Attachment:
JPAmavenHibernateTest.tgz
Description: GNU Zip compressed data