you can create a separate project for your pesistence layer and
another project for the view.

you then add the persistence layer project as a dependecy to other projects.

i have here an example although this one didn't use JPA, i just used
Spring's JdbcTemplate for persistence.

http://edwin.quita.googlepages.com/Maven2HowTo.doc

and the project archetypes here:

http://edwin.quita.googlepages.com/portlet-archetype.zip
http://edwin.quita.googlepages.com/service-archetype.zip

here's a snippet how to add the persistence layer project as a
dependency (pom.xml of the view project):

                <!-- Add sampleservice as a dependency -->
                <dependency>
                        <groupId>com.persistence</groupId>
                        <artifactId>sampleservice</artifactId>
                        <version>1.0-SNAPSHOT</version>
                </dependency>

HTH,
/kits









On Wed, Aug 27, 2008 at 1:29 PM, Håkan Jacobsson
<[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have a Struts2 web application. I'm using Spring (for autowiring of
> dependency injection) to integrate JPA and Hibernate in the web app.
> It's working fine.
> Now I need to separate the JPA/Hibernate classes into a
> separate jar file (the web app will have this jar file as a dependency).
> How should I configure this? So far, I have my applicationContext.xml and
> persistence.xml files in the web app. Should those files now be put in the
> separate jarfile? Do I need to make other configuration changes to the web 
> app?
>
> I'm a newbie to both Spring and web app configuration. Any help much
> appreciated!
>
> /best regards, Hakan Jacobsson - System developer in Sweden
>
>
> /MVH, Håkan Jacobsson
>
> ########################
>
> Torsvikssvängen 52, 1/2 tr.
> 181 34 Lidingö
> tel:    08-765 84 37
> mob: 076-272 53 85
>
> ########################
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to