You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Julien Martin <ba...@gmail.com> on 2007/08/28 11:31:48 UTC

How to get Maven to include "persistence.xml" into a web app??

Hello all,
How do I get Maven to include "persistence.xml" into a web app??
Any clue welcome!
Julien.

Here is my POM:


<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"          xsi:schemaLocation="
http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.calyonfinancial</groupId>
    <artifactId>protide</artifactId>
    <packaging>war</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>ProtideWeb</name>
    <build>
        <sourceDirectory>src</sourceDirectory>
        <outputDirectory>build</outputDirectory>
        <finalName>ProtideWeb</finalName>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.0</version>
                <configuration>
                    <warSourceDirectory>web</warSourceDirectory>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>hibernate3-maven-plugin</artifactId>
                <version>2.0-alpha-2</version>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate</artifactId>
            <version>3.2.1.ga</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-annotations</artifactId>
            <version>3.2.1.ga</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>3.2.1.ga</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-commons-annotations</artifactId>
            <version>3.3.0.ga</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>3.0.0.ga</version>
        </dependency>
        <dependency>
            <groupId>javax.persistence</groupId>
            <artifactId>persistence-api</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.14</version>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-impl</artifactId>
            <version>2.0</version>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-xjc</artifactId>
            <version>2.0</version>
        </dependency>
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
            <version>2.0</version>
        </dependency>
        <!--
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-project</artifactId>
            <version>2.0.4</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>2.0.4</version>
        </dependency>
        -->
        <dependency>
            <groupId>jdbc</groupId>
            <artifactId>as400</artifactId>
            <version>5.1.0.1</version>
        </dependency>
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jsr173_api</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.myfaces.core</groupId>
            <artifactId>myfaces-api</artifactId>
            <version>1.1.5</version>
        </dependency>
        <dependency>
            <groupId>org.apache.myfaces.core</groupId>
            <artifactId>myfaces-impl</artifactId>
            <version>1.1.5</version>
        </dependency>
        <dependency>
            <groupId>org.apache.myfaces.tomahawk</groupId>
            <artifactId>tomahawk</artifactId>
            <version>1.1.6</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.4</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.ajax4jsf</groupId>
            <artifactId>ajax4jsf</artifactId>
            <version>1.1.1</version>
        </dependency>
        <dependency>
            <groupId>org.richfaces</groupId>
            <artifactId>richfaces</artifactId>
            <version>3.0.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>3.0.1-FINAL</version>
        </dependency>



        <!--
        <dependency>
            <groupId>org.apache.myfaces.trinidad</groupId>
            <artifactId>trinidad-api</artifactId>
            <version>1.0.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.myfaces.trinidad</groupId>
            <artifactId>trinidad-impl</artifactId>
            <version>1.0.2</version>
        </dependency>

        <dependency>
            <groupId>org.ajax4jsf</groupId>
            <artifactId>a4j-trinidad</artifactId>
            <version>1.0</version>
        </dependency>
        -->
    </dependencies>
</project>

Re: How to get Maven to include "persistence.xml" into a web app??

Posted by Julien Martin <ba...@gmail.com>.
Thank!!

2007/8/28, Tim Kettler <ti...@udo.edu>:
>
> Strange, it's working for me with this simple test project:
>
>    <project>
>      <modelVersion>4.0.0</modelVersion>
>      <artifactId>my-test-app</artifactId>
>      <groupId>my-test-group</groupId>
>      <version>1.0-SNAPSHOT</version>
>      <packaging>war</packaging>
>
>      <build>
>        <plugins>
>          <plugin>
>            <groupId>org.apache.maven.plugins</groupId>
>            <artifactId>maven-war-plugin</artifactId>
>            <configuration>
>              <webResources>
>                <resource>
>                  <directory>src/conf</directory>
>                  <!-- override the destination directory for this
> resource -->
>                  <targetPath>META-INF</targetPath>
>                  <includes>
>                    <include>persistence.xml</include>
>                  </includes>
>                </resource>
>              </webResources>
>            </configuration>
>          </plugin>
>        </plugins>
>      </build>
>    </project>
>
> Additionally you have to put an empty stub in
> 'src/main/webapp/WEB-INF/web.xml' and in 'src/conf/persistence.xml'. The
> war-plugin version I use is 2.0.2.
>
> -Tim
>
> Julien Martin schrieb:
> > Thanks Tim for you suggestion. I thought I was getting there but
> apparently
> > the "targetPath" is COMPLETELY ignored by Maven... Here is where the
> > persistence.xml is copied: the root of the war...
> >
> > Here is my POM for your info. Tis almost identical to your suggestion:
> >
> > <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
> > http://www.w3.org/2001/XMLSchema-instance"          xsi:schemaLocation="
> > http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd">
> >     <modelVersion>4.0.0</modelVersion>
> >     <groupId>com.calyonfinancial</groupId>
> >     <artifactId>protide</artifactId>
> >     <packaging>war</packaging>
> >     <version>1.0-SNAPSHOT</version>
> >     <name>ProtideWeb</name>
> >     <build>
> >         <sourceDirectory>src</sourceDirectory>
> >         <outputDirectory>build</outputDirectory>
> >         <finalName>ProtideWeb</finalName>
> >         <plugins>
> >             <plugin>
> >                 <artifactId>maven-compiler-plugin</artifactId>
> >                 <configuration>
> >                     <source>1.5</source>
> >                     <target>1.5</target>
> >                 </configuration>
> >             </plugin>
> >             <plugin>
> >                 <groupId>org.apache.maven.plugins</groupId>
> >                 <artifactId>maven-war-plugin</artifactId>
> >                 <version>2.0</version>
> >                 <configuration>
> >                     <warSourceDirectory>web</warSourceDirectory>
> >                     <webResources>
> >                         <resource>
> >                             <directory>src/conf</directory>
> >                             <targetPath>META-INF</targetPath>
> >                             <includes>
> >                                 <include>persistence.xml</include>
> >                             </includes>
> >                         </resource>
> >                     </webResources>
> >                 </configuration>
> >             </plugin>
> >         </plugins>
> >     </build>
> >     <dependencies>
> >         <dependency>
> >             <groupId>org.hibernate</groupId>
> >             <artifactId>hibernate</artifactId>
> >             <version>3.2.1.ga</version>
> >         </dependency>
> >         <dependency>
> >             <groupId>org.hibernate</groupId>
> >             <artifactId>hibernate-annotations</artifactId>
> >             <version>3.2.1.ga</version>
> >         </dependency>
> >         <dependency>
> >             <groupId>org.hibernate</groupId>
> >             <artifactId>hibernate-entitymanager</artifactId>
> >             <version>3.2.1.ga</version>
> >         </dependency>
> >         <dependency>
> >             <groupId>org.hibernate</groupId>
> >             <artifactId>hibernate-commons-annotations</artifactId>
> >             <version>3.3.0.ga</version>
> >         </dependency>
> >         <dependency>
> >             <groupId>org.hibernate</groupId>
> >             <artifactId>hibernate-validator</artifactId>
> >             <version>3.0.0.ga</version>
> >         </dependency>
> >         <dependency>
> >             <groupId>javax.persistence</groupId>
> >             <artifactId>persistence-api</artifactId>
> >             <version>1.0</version>
> >         </dependency>
> >         <dependency>
> >             <groupId>log4j</groupId>
> >             <artifactId>log4j</artifactId>
> >             <version>1.2.14</version>
> >         </dependency>
> >         <dependency>
> >             <groupId>com.sun.xml.bind</groupId>
> >             <artifactId>jaxb-impl</artifactId>
> >             <version>2.0</version>
> >         </dependency>
> >         <dependency>
> >             <groupId>com.sun.xml.bind</groupId>
> >             <artifactId>jaxb-xjc</artifactId>
> >             <version>2.0</version>
> >         </dependency>
> >         <dependency>
> >             <groupId>javax.xml.bind</groupId>
> >             <artifactId>jaxb-api</artifactId>
> >             <version>2.0</version>
> >         </dependency>
> >         <!--
> >         <dependency>
> >             <groupId>org.apache.maven</groupId>
> >             <artifactId>maven-project</artifactId>
> >             <version>2.0.4</version>
> >         </dependency>
> >         <dependency>
> >             <groupId>org.apache.maven</groupId>
> >             <artifactId>maven-plugin-api</artifactId>
> >             <version>2.0.4</version>
> >         </dependency>
> >         -->
> >         <dependency>
> >             <groupId>jdbc</groupId>
> >             <artifactId>as400</artifactId>
> >             <version>5.1.0.1</version>
> >         </dependency>
> >         <dependency>
> >             <groupId>javax.xml.bind</groupId>
> >             <artifactId>jsr173_api</artifactId>
> >             <version>1.0</version>
> >         </dependency>
> >         <dependency>
> >             <groupId>org.apache.myfaces.core</groupId>
> >             <artifactId>myfaces-api</artifactId>
> >             <version>1.1.5</version>
> >         </dependency>
> >         <dependency>
> >             <groupId>org.apache.myfaces.core</groupId>
> >             <artifactId>myfaces-impl</artifactId>
> >             <version>1.1.5</version>
> >         </dependency>
> >         <dependency>
> >             <groupId>org.apache.myfaces.tomahawk</groupId>
> >             <artifactId>tomahawk</artifactId>
> >             <version>1.1.6</version>
> >         </dependency>
> >         <dependency>
> >             <groupId>javax.servlet</groupId>
> >             <artifactId>servlet-api</artifactId>
> >             <version>2.4</version>
> >             <scope>provided</scope>
> >         </dependency>
> >         <dependency>
> >             <groupId>javax.servlet</groupId>
> >             <artifactId>jsp-api</artifactId>
> >             <version>2.0</version>
> >             <scope>provided</scope>
> >         </dependency>
> >         <dependency>
> >             <groupId>org.ajax4jsf</groupId>
> >             <artifactId>ajax4jsf</artifactId>
> >             <version>1.1.1</version>
> >             <exclusions>
> >                 <exclusion>
> >                     <groupId>javax.faces</groupId>
> >                     <artifactId>jsf-api</artifactId>
> >                 </exclusion>
> >                 <exclusion>
> >                     <groupId>javax.faces</groupId>
> >                     <artifactId>jsf-impl</artifactId>
> >                 </exclusion>
> >             </exclusions>
> >         </dependency>
> >         <dependency>
> >             <groupId>org.richfaces</groupId>
> >             <artifactId>richfaces</artifactId>
> >             <version>3.0.1</version>
> >             <exclusions>
> >                 <exclusion>
> >                     <groupId>javax.faces</groupId>
> >                     <artifactId>jsf-api</artifactId>
> >                 </exclusion>
> >                 <exclusion>
> >                     <groupId>javax.faces</groupId>
> >                     <artifactId>jsf-impl</artifactId>
> >                 </exclusion>
> >             </exclusions>
> >         </dependency>
> >         <dependency>
> >             <groupId>org.apache.poi</groupId>
> >             <artifactId>poi</artifactId>
> >             <version>3.0.1-FINAL</version>
> >         </dependency>
> >         <!--
> >         <dependency>
> >             <groupId>org.apache.myfaces.trinidad</groupId>
> >             <artifactId>trinidad-api</artifactId>
> >             <version>1.0.2</version>
> >         </dependency>
> >         <dependency>
> >             <groupId>org.apache.myfaces.trinidad</groupId>
> >             <artifactId>trinidad-impl</artifactId>
> >             <version>1.0.2</version>
> >         </dependency>
> >
> >         <dependency>
> >             <groupId>org.ajax4jsf</groupId>
> >             <artifactId>a4j-trinidad</artifactId>
> >             <version>1.0</version>
> >         </dependency>
> >         -->
> >     </dependencies>
> > </project>
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: How to get Maven to include "persistence.xml" into a web app??

Posted by Tim Kettler <ti...@udo.edu>.
Strange, it's working for me with this simple test project:

   <project>
     <modelVersion>4.0.0</modelVersion>
     <artifactId>my-test-app</artifactId>
     <groupId>my-test-group</groupId>
     <version>1.0-SNAPSHOT</version>
     <packaging>war</packaging>

     <build>
       <plugins>
         <plugin>
           <groupId>org.apache.maven.plugins</groupId>
           <artifactId>maven-war-plugin</artifactId>
           <configuration>
             <webResources>
               <resource>
                 <directory>src/conf</directory>
                 <!-- override the destination directory for this 
resource -->
                 <targetPath>META-INF</targetPath>
                 <includes>
                   <include>persistence.xml</include>
                 </includes>
               </resource>
             </webResources>
           </configuration>
         </plugin>
       </plugins>
     </build>
   </project>

Additionally you have to put an empty stub in 
'src/main/webapp/WEB-INF/web.xml' and in 'src/conf/persistence.xml'. The 
war-plugin version I use is 2.0.2.

-Tim

Julien Martin schrieb:
> Thanks Tim for you suggestion. I thought I was getting there but apparently
> the "targetPath" is COMPLETELY ignored by Maven... Here is where the
> persistence.xml is copied: the root of the war...
> 
> Here is my POM for your info. Tis almost identical to your suggestion:
> 
> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance"          xsi:schemaLocation="
> http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
>     <modelVersion>4.0.0</modelVersion>
>     <groupId>com.calyonfinancial</groupId>
>     <artifactId>protide</artifactId>
>     <packaging>war</packaging>
>     <version>1.0-SNAPSHOT</version>
>     <name>ProtideWeb</name>
>     <build>
>         <sourceDirectory>src</sourceDirectory>
>         <outputDirectory>build</outputDirectory>
>         <finalName>ProtideWeb</finalName>
>         <plugins>
>             <plugin>
>                 <artifactId>maven-compiler-plugin</artifactId>
>                 <configuration>
>                     <source>1.5</source>
>                     <target>1.5</target>
>                 </configuration>
>             </plugin>
>             <plugin>
>                 <groupId>org.apache.maven.plugins</groupId>
>                 <artifactId>maven-war-plugin</artifactId>
>                 <version>2.0</version>
>                 <configuration>
>                     <warSourceDirectory>web</warSourceDirectory>
>                     <webResources>
>                         <resource>
>                             <directory>src/conf</directory>
>                             <targetPath>META-INF</targetPath>
>                             <includes>
>                                 <include>persistence.xml</include>
>                             </includes>
>                         </resource>
>                     </webResources>
>                 </configuration>
>             </plugin>
>         </plugins>
>     </build>
>     <dependencies>
>         <dependency>
>             <groupId>org.hibernate</groupId>
>             <artifactId>hibernate</artifactId>
>             <version>3.2.1.ga</version>
>         </dependency>
>         <dependency>
>             <groupId>org.hibernate</groupId>
>             <artifactId>hibernate-annotations</artifactId>
>             <version>3.2.1.ga</version>
>         </dependency>
>         <dependency>
>             <groupId>org.hibernate</groupId>
>             <artifactId>hibernate-entitymanager</artifactId>
>             <version>3.2.1.ga</version>
>         </dependency>
>         <dependency>
>             <groupId>org.hibernate</groupId>
>             <artifactId>hibernate-commons-annotations</artifactId>
>             <version>3.3.0.ga</version>
>         </dependency>
>         <dependency>
>             <groupId>org.hibernate</groupId>
>             <artifactId>hibernate-validator</artifactId>
>             <version>3.0.0.ga</version>
>         </dependency>
>         <dependency>
>             <groupId>javax.persistence</groupId>
>             <artifactId>persistence-api</artifactId>
>             <version>1.0</version>
>         </dependency>
>         <dependency>
>             <groupId>log4j</groupId>
>             <artifactId>log4j</artifactId>
>             <version>1.2.14</version>
>         </dependency>
>         <dependency>
>             <groupId>com.sun.xml.bind</groupId>
>             <artifactId>jaxb-impl</artifactId>
>             <version>2.0</version>
>         </dependency>
>         <dependency>
>             <groupId>com.sun.xml.bind</groupId>
>             <artifactId>jaxb-xjc</artifactId>
>             <version>2.0</version>
>         </dependency>
>         <dependency>
>             <groupId>javax.xml.bind</groupId>
>             <artifactId>jaxb-api</artifactId>
>             <version>2.0</version>
>         </dependency>
>         <!--
>         <dependency>
>             <groupId>org.apache.maven</groupId>
>             <artifactId>maven-project</artifactId>
>             <version>2.0.4</version>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.maven</groupId>
>             <artifactId>maven-plugin-api</artifactId>
>             <version>2.0.4</version>
>         </dependency>
>         -->
>         <dependency>
>             <groupId>jdbc</groupId>
>             <artifactId>as400</artifactId>
>             <version>5.1.0.1</version>
>         </dependency>
>         <dependency>
>             <groupId>javax.xml.bind</groupId>
>             <artifactId>jsr173_api</artifactId>
>             <version>1.0</version>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.myfaces.core</groupId>
>             <artifactId>myfaces-api</artifactId>
>             <version>1.1.5</version>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.myfaces.core</groupId>
>             <artifactId>myfaces-impl</artifactId>
>             <version>1.1.5</version>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.myfaces.tomahawk</groupId>
>             <artifactId>tomahawk</artifactId>
>             <version>1.1.6</version>
>         </dependency>
>         <dependency>
>             <groupId>javax.servlet</groupId>
>             <artifactId>servlet-api</artifactId>
>             <version>2.4</version>
>             <scope>provided</scope>
>         </dependency>
>         <dependency>
>             <groupId>javax.servlet</groupId>
>             <artifactId>jsp-api</artifactId>
>             <version>2.0</version>
>             <scope>provided</scope>
>         </dependency>
>         <dependency>
>             <groupId>org.ajax4jsf</groupId>
>             <artifactId>ajax4jsf</artifactId>
>             <version>1.1.1</version>
>             <exclusions>
>                 <exclusion>
>                     <groupId>javax.faces</groupId>
>                     <artifactId>jsf-api</artifactId>
>                 </exclusion>
>                 <exclusion>
>                     <groupId>javax.faces</groupId>
>                     <artifactId>jsf-impl</artifactId>
>                 </exclusion>
>             </exclusions>
>         </dependency>
>         <dependency>
>             <groupId>org.richfaces</groupId>
>             <artifactId>richfaces</artifactId>
>             <version>3.0.1</version>
>             <exclusions>
>                 <exclusion>
>                     <groupId>javax.faces</groupId>
>                     <artifactId>jsf-api</artifactId>
>                 </exclusion>
>                 <exclusion>
>                     <groupId>javax.faces</groupId>
>                     <artifactId>jsf-impl</artifactId>
>                 </exclusion>
>             </exclusions>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.poi</groupId>
>             <artifactId>poi</artifactId>
>             <version>3.0.1-FINAL</version>
>         </dependency>
>         <!--
>         <dependency>
>             <groupId>org.apache.myfaces.trinidad</groupId>
>             <artifactId>trinidad-api</artifactId>
>             <version>1.0.2</version>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.myfaces.trinidad</groupId>
>             <artifactId>trinidad-impl</artifactId>
>             <version>1.0.2</version>
>         </dependency>
> 
>         <dependency>
>             <groupId>org.ajax4jsf</groupId>
>             <artifactId>a4j-trinidad</artifactId>
>             <version>1.0</version>
>         </dependency>
>         -->
>     </dependencies>
> </project>
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: How to get Maven to include "persistence.xml" into a web app??

Posted by Julien Martin <ba...@gmail.com>.
Thanks Tim for you suggestion. I thought I was getting there but apparently
the "targetPath" is COMPLETELY ignored by Maven... Here is where the
persistence.xml is copied: the root of the war...

Here is my POM for your info. Tis almost identical to your suggestion:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"          xsi:schemaLocation="
http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.calyonfinancial</groupId>
    <artifactId>protide</artifactId>
    <packaging>war</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>ProtideWeb</name>
    <build>
        <sourceDirectory>src</sourceDirectory>
        <outputDirectory>build</outputDirectory>
        <finalName>ProtideWeb</finalName>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.0</version>
                <configuration>
                    <warSourceDirectory>web</warSourceDirectory>
                    <webResources>
                        <resource>
                            <directory>src/conf</directory>
                            <targetPath>META-INF</targetPath>
                            <includes>
                                <include>persistence.xml</include>
                            </includes>
                        </resource>
                    </webResources>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate</artifactId>
            <version>3.2.1.ga</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-annotations</artifactId>
            <version>3.2.1.ga</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-entitymanager</artifactId>
            <version>3.2.1.ga</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-commons-annotations</artifactId>
            <version>3.3.0.ga</version>
        </dependency>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-validator</artifactId>
            <version>3.0.0.ga</version>
        </dependency>
        <dependency>
            <groupId>javax.persistence</groupId>
            <artifactId>persistence-api</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.14</version>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-impl</artifactId>
            <version>2.0</version>
        </dependency>
        <dependency>
            <groupId>com.sun.xml.bind</groupId>
            <artifactId>jaxb-xjc</artifactId>
            <version>2.0</version>
        </dependency>
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jaxb-api</artifactId>
            <version>2.0</version>
        </dependency>
        <!--
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-project</artifactId>
            <version>2.0.4</version>
        </dependency>
        <dependency>
            <groupId>org.apache.maven</groupId>
            <artifactId>maven-plugin-api</artifactId>
            <version>2.0.4</version>
        </dependency>
        -->
        <dependency>
            <groupId>jdbc</groupId>
            <artifactId>as400</artifactId>
            <version>5.1.0.1</version>
        </dependency>
        <dependency>
            <groupId>javax.xml.bind</groupId>
            <artifactId>jsr173_api</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.myfaces.core</groupId>
            <artifactId>myfaces-api</artifactId>
            <version>1.1.5</version>
        </dependency>
        <dependency>
            <groupId>org.apache.myfaces.core</groupId>
            <artifactId>myfaces-impl</artifactId>
            <version>1.1.5</version>
        </dependency>
        <dependency>
            <groupId>org.apache.myfaces.tomahawk</groupId>
            <artifactId>tomahawk</artifactId>
            <version>1.1.6</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>servlet-api</artifactId>
            <version>2.4</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jsp-api</artifactId>
            <version>2.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.ajax4jsf</groupId>
            <artifactId>ajax4jsf</artifactId>
            <version>1.1.1</version>
            <exclusions>
                <exclusion>
                    <groupId>javax.faces</groupId>
                    <artifactId>jsf-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.faces</groupId>
                    <artifactId>jsf-impl</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.richfaces</groupId>
            <artifactId>richfaces</artifactId>
            <version>3.0.1</version>
            <exclusions>
                <exclusion>
                    <groupId>javax.faces</groupId>
                    <artifactId>jsf-api</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.faces</groupId>
                    <artifactId>jsf-impl</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>3.0.1-FINAL</version>
        </dependency>
        <!--
        <dependency>
            <groupId>org.apache.myfaces.trinidad</groupId>
            <artifactId>trinidad-api</artifactId>
            <version>1.0.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.myfaces.trinidad</groupId>
            <artifactId>trinidad-impl</artifactId>
            <version>1.0.2</version>
        </dependency>

        <dependency>
            <groupId>org.ajax4jsf</groupId>
            <artifactId>a4j-trinidad</artifactId>
            <version>1.0</version>
        </dependency>
        -->
    </dependencies>
</project>

Re: How to get Maven to include "persistence.xml" into a web app??

Posted by Tim Kettler <ti...@udo.edu>.
Hi,

this should do what you want:

  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
     <artifactId>maven-war-plugin</artifactId>
     <configuration>
       <webResources>
         <resource>
           <directory>src/conf</directory>
           <!-- override the destination directory for this resource -->
           <targetPath>META-INF</targetPath>
           <includes>
             <include>persistence.xml</include>
           </includes>
         </resource>
       </webResources>
     </configuration>
   </plugin>

-Tim

Julien Martin schrieb:
> The problem is that I have to use an existing path i.e.
> (MyProject\src\conf\persistence.xml) and cannot change that....
> Is there not a way to modify the POM in order for it to include my
> persistence.xml??
> Sorry I am a real beginner at Maven...
> Julien.
> 
> 2007/8/28, ben short <ja...@gmail.com>:
>> I think you can just create /src/main/webapp/META-INF and put it in there.
>>
>> On 8/28/07, Julien Martin <ba...@gmail.com> wrote:
>>> Thanks Ben,
>>> Is there not a way to put it (persistence.xml) into meta-inf instead?
>>> Julien.
>>>
>>> 2007/8/28, ben short <ja...@gmail.com>:
>>>> persistence.xml needs to be on the class path doesn't it?
>>>>
>>>> Create a directory src/main/java/resources and put it in there. When
>>>> maven packages up your war it will put all files in the resources
>>>> directory into your war file under the WEB-INF/classes directory.
>>>>
>>>> Hope this helps.
>>>>
>>>> Ben
>>>>
>>>>
>>>> On 8/28/07, Julien Martin <ba...@gmail.com> wrote:
>>>>> Hello all,
>>>>> How do I get Maven to include "persistence.xml" into a web app??
>>>>> Any clue welcome!
>>>>> Julien.
>>>>>
>>>>> Here is my POM:
>>>>>
>>>>>
>>>>> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
>>>>> http://www.w3.org/2001/XMLSchema-instance
>> "          xsi:schemaLocation="
>>>>> http://maven.apache.org/POM/4.0.0
>>>> http://maven.apache.org/maven-v4_0_0.xsd">
>>>>>     <modelVersion>4.0.0</modelVersion>
>>>>>     <groupId>com.calyonfinancial</groupId>
>>>>>     <artifactId>protide</artifactId>
>>>>>     <packaging>war</packaging>
>>>>>     <version>1.0-SNAPSHOT</version>
>>>>>     <name>ProtideWeb</name>
>>>>>     <build>
>>>>>         <sourceDirectory>src</sourceDirectory>
>>>>>         <outputDirectory>build</outputDirectory>
>>>>>         <finalName>ProtideWeb</finalName>
>>>>>         <plugins>
>>>>>             <plugin>
>>>>>                 <artifactId>maven-compiler-plugin</artifactId>
>>>>>                 <configuration>
>>>>>                     <source>1.5</source>
>>>>>                     <target>1.5</target>
>>>>>                 </configuration>
>>>>>             </plugin>
>>>>>             <plugin>
>>>>>                 <groupId>org.apache.maven.plugins</groupId>
>>>>>                 <artifactId>maven-war-plugin</artifactId>
>>>>>                 <version>2.0</version>
>>>>>                 <configuration>
>>>>>                     <warSourceDirectory>web</warSourceDirectory>
>>>>>                 </configuration>
>>>>>             </plugin>
>>>>>             <plugin>
>>>>>                 <groupId>org.codehaus.mojo</groupId>
>>>>>                 <artifactId>hibernate3-maven-plugin</artifactId>
>>>>>                 <version>2.0-alpha-2</version>
>>>>>             </plugin>
>>>>>         </plugins>
>>>>>     </build>
>>>>>     <dependencies>
>>>>>         <dependency>
>>>>>             <groupId>org.hibernate</groupId>
>>>>>             <artifactId>hibernate</artifactId>
>>>>>             <version>3.2.1.ga</version>
>>>>>         </dependency>
>>>>>         <dependency>
>>>>>             <groupId>org.hibernate</groupId>
>>>>>             <artifactId>hibernate-annotations</artifactId>
>>>>>             <version>3.2.1.ga</version>
>>>>>         </dependency>
>>>>>         <dependency>
>>>>>             <groupId>org.hibernate</groupId>
>>>>>             <artifactId>hibernate-entitymanager</artifactId>
>>>>>             <version>3.2.1.ga</version>
>>>>>         </dependency>
>>>>>         <dependency>
>>>>>             <groupId>org.hibernate</groupId>
>>>>>             <artifactId>hibernate-commons-annotations</artifactId>
>>>>>             <version>3.3.0.ga</version>
>>>>>         </dependency>
>>>>>         <dependency>
>>>>>             <groupId>org.hibernate</groupId>
>>>>>             <artifactId>hibernate-validator</artifactId>
>>>>>             <version>3.0.0.ga</version>
>>>>>         </dependency>
>>>>>         <dependency>
>>>>>             <groupId>javax.persistence</groupId>
>>>>>             <artifactId>persistence-api</artifactId>
>>>>>             <version>1.0</version>
>>>>>         </dependency>
>>>>>         <dependency>
>>>>>             <groupId>log4j</groupId>
>>>>>             <artifactId>log4j</artifactId>
>>>>>             <version>1.2.14</version>
>>>>>         </dependency>
>>>>>         <dependency>
>>>>>             <groupId>com.sun.xml.bind</groupId>
>>>>>             <artifactId>jaxb-impl</artifactId>
>>>>>             <version>2.0</version>
>>>>>         </dependency>
>>>>>         <dependency>
>>>>>             <groupId>com.sun.xml.bind</groupId>
>>>>>             <artifactId>jaxb-xjc</artifactId>
>>>>>             <version>2.0</version>
>>>>>         </dependency>
>>>>>         <dependency>
>>>>>             <groupId>javax.xml.bind</groupId>
>>>>>             <artifactId>jaxb-api</artifactId>
>>>>>             <version>2.0</version>
>>>>>         </dependency>
>>>>>         <!--
>>>>>         <dependency>
>>>>>             <groupId>org.apache.maven</groupId>
>>>>>             <artifactId>maven-project</artifactId>
>>>>>             <version>2.0.4</version>
>>>>>         </dependency>
>>>>>         <dependency>
>>>>>             <groupId>org.apache.maven</groupId>
>>>>>             <artifactId>maven-plugin-api</artifactId>
>>>>>             <version>2.0.4</version>
>>>>>         </dependency>
>>>>>         -->
>>>>>         <dependency>
>>>>>             <groupId>jdbc</groupId>
>>>>>             <artifactId>as400</artifactId>
>>>>>             <version>5.1.0.1</version>
>>>>>         </dependency>
>>>>>         <dependency>
>>>>>             <groupId>javax.xml.bind</groupId>
>>>>>             <artifactId>jsr173_api</artifactId>
>>>>>             <version>1.0</version>
>>>>>         </dependency>
>>>>>         <dependency>
>>>>>             <groupId>org.apache.myfaces.core</groupId>
>>>>>             <artifactId>myfaces-api</artifactId>
>>>>>             <version>1.1.5</version>
>>>>>         </dependency>
>>>>>         <dependency>
>>>>>             <groupId>org.apache.myfaces.core</groupId>
>>>>>             <artifactId>myfaces-impl</artifactId>
>>>>>             <version>1.1.5</version>
>>>>>         </dependency>
>>>>>         <dependency>
>>>>>             <groupId>org.apache.myfaces.tomahawk</groupId>
>>>>>             <artifactId>tomahawk</artifactId>
>>>>>             <version>1.1.6</version>
>>>>>         </dependency>
>>>>>         <dependency>
>>>>>             <groupId>javax.servlet</groupId>
>>>>>             <artifactId>servlet-api</artifactId>
>>>>>             <version>2.4</version>
>>>>>             <scope>provided</scope>
>>>>>         </dependency>
>>>>>         <dependency>
>>>>>             <groupId>javax.servlet</groupId>
>>>>>             <artifactId>jsp-api</artifactId>
>>>>>             <version>2.0</version>
>>>>>             <scope>provided</scope>
>>>>>         </dependency>
>>>>>         <dependency>
>>>>>             <groupId>org.ajax4jsf</groupId>
>>>>>             <artifactId>ajax4jsf</artifactId>
>>>>>             <version>1.1.1</version>
>>>>>         </dependency>
>>>>>         <dependency>
>>>>>             <groupId>org.richfaces</groupId>
>>>>>             <artifactId>richfaces</artifactId>
>>>>>             <version>3.0.1</version>
>>>>>         </dependency>
>>>>>         <dependency>
>>>>>             <groupId>org.apache.poi</groupId>
>>>>>             <artifactId>poi</artifactId>
>>>>>             <version>3.0.1-FINAL</version>
>>>>>         </dependency>
>>>>>
>>>>>
>>>>>
>>>>>         <!--
>>>>>         <dependency>
>>>>>             <groupId>org.apache.myfaces.trinidad</groupId>
>>>>>             <artifactId>trinidad-api</artifactId>
>>>>>             <version>1.0.2</version>
>>>>>         </dependency>
>>>>>         <dependency>
>>>>>             <groupId>org.apache.myfaces.trinidad</groupId>
>>>>>             <artifactId>trinidad-impl</artifactId>
>>>>>             <version>1.0.2</version>
>>>>>         </dependency>
>>>>>
>>>>>         <dependency>
>>>>>             <groupId>org.ajax4jsf</groupId>
>>>>>             <artifactId>a4j-trinidad</artifactId>
>>>>>             <version>1.0</version>
>>>>>         </dependency>
>>>>>         -->
>>>>>     </dependencies>
>>>>> </project>
>>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>> For additional commands, e-mail: users-help@maven.apache.org
>>>>
>>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: How to get Maven to include "persistence.xml" into a web app??

Posted by Bram de Kruijff <br...@gx.nl>.
Hi Julien,

you can configure aditional resources through the war plugin.

http://maven.apache.org/plugins/maven-war-plugin/examples/adding-filteri
ng-webresources.html 

So you need something like this

 <!-- All webapps filter and add **/**.xml in src/main/config tp the war
-->
 <plugin>
   <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <configuration>
      <webResources>
        <resource>
          <filtering>false</filtering>
          <directory>${basedir}/src/main/config-flex</directory>
          <includes>
            <include>**/**</include>
          </includes>
        </resource>
      </webResources>
    </configuration>
  </plugin>

regards,
Bram

--
Bram de Kruijff
Product Architect

GX
open for business
 
t: 024 - 388 82 61
f: 024 - 388 86 21
e: bramk@gx.nl
 
Wijchenseweg 111
6538 SW Nijmegen
www.gx.nl

KvK: 10044410 

> -----Original Message-----
> From: Julien Martin [mailto:balteo@gmail.com] 
> Sent: Tuesday, August 28, 2007 1:30 PM
> To: Maven Users List
> Subject: Re: How to get Maven to include "persistence.xml" 
> into a web app??
> 
> The problem is that I have to use an existing path i.e.
> (MyProject\src\conf\persistence.xml) and cannot change that....
> Is there not a way to modify the POM in order for it to 
> include my persistence.xml??
> Sorry I am a real beginner at Maven...
> Julien.
> 
> 2007/8/28, ben short <ja...@gmail.com>:
> >
> > I think you can just create /src/main/webapp/META-INF and 
> put it in there.
> >
> > On 8/28/07, Julien Martin <ba...@gmail.com> wrote:
> > > Thanks Ben,
> > > Is there not a way to put it (persistence.xml) into 
> meta-inf instead?
> > > Julien.
> > >
> > > 2007/8/28, ben short <ja...@gmail.com>:
> > > >
> > > > persistence.xml needs to be on the class path doesn't it?
> > > >
> > > > Create a directory src/main/java/resources and put it in there. 
> > > > When maven packages up your war it will put all files in the 
> > > > resources directory into your war file under the 
> WEB-INF/classes directory.
> > > >
> > > > Hope this helps.
> > > >
> > > > Ben
> > > >
> > > >
> > > > On 8/28/07, Julien Martin <ba...@gmail.com> wrote:
> > > > > Hello all,
> > > > > How do I get Maven to include "persistence.xml" into 
> a web app??
> > > > > Any clue welcome!
> > > > > Julien.
> > > > >
> > > > > Here is my POM:
> > > > >
> > > > >
> > > > > <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
> > > > > http://www.w3.org/2001/XMLSchema-instance
> > "          xsi:schemaLocation="
> > > > > http://maven.apache.org/POM/4.0.0
> > > > http://maven.apache.org/maven-v4_0_0.xsd">
> > > > >     <modelVersion>4.0.0</modelVersion>
> > > > >     <groupId>com.calyonfinancial</groupId>
> > > > >     <artifactId>protide</artifactId>
> > > > >     <packaging>war</packaging>
> > > > >     <version>1.0-SNAPSHOT</version>
> > > > >     <name>ProtideWeb</name>
> > > > >     <build>
> > > > >         <sourceDirectory>src</sourceDirectory>
> > > > >         <outputDirectory>build</outputDirectory>
> > > > >         <finalName>ProtideWeb</finalName>
> > > > >         <plugins>
> > > > >             <plugin>
> > > > >                 <artifactId>maven-compiler-plugin</artifactId>
> > > > >                 <configuration>
> > > > >                     <source>1.5</source>
> > > > >                     <target>1.5</target>
> > > > >                 </configuration>
> > > > >             </plugin>
> > > > >             <plugin>
> > > > >                 <groupId>org.apache.maven.plugins</groupId>
> > > > >                 <artifactId>maven-war-plugin</artifactId>
> > > > >                 <version>2.0</version>
> > > > >                 <configuration>
> > > > >                     
> <warSourceDirectory>web</warSourceDirectory>
> > > > >                 </configuration>
> > > > >             </plugin>
> > > > >             <plugin>
> > > > >                 <groupId>org.codehaus.mojo</groupId>
> > > > >                 
> <artifactId>hibernate3-maven-plugin</artifactId>
> > > > >                 <version>2.0-alpha-2</version>
> > > > >             </plugin>
> > > > >         </plugins>
> > > > >     </build>
> > > > >     <dependencies>
> > > > >         <dependency>
> > > > >             <groupId>org.hibernate</groupId>
> > > > >             <artifactId>hibernate</artifactId>
> > > > >             <version>3.2.1.ga</version>
> > > > >         </dependency>
> > > > >         <dependency>
> > > > >             <groupId>org.hibernate</groupId>
> > > > >             <artifactId>hibernate-annotations</artifactId>
> > > > >             <version>3.2.1.ga</version>
> > > > >         </dependency>
> > > > >         <dependency>
> > > > >             <groupId>org.hibernate</groupId>
> > > > >             <artifactId>hibernate-entitymanager</artifactId>
> > > > >             <version>3.2.1.ga</version>
> > > > >         </dependency>
> > > > >         <dependency>
> > > > >             <groupId>org.hibernate</groupId>
> > > > >             
> <artifactId>hibernate-commons-annotations</artifactId>
> > > > >             <version>3.3.0.ga</version>
> > > > >         </dependency>
> > > > >         <dependency>
> > > > >             <groupId>org.hibernate</groupId>
> > > > >             <artifactId>hibernate-validator</artifactId>
> > > > >             <version>3.0.0.ga</version>
> > > > >         </dependency>
> > > > >         <dependency>
> > > > >             <groupId>javax.persistence</groupId>
> > > > >             <artifactId>persistence-api</artifactId>
> > > > >             <version>1.0</version>
> > > > >         </dependency>
> > > > >         <dependency>
> > > > >             <groupId>log4j</groupId>
> > > > >             <artifactId>log4j</artifactId>
> > > > >             <version>1.2.14</version>
> > > > >         </dependency>
> > > > >         <dependency>
> > > > >             <groupId>com.sun.xml.bind</groupId>
> > > > >             <artifactId>jaxb-impl</artifactId>
> > > > >             <version>2.0</version>
> > > > >         </dependency>
> > > > >         <dependency>
> > > > >             <groupId>com.sun.xml.bind</groupId>
> > > > >             <artifactId>jaxb-xjc</artifactId>
> > > > >             <version>2.0</version>
> > > > >         </dependency>
> > > > >         <dependency>
> > > > >             <groupId>javax.xml.bind</groupId>
> > > > >             <artifactId>jaxb-api</artifactId>
> > > > >             <version>2.0</version>
> > > > >         </dependency>
> > > > >         <!--
> > > > >         <dependency>
> > > > >             <groupId>org.apache.maven</groupId>
> > > > >             <artifactId>maven-project</artifactId>
> > > > >             <version>2.0.4</version>
> > > > >         </dependency>
> > > > >         <dependency>
> > > > >             <groupId>org.apache.maven</groupId>
> > > > >             <artifactId>maven-plugin-api</artifactId>
> > > > >             <version>2.0.4</version>
> > > > >         </dependency>
> > > > >         -->
> > > > >         <dependency>
> > > > >             <groupId>jdbc</groupId>
> > > > >             <artifactId>as400</artifactId>
> > > > >             <version>5.1.0.1</version>
> > > > >         </dependency>
> > > > >         <dependency>
> > > > >             <groupId>javax.xml.bind</groupId>
> > > > >             <artifactId>jsr173_api</artifactId>
> > > > >             <version>1.0</version>
> > > > >         </dependency>
> > > > >         <dependency>
> > > > >             <groupId>org.apache.myfaces.core</groupId>
> > > > >             <artifactId>myfaces-api</artifactId>
> > > > >             <version>1.1.5</version>
> > > > >         </dependency>
> > > > >         <dependency>
> > > > >             <groupId>org.apache.myfaces.core</groupId>
> > > > >             <artifactId>myfaces-impl</artifactId>
> > > > >             <version>1.1.5</version>
> > > > >         </dependency>
> > > > >         <dependency>
> > > > >             <groupId>org.apache.myfaces.tomahawk</groupId>
> > > > >             <artifactId>tomahawk</artifactId>
> > > > >             <version>1.1.6</version>
> > > > >         </dependency>
> > > > >         <dependency>
> > > > >             <groupId>javax.servlet</groupId>
> > > > >             <artifactId>servlet-api</artifactId>
> > > > >             <version>2.4</version>
> > > > >             <scope>provided</scope>
> > > > >         </dependency>
> > > > >         <dependency>
> > > > >             <groupId>javax.servlet</groupId>
> > > > >             <artifactId>jsp-api</artifactId>
> > > > >             <version>2.0</version>
> > > > >             <scope>provided</scope>
> > > > >         </dependency>
> > > > >         <dependency>
> > > > >             <groupId>org.ajax4jsf</groupId>
> > > > >             <artifactId>ajax4jsf</artifactId>
> > > > >             <version>1.1.1</version>
> > > > >         </dependency>
> > > > >         <dependency>
> > > > >             <groupId>org.richfaces</groupId>
> > > > >             <artifactId>richfaces</artifactId>
> > > > >             <version>3.0.1</version>
> > > > >         </dependency>
> > > > >         <dependency>
> > > > >             <groupId>org.apache.poi</groupId>
> > > > >             <artifactId>poi</artifactId>
> > > > >             <version>3.0.1-FINAL</version>
> > > > >         </dependency>
> > > > >
> > > > >
> > > > >
> > > > >         <!--
> > > > >         <dependency>
> > > > >             <groupId>org.apache.myfaces.trinidad</groupId>
> > > > >             <artifactId>trinidad-api</artifactId>
> > > > >             <version>1.0.2</version>
> > > > >         </dependency>
> > > > >         <dependency>
> > > > >             <groupId>org.apache.myfaces.trinidad</groupId>
> > > > >             <artifactId>trinidad-impl</artifactId>
> > > > >             <version>1.0.2</version>
> > > > >         </dependency>
> > > > >
> > > > >         <dependency>
> > > > >             <groupId>org.ajax4jsf</groupId>
> > > > >             <artifactId>a4j-trinidad</artifactId>
> > > > >             <version>1.0</version>
> > > > >         </dependency>
> > > > >         -->
> > > > >     </dependencies>
> > > > > </project>
> > > > >
> > > >
> > > > 
> ------------------------------------------------------------------
> > > > --- To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > > For additional commands, e-mail: users-help@maven.apache.org
> > > >
> > > >
> > >
> >
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: How to get Maven to include "persistence.xml" into a web app??

Posted by Julien Martin <ba...@gmail.com>.
The problem is that I have to use an existing path i.e.
(MyProject\src\conf\persistence.xml) and cannot change that....
Is there not a way to modify the POM in order for it to include my
persistence.xml??
Sorry I am a real beginner at Maven...
Julien.

2007/8/28, ben short <ja...@gmail.com>:
>
> I think you can just create /src/main/webapp/META-INF and put it in there.
>
> On 8/28/07, Julien Martin <ba...@gmail.com> wrote:
> > Thanks Ben,
> > Is there not a way to put it (persistence.xml) into meta-inf instead?
> > Julien.
> >
> > 2007/8/28, ben short <ja...@gmail.com>:
> > >
> > > persistence.xml needs to be on the class path doesn't it?
> > >
> > > Create a directory src/main/java/resources and put it in there. When
> > > maven packages up your war it will put all files in the resources
> > > directory into your war file under the WEB-INF/classes directory.
> > >
> > > Hope this helps.
> > >
> > > Ben
> > >
> > >
> > > On 8/28/07, Julien Martin <ba...@gmail.com> wrote:
> > > > Hello all,
> > > > How do I get Maven to include "persistence.xml" into a web app??
> > > > Any clue welcome!
> > > > Julien.
> > > >
> > > > Here is my POM:
> > > >
> > > >
> > > > <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
> > > > http://www.w3.org/2001/XMLSchema-instance
> "          xsi:schemaLocation="
> > > > http://maven.apache.org/POM/4.0.0
> > > http://maven.apache.org/maven-v4_0_0.xsd">
> > > >     <modelVersion>4.0.0</modelVersion>
> > > >     <groupId>com.calyonfinancial</groupId>
> > > >     <artifactId>protide</artifactId>
> > > >     <packaging>war</packaging>
> > > >     <version>1.0-SNAPSHOT</version>
> > > >     <name>ProtideWeb</name>
> > > >     <build>
> > > >         <sourceDirectory>src</sourceDirectory>
> > > >         <outputDirectory>build</outputDirectory>
> > > >         <finalName>ProtideWeb</finalName>
> > > >         <plugins>
> > > >             <plugin>
> > > >                 <artifactId>maven-compiler-plugin</artifactId>
> > > >                 <configuration>
> > > >                     <source>1.5</source>
> > > >                     <target>1.5</target>
> > > >                 </configuration>
> > > >             </plugin>
> > > >             <plugin>
> > > >                 <groupId>org.apache.maven.plugins</groupId>
> > > >                 <artifactId>maven-war-plugin</artifactId>
> > > >                 <version>2.0</version>
> > > >                 <configuration>
> > > >                     <warSourceDirectory>web</warSourceDirectory>
> > > >                 </configuration>
> > > >             </plugin>
> > > >             <plugin>
> > > >                 <groupId>org.codehaus.mojo</groupId>
> > > >                 <artifactId>hibernate3-maven-plugin</artifactId>
> > > >                 <version>2.0-alpha-2</version>
> > > >             </plugin>
> > > >         </plugins>
> > > >     </build>
> > > >     <dependencies>
> > > >         <dependency>
> > > >             <groupId>org.hibernate</groupId>
> > > >             <artifactId>hibernate</artifactId>
> > > >             <version>3.2.1.ga</version>
> > > >         </dependency>
> > > >         <dependency>
> > > >             <groupId>org.hibernate</groupId>
> > > >             <artifactId>hibernate-annotations</artifactId>
> > > >             <version>3.2.1.ga</version>
> > > >         </dependency>
> > > >         <dependency>
> > > >             <groupId>org.hibernate</groupId>
> > > >             <artifactId>hibernate-entitymanager</artifactId>
> > > >             <version>3.2.1.ga</version>
> > > >         </dependency>
> > > >         <dependency>
> > > >             <groupId>org.hibernate</groupId>
> > > >             <artifactId>hibernate-commons-annotations</artifactId>
> > > >             <version>3.3.0.ga</version>
> > > >         </dependency>
> > > >         <dependency>
> > > >             <groupId>org.hibernate</groupId>
> > > >             <artifactId>hibernate-validator</artifactId>
> > > >             <version>3.0.0.ga</version>
> > > >         </dependency>
> > > >         <dependency>
> > > >             <groupId>javax.persistence</groupId>
> > > >             <artifactId>persistence-api</artifactId>
> > > >             <version>1.0</version>
> > > >         </dependency>
> > > >         <dependency>
> > > >             <groupId>log4j</groupId>
> > > >             <artifactId>log4j</artifactId>
> > > >             <version>1.2.14</version>
> > > >         </dependency>
> > > >         <dependency>
> > > >             <groupId>com.sun.xml.bind</groupId>
> > > >             <artifactId>jaxb-impl</artifactId>
> > > >             <version>2.0</version>
> > > >         </dependency>
> > > >         <dependency>
> > > >             <groupId>com.sun.xml.bind</groupId>
> > > >             <artifactId>jaxb-xjc</artifactId>
> > > >             <version>2.0</version>
> > > >         </dependency>
> > > >         <dependency>
> > > >             <groupId>javax.xml.bind</groupId>
> > > >             <artifactId>jaxb-api</artifactId>
> > > >             <version>2.0</version>
> > > >         </dependency>
> > > >         <!--
> > > >         <dependency>
> > > >             <groupId>org.apache.maven</groupId>
> > > >             <artifactId>maven-project</artifactId>
> > > >             <version>2.0.4</version>
> > > >         </dependency>
> > > >         <dependency>
> > > >             <groupId>org.apache.maven</groupId>
> > > >             <artifactId>maven-plugin-api</artifactId>
> > > >             <version>2.0.4</version>
> > > >         </dependency>
> > > >         -->
> > > >         <dependency>
> > > >             <groupId>jdbc</groupId>
> > > >             <artifactId>as400</artifactId>
> > > >             <version>5.1.0.1</version>
> > > >         </dependency>
> > > >         <dependency>
> > > >             <groupId>javax.xml.bind</groupId>
> > > >             <artifactId>jsr173_api</artifactId>
> > > >             <version>1.0</version>
> > > >         </dependency>
> > > >         <dependency>
> > > >             <groupId>org.apache.myfaces.core</groupId>
> > > >             <artifactId>myfaces-api</artifactId>
> > > >             <version>1.1.5</version>
> > > >         </dependency>
> > > >         <dependency>
> > > >             <groupId>org.apache.myfaces.core</groupId>
> > > >             <artifactId>myfaces-impl</artifactId>
> > > >             <version>1.1.5</version>
> > > >         </dependency>
> > > >         <dependency>
> > > >             <groupId>org.apache.myfaces.tomahawk</groupId>
> > > >             <artifactId>tomahawk</artifactId>
> > > >             <version>1.1.6</version>
> > > >         </dependency>
> > > >         <dependency>
> > > >             <groupId>javax.servlet</groupId>
> > > >             <artifactId>servlet-api</artifactId>
> > > >             <version>2.4</version>
> > > >             <scope>provided</scope>
> > > >         </dependency>
> > > >         <dependency>
> > > >             <groupId>javax.servlet</groupId>
> > > >             <artifactId>jsp-api</artifactId>
> > > >             <version>2.0</version>
> > > >             <scope>provided</scope>
> > > >         </dependency>
> > > >         <dependency>
> > > >             <groupId>org.ajax4jsf</groupId>
> > > >             <artifactId>ajax4jsf</artifactId>
> > > >             <version>1.1.1</version>
> > > >         </dependency>
> > > >         <dependency>
> > > >             <groupId>org.richfaces</groupId>
> > > >             <artifactId>richfaces</artifactId>
> > > >             <version>3.0.1</version>
> > > >         </dependency>
> > > >         <dependency>
> > > >             <groupId>org.apache.poi</groupId>
> > > >             <artifactId>poi</artifactId>
> > > >             <version>3.0.1-FINAL</version>
> > > >         </dependency>
> > > >
> > > >
> > > >
> > > >         <!--
> > > >         <dependency>
> > > >             <groupId>org.apache.myfaces.trinidad</groupId>
> > > >             <artifactId>trinidad-api</artifactId>
> > > >             <version>1.0.2</version>
> > > >         </dependency>
> > > >         <dependency>
> > > >             <groupId>org.apache.myfaces.trinidad</groupId>
> > > >             <artifactId>trinidad-impl</artifactId>
> > > >             <version>1.0.2</version>
> > > >         </dependency>
> > > >
> > > >         <dependency>
> > > >             <groupId>org.ajax4jsf</groupId>
> > > >             <artifactId>a4j-trinidad</artifactId>
> > > >             <version>1.0</version>
> > > >         </dependency>
> > > >         -->
> > > >     </dependencies>
> > > > </project>
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: How to get Maven to include "persistence.xml" into a web app??

Posted by ben short <ja...@gmail.com>.
I think you can just create /src/main/webapp/META-INF and put it in there.

On 8/28/07, Julien Martin <ba...@gmail.com> wrote:
> Thanks Ben,
> Is there not a way to put it (persistence.xml) into meta-inf instead?
> Julien.
>
> 2007/8/28, ben short <ja...@gmail.com>:
> >
> > persistence.xml needs to be on the class path doesn't it?
> >
> > Create a directory src/main/java/resources and put it in there. When
> > maven packages up your war it will put all files in the resources
> > directory into your war file under the WEB-INF/classes directory.
> >
> > Hope this helps.
> >
> > Ben
> >
> >
> > On 8/28/07, Julien Martin <ba...@gmail.com> wrote:
> > > Hello all,
> > > How do I get Maven to include "persistence.xml" into a web app??
> > > Any clue welcome!
> > > Julien.
> > >
> > > Here is my POM:
> > >
> > >
> > > <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
> > > http://www.w3.org/2001/XMLSchema-instance"          xsi:schemaLocation="
> > > http://maven.apache.org/POM/4.0.0
> > http://maven.apache.org/maven-v4_0_0.xsd">
> > >     <modelVersion>4.0.0</modelVersion>
> > >     <groupId>com.calyonfinancial</groupId>
> > >     <artifactId>protide</artifactId>
> > >     <packaging>war</packaging>
> > >     <version>1.0-SNAPSHOT</version>
> > >     <name>ProtideWeb</name>
> > >     <build>
> > >         <sourceDirectory>src</sourceDirectory>
> > >         <outputDirectory>build</outputDirectory>
> > >         <finalName>ProtideWeb</finalName>
> > >         <plugins>
> > >             <plugin>
> > >                 <artifactId>maven-compiler-plugin</artifactId>
> > >                 <configuration>
> > >                     <source>1.5</source>
> > >                     <target>1.5</target>
> > >                 </configuration>
> > >             </plugin>
> > >             <plugin>
> > >                 <groupId>org.apache.maven.plugins</groupId>
> > >                 <artifactId>maven-war-plugin</artifactId>
> > >                 <version>2.0</version>
> > >                 <configuration>
> > >                     <warSourceDirectory>web</warSourceDirectory>
> > >                 </configuration>
> > >             </plugin>
> > >             <plugin>
> > >                 <groupId>org.codehaus.mojo</groupId>
> > >                 <artifactId>hibernate3-maven-plugin</artifactId>
> > >                 <version>2.0-alpha-2</version>
> > >             </plugin>
> > >         </plugins>
> > >     </build>
> > >     <dependencies>
> > >         <dependency>
> > >             <groupId>org.hibernate</groupId>
> > >             <artifactId>hibernate</artifactId>
> > >             <version>3.2.1.ga</version>
> > >         </dependency>
> > >         <dependency>
> > >             <groupId>org.hibernate</groupId>
> > >             <artifactId>hibernate-annotations</artifactId>
> > >             <version>3.2.1.ga</version>
> > >         </dependency>
> > >         <dependency>
> > >             <groupId>org.hibernate</groupId>
> > >             <artifactId>hibernate-entitymanager</artifactId>
> > >             <version>3.2.1.ga</version>
> > >         </dependency>
> > >         <dependency>
> > >             <groupId>org.hibernate</groupId>
> > >             <artifactId>hibernate-commons-annotations</artifactId>
> > >             <version>3.3.0.ga</version>
> > >         </dependency>
> > >         <dependency>
> > >             <groupId>org.hibernate</groupId>
> > >             <artifactId>hibernate-validator</artifactId>
> > >             <version>3.0.0.ga</version>
> > >         </dependency>
> > >         <dependency>
> > >             <groupId>javax.persistence</groupId>
> > >             <artifactId>persistence-api</artifactId>
> > >             <version>1.0</version>
> > >         </dependency>
> > >         <dependency>
> > >             <groupId>log4j</groupId>
> > >             <artifactId>log4j</artifactId>
> > >             <version>1.2.14</version>
> > >         </dependency>
> > >         <dependency>
> > >             <groupId>com.sun.xml.bind</groupId>
> > >             <artifactId>jaxb-impl</artifactId>
> > >             <version>2.0</version>
> > >         </dependency>
> > >         <dependency>
> > >             <groupId>com.sun.xml.bind</groupId>
> > >             <artifactId>jaxb-xjc</artifactId>
> > >             <version>2.0</version>
> > >         </dependency>
> > >         <dependency>
> > >             <groupId>javax.xml.bind</groupId>
> > >             <artifactId>jaxb-api</artifactId>
> > >             <version>2.0</version>
> > >         </dependency>
> > >         <!--
> > >         <dependency>
> > >             <groupId>org.apache.maven</groupId>
> > >             <artifactId>maven-project</artifactId>
> > >             <version>2.0.4</version>
> > >         </dependency>
> > >         <dependency>
> > >             <groupId>org.apache.maven</groupId>
> > >             <artifactId>maven-plugin-api</artifactId>
> > >             <version>2.0.4</version>
> > >         </dependency>
> > >         -->
> > >         <dependency>
> > >             <groupId>jdbc</groupId>
> > >             <artifactId>as400</artifactId>
> > >             <version>5.1.0.1</version>
> > >         </dependency>
> > >         <dependency>
> > >             <groupId>javax.xml.bind</groupId>
> > >             <artifactId>jsr173_api</artifactId>
> > >             <version>1.0</version>
> > >         </dependency>
> > >         <dependency>
> > >             <groupId>org.apache.myfaces.core</groupId>
> > >             <artifactId>myfaces-api</artifactId>
> > >             <version>1.1.5</version>
> > >         </dependency>
> > >         <dependency>
> > >             <groupId>org.apache.myfaces.core</groupId>
> > >             <artifactId>myfaces-impl</artifactId>
> > >             <version>1.1.5</version>
> > >         </dependency>
> > >         <dependency>
> > >             <groupId>org.apache.myfaces.tomahawk</groupId>
> > >             <artifactId>tomahawk</artifactId>
> > >             <version>1.1.6</version>
> > >         </dependency>
> > >         <dependency>
> > >             <groupId>javax.servlet</groupId>
> > >             <artifactId>servlet-api</artifactId>
> > >             <version>2.4</version>
> > >             <scope>provided</scope>
> > >         </dependency>
> > >         <dependency>
> > >             <groupId>javax.servlet</groupId>
> > >             <artifactId>jsp-api</artifactId>
> > >             <version>2.0</version>
> > >             <scope>provided</scope>
> > >         </dependency>
> > >         <dependency>
> > >             <groupId>org.ajax4jsf</groupId>
> > >             <artifactId>ajax4jsf</artifactId>
> > >             <version>1.1.1</version>
> > >         </dependency>
> > >         <dependency>
> > >             <groupId>org.richfaces</groupId>
> > >             <artifactId>richfaces</artifactId>
> > >             <version>3.0.1</version>
> > >         </dependency>
> > >         <dependency>
> > >             <groupId>org.apache.poi</groupId>
> > >             <artifactId>poi</artifactId>
> > >             <version>3.0.1-FINAL</version>
> > >         </dependency>
> > >
> > >
> > >
> > >         <!--
> > >         <dependency>
> > >             <groupId>org.apache.myfaces.trinidad</groupId>
> > >             <artifactId>trinidad-api</artifactId>
> > >             <version>1.0.2</version>
> > >         </dependency>
> > >         <dependency>
> > >             <groupId>org.apache.myfaces.trinidad</groupId>
> > >             <artifactId>trinidad-impl</artifactId>
> > >             <version>1.0.2</version>
> > >         </dependency>
> > >
> > >         <dependency>
> > >             <groupId>org.ajax4jsf</groupId>
> > >             <artifactId>a4j-trinidad</artifactId>
> > >             <version>1.0</version>
> > >         </dependency>
> > >         -->
> > >     </dependencies>
> > > </project>
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: How to get Maven to include "persistence.xml" into a web app??

Posted by Julien Martin <ba...@gmail.com>.
Thanks Ben,
Is there not a way to put it (persistence.xml) into meta-inf instead?
Julien.

2007/8/28, ben short <ja...@gmail.com>:
>
> persistence.xml needs to be on the class path doesn't it?
>
> Create a directory src/main/java/resources and put it in there. When
> maven packages up your war it will put all files in the resources
> directory into your war file under the WEB-INF/classes directory.
>
> Hope this helps.
>
> Ben
>
>
> On 8/28/07, Julien Martin <ba...@gmail.com> wrote:
> > Hello all,
> > How do I get Maven to include "persistence.xml" into a web app??
> > Any clue welcome!
> > Julien.
> >
> > Here is my POM:
> >
> >
> > <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
> > http://www.w3.org/2001/XMLSchema-instance"          xsi:schemaLocation="
> > http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd">
> >     <modelVersion>4.0.0</modelVersion>
> >     <groupId>com.calyonfinancial</groupId>
> >     <artifactId>protide</artifactId>
> >     <packaging>war</packaging>
> >     <version>1.0-SNAPSHOT</version>
> >     <name>ProtideWeb</name>
> >     <build>
> >         <sourceDirectory>src</sourceDirectory>
> >         <outputDirectory>build</outputDirectory>
> >         <finalName>ProtideWeb</finalName>
> >         <plugins>
> >             <plugin>
> >                 <artifactId>maven-compiler-plugin</artifactId>
> >                 <configuration>
> >                     <source>1.5</source>
> >                     <target>1.5</target>
> >                 </configuration>
> >             </plugin>
> >             <plugin>
> >                 <groupId>org.apache.maven.plugins</groupId>
> >                 <artifactId>maven-war-plugin</artifactId>
> >                 <version>2.0</version>
> >                 <configuration>
> >                     <warSourceDirectory>web</warSourceDirectory>
> >                 </configuration>
> >             </plugin>
> >             <plugin>
> >                 <groupId>org.codehaus.mojo</groupId>
> >                 <artifactId>hibernate3-maven-plugin</artifactId>
> >                 <version>2.0-alpha-2</version>
> >             </plugin>
> >         </plugins>
> >     </build>
> >     <dependencies>
> >         <dependency>
> >             <groupId>org.hibernate</groupId>
> >             <artifactId>hibernate</artifactId>
> >             <version>3.2.1.ga</version>
> >         </dependency>
> >         <dependency>
> >             <groupId>org.hibernate</groupId>
> >             <artifactId>hibernate-annotations</artifactId>
> >             <version>3.2.1.ga</version>
> >         </dependency>
> >         <dependency>
> >             <groupId>org.hibernate</groupId>
> >             <artifactId>hibernate-entitymanager</artifactId>
> >             <version>3.2.1.ga</version>
> >         </dependency>
> >         <dependency>
> >             <groupId>org.hibernate</groupId>
> >             <artifactId>hibernate-commons-annotations</artifactId>
> >             <version>3.3.0.ga</version>
> >         </dependency>
> >         <dependency>
> >             <groupId>org.hibernate</groupId>
> >             <artifactId>hibernate-validator</artifactId>
> >             <version>3.0.0.ga</version>
> >         </dependency>
> >         <dependency>
> >             <groupId>javax.persistence</groupId>
> >             <artifactId>persistence-api</artifactId>
> >             <version>1.0</version>
> >         </dependency>
> >         <dependency>
> >             <groupId>log4j</groupId>
> >             <artifactId>log4j</artifactId>
> >             <version>1.2.14</version>
> >         </dependency>
> >         <dependency>
> >             <groupId>com.sun.xml.bind</groupId>
> >             <artifactId>jaxb-impl</artifactId>
> >             <version>2.0</version>
> >         </dependency>
> >         <dependency>
> >             <groupId>com.sun.xml.bind</groupId>
> >             <artifactId>jaxb-xjc</artifactId>
> >             <version>2.0</version>
> >         </dependency>
> >         <dependency>
> >             <groupId>javax.xml.bind</groupId>
> >             <artifactId>jaxb-api</artifactId>
> >             <version>2.0</version>
> >         </dependency>
> >         <!--
> >         <dependency>
> >             <groupId>org.apache.maven</groupId>
> >             <artifactId>maven-project</artifactId>
> >             <version>2.0.4</version>
> >         </dependency>
> >         <dependency>
> >             <groupId>org.apache.maven</groupId>
> >             <artifactId>maven-plugin-api</artifactId>
> >             <version>2.0.4</version>
> >         </dependency>
> >         -->
> >         <dependency>
> >             <groupId>jdbc</groupId>
> >             <artifactId>as400</artifactId>
> >             <version>5.1.0.1</version>
> >         </dependency>
> >         <dependency>
> >             <groupId>javax.xml.bind</groupId>
> >             <artifactId>jsr173_api</artifactId>
> >             <version>1.0</version>
> >         </dependency>
> >         <dependency>
> >             <groupId>org.apache.myfaces.core</groupId>
> >             <artifactId>myfaces-api</artifactId>
> >             <version>1.1.5</version>
> >         </dependency>
> >         <dependency>
> >             <groupId>org.apache.myfaces.core</groupId>
> >             <artifactId>myfaces-impl</artifactId>
> >             <version>1.1.5</version>
> >         </dependency>
> >         <dependency>
> >             <groupId>org.apache.myfaces.tomahawk</groupId>
> >             <artifactId>tomahawk</artifactId>
> >             <version>1.1.6</version>
> >         </dependency>
> >         <dependency>
> >             <groupId>javax.servlet</groupId>
> >             <artifactId>servlet-api</artifactId>
> >             <version>2.4</version>
> >             <scope>provided</scope>
> >         </dependency>
> >         <dependency>
> >             <groupId>javax.servlet</groupId>
> >             <artifactId>jsp-api</artifactId>
> >             <version>2.0</version>
> >             <scope>provided</scope>
> >         </dependency>
> >         <dependency>
> >             <groupId>org.ajax4jsf</groupId>
> >             <artifactId>ajax4jsf</artifactId>
> >             <version>1.1.1</version>
> >         </dependency>
> >         <dependency>
> >             <groupId>org.richfaces</groupId>
> >             <artifactId>richfaces</artifactId>
> >             <version>3.0.1</version>
> >         </dependency>
> >         <dependency>
> >             <groupId>org.apache.poi</groupId>
> >             <artifactId>poi</artifactId>
> >             <version>3.0.1-FINAL</version>
> >         </dependency>
> >
> >
> >
> >         <!--
> >         <dependency>
> >             <groupId>org.apache.myfaces.trinidad</groupId>
> >             <artifactId>trinidad-api</artifactId>
> >             <version>1.0.2</version>
> >         </dependency>
> >         <dependency>
> >             <groupId>org.apache.myfaces.trinidad</groupId>
> >             <artifactId>trinidad-impl</artifactId>
> >             <version>1.0.2</version>
> >         </dependency>
> >
> >         <dependency>
> >             <groupId>org.ajax4jsf</groupId>
> >             <artifactId>a4j-trinidad</artifactId>
> >             <version>1.0</version>
> >         </dependency>
> >         -->
> >     </dependencies>
> > </project>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: How to get Maven to include "persistence.xml" into a web app??

Posted by ben short <ja...@gmail.com>.
persistence.xml needs to be on the class path doesn't it?

Create a directory src/main/java/resources and put it in there. When
maven packages up your war it will put all files in the resources
directory into your war file under the WEB-INF/classes directory.

Hope this helps.

Ben


On 8/28/07, Julien Martin <ba...@gmail.com> wrote:
> Hello all,
> How do I get Maven to include "persistence.xml" into a web app??
> Any clue welcome!
> Julien.
>
> Here is my POM:
>
>
> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance"          xsi:schemaLocation="
> http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
>     <modelVersion>4.0.0</modelVersion>
>     <groupId>com.calyonfinancial</groupId>
>     <artifactId>protide</artifactId>
>     <packaging>war</packaging>
>     <version>1.0-SNAPSHOT</version>
>     <name>ProtideWeb</name>
>     <build>
>         <sourceDirectory>src</sourceDirectory>
>         <outputDirectory>build</outputDirectory>
>         <finalName>ProtideWeb</finalName>
>         <plugins>
>             <plugin>
>                 <artifactId>maven-compiler-plugin</artifactId>
>                 <configuration>
>                     <source>1.5</source>
>                     <target>1.5</target>
>                 </configuration>
>             </plugin>
>             <plugin>
>                 <groupId>org.apache.maven.plugins</groupId>
>                 <artifactId>maven-war-plugin</artifactId>
>                 <version>2.0</version>
>                 <configuration>
>                     <warSourceDirectory>web</warSourceDirectory>
>                 </configuration>
>             </plugin>
>             <plugin>
>                 <groupId>org.codehaus.mojo</groupId>
>                 <artifactId>hibernate3-maven-plugin</artifactId>
>                 <version>2.0-alpha-2</version>
>             </plugin>
>         </plugins>
>     </build>
>     <dependencies>
>         <dependency>
>             <groupId>org.hibernate</groupId>
>             <artifactId>hibernate</artifactId>
>             <version>3.2.1.ga</version>
>         </dependency>
>         <dependency>
>             <groupId>org.hibernate</groupId>
>             <artifactId>hibernate-annotations</artifactId>
>             <version>3.2.1.ga</version>
>         </dependency>
>         <dependency>
>             <groupId>org.hibernate</groupId>
>             <artifactId>hibernate-entitymanager</artifactId>
>             <version>3.2.1.ga</version>
>         </dependency>
>         <dependency>
>             <groupId>org.hibernate</groupId>
>             <artifactId>hibernate-commons-annotations</artifactId>
>             <version>3.3.0.ga</version>
>         </dependency>
>         <dependency>
>             <groupId>org.hibernate</groupId>
>             <artifactId>hibernate-validator</artifactId>
>             <version>3.0.0.ga</version>
>         </dependency>
>         <dependency>
>             <groupId>javax.persistence</groupId>
>             <artifactId>persistence-api</artifactId>
>             <version>1.0</version>
>         </dependency>
>         <dependency>
>             <groupId>log4j</groupId>
>             <artifactId>log4j</artifactId>
>             <version>1.2.14</version>
>         </dependency>
>         <dependency>
>             <groupId>com.sun.xml.bind</groupId>
>             <artifactId>jaxb-impl</artifactId>
>             <version>2.0</version>
>         </dependency>
>         <dependency>
>             <groupId>com.sun.xml.bind</groupId>
>             <artifactId>jaxb-xjc</artifactId>
>             <version>2.0</version>
>         </dependency>
>         <dependency>
>             <groupId>javax.xml.bind</groupId>
>             <artifactId>jaxb-api</artifactId>
>             <version>2.0</version>
>         </dependency>
>         <!--
>         <dependency>
>             <groupId>org.apache.maven</groupId>
>             <artifactId>maven-project</artifactId>
>             <version>2.0.4</version>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.maven</groupId>
>             <artifactId>maven-plugin-api</artifactId>
>             <version>2.0.4</version>
>         </dependency>
>         -->
>         <dependency>
>             <groupId>jdbc</groupId>
>             <artifactId>as400</artifactId>
>             <version>5.1.0.1</version>
>         </dependency>
>         <dependency>
>             <groupId>javax.xml.bind</groupId>
>             <artifactId>jsr173_api</artifactId>
>             <version>1.0</version>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.myfaces.core</groupId>
>             <artifactId>myfaces-api</artifactId>
>             <version>1.1.5</version>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.myfaces.core</groupId>
>             <artifactId>myfaces-impl</artifactId>
>             <version>1.1.5</version>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.myfaces.tomahawk</groupId>
>             <artifactId>tomahawk</artifactId>
>             <version>1.1.6</version>
>         </dependency>
>         <dependency>
>             <groupId>javax.servlet</groupId>
>             <artifactId>servlet-api</artifactId>
>             <version>2.4</version>
>             <scope>provided</scope>
>         </dependency>
>         <dependency>
>             <groupId>javax.servlet</groupId>
>             <artifactId>jsp-api</artifactId>
>             <version>2.0</version>
>             <scope>provided</scope>
>         </dependency>
>         <dependency>
>             <groupId>org.ajax4jsf</groupId>
>             <artifactId>ajax4jsf</artifactId>
>             <version>1.1.1</version>
>         </dependency>
>         <dependency>
>             <groupId>org.richfaces</groupId>
>             <artifactId>richfaces</artifactId>
>             <version>3.0.1</version>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.poi</groupId>
>             <artifactId>poi</artifactId>
>             <version>3.0.1-FINAL</version>
>         </dependency>
>
>
>
>         <!--
>         <dependency>
>             <groupId>org.apache.myfaces.trinidad</groupId>
>             <artifactId>trinidad-api</artifactId>
>             <version>1.0.2</version>
>         </dependency>
>         <dependency>
>             <groupId>org.apache.myfaces.trinidad</groupId>
>             <artifactId>trinidad-impl</artifactId>
>             <version>1.0.2</version>
>         </dependency>
>
>         <dependency>
>             <groupId>org.ajax4jsf</groupId>
>             <artifactId>a4j-trinidad</artifactId>
>             <version>1.0</version>
>         </dependency>
>         -->
>     </dependencies>
> </project>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org