You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Robert Langridge <La...@cpw.co.uk> on 2006/12/01 11:27:03 UTC

Maven2 & Hibernate.

 
Hi,

I'm fairly new to maven and I have the task of creating an automated
build for one of our hibernate projects. I have written a pom that
compiles all my source and jar's it up. However when it compiles it does
not copy across the .xml files of my hibernate entities or any of the
.properties files. I have used the <resources> tag to include the
hibernate.cfg.xml that sits in the base of the source directory, but the
rest of the entity xml files live in a package structure. Any ideas? I
have tried the following:

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
		  <includes>
			<include>**/*.xml</include>
			<include>**/*.properties</include>		
		  </includes>			
        </configuration>
      </plugin>

When I have this <includes> tag it doesn't include the xml and props
files and also does not compile any of my source code. Is this a bug? Or
am I mis-using this tag?

Cheers!

Rob Langridge 
Analyst Programmer


This communication together with any attachments transmitted with it ("this E-Mail") is intended only for the use of the addressee and may contain information which is privileged and confidential.  If the reader of this E-Mail is not the intended recipient or the employee or agent responsible for delivering it to the intended recipient you are hereby notified that any use, dissemination, forwarding, printing or copying of this E-Mail is strictly prohibited.  Addressees should check this E-mail for viruses.  The Company makes no representations as regards the absence of viruses in this E-Mail.  If you have received this E-Mail in error please notify our IT Service Desk immediately by e-mail at postmaster@cpw.co.uk  Please then immediately delete, erase or otherwise destroy this E-Mail and any copies of it.

Any opinions expressed in this E-Mail are those of the author and do not necessarily constitute the views of the Company.  Nothing in this E-Mail shall bind the Company in any contract or obligation.

For the purposes of this E-Mail "the Company" means The Carphone Warehouse Group Plc and/or any of its subsidiaries.

Please feel free to visit our website:  http:// www.carphonewarehouse.com or http://www.phonehouse.com

The Carphone Warehouse Group Plc (Registered in England No. 3253714) 1 Portal Way, London W3 6RS


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


Re: Maven2 & Hibernate.

Posted by Tom Huybrechts <to...@gmail.com>.
Create a src/main/resources directory and put all resources that you
want in your jar into that directory (with the right package
structure). No need to configure anything.

Tom

On 12/1/06, Robert Langridge <La...@cpw.co.uk> wrote:
>
> Hi,
>
> I'm fairly new to maven and I have the task of creating an automated
> build for one of our hibernate projects. I have written a pom that
> compiles all my source and jar's it up. However when it compiles it does
> not copy across the .xml files of my hibernate entities or any of the
> .properties files. I have used the <resources> tag to include the
> hibernate.cfg.xml that sits in the base of the source directory, but the
> rest of the entity xml files live in a package structure. Any ideas? I
> have tried the following:
>
>       <plugin>
>         <groupId>org.apache.maven.plugins</groupId>
>         <artifactId>maven-compiler-plugin</artifactId>
>         <configuration>
>                   <includes>
>                         <include>**/*.xml</include>
>                         <include>**/*.properties</include>
>                   </includes>
>         </configuration>
>       </plugin>
>
> When I have this <includes> tag it doesn't include the xml and props
> files and also does not compile any of my source code. Is this a bug? Or
> am I mis-using this tag?
>
> Cheers!
>
> Rob Langridge
> Analyst Programmer
>
>
> This communication together with any attachments transmitted with it ("this E-Mail") is intended only for the use of the addressee and may contain information which is privileged and confidential.  If the reader of this E-Mail is not the intended recipient or the employee or agent responsible for delivering it to the intended recipient you are hereby notified that any use, dissemination, forwarding, printing or copying of this E-Mail is strictly prohibited.  Addressees should check this E-mail for viruses.  The Company makes no representations as regards the absence of viruses in this E-Mail.  If you have received this E-Mail in error please notify our IT Service Desk immediately by e-mail at postmaster@cpw.co.uk  Please then immediately delete, erase or otherwise destroy this E-Mail and any copies of it.
>
> Any opinions expressed in this E-Mail are those of the author and do not necessarily constitute the views of the Company.  Nothing in this E-Mail shall bind the Company in any contract or obligation.
>
> For the purposes of this E-Mail "the Company" means The Carphone Warehouse Group Plc and/or any of its subsidiaries.
>
> Please feel free to visit our website:  http:// www.carphonewarehouse.com or http://www.phonehouse.com
>
> The Carphone Warehouse Group Plc (Registered in England No. 3253714) 1 Portal Way, London W3 6RS
>
>
> ---------------------------------------------------------------------
> 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


Antwort: Re: Re: m2eclipse plugin

Posted by Br...@gi-de.com.
Hello Marco,

thans for your hints!

So I understand that there could be an issue with the plugin and the
callisto distri.

This is what I use. The steps that I did were just downloading the callisto
distri and then did the eclipse software upgrade and pointed to

http://m2eclipse.codehaus.org

which installed the plugin.


I will go back to just core eclipse 3.1 and look if it works there.

thanks
Brigitte



"Marco Mistroni" <mm...@gmail.com> schrieb am 01.12.2006 15:06:04:

> hello brigitte,
>  try this link and see if it can help
>
> http://blogs.unixage.com/blojsom/blog/adam.kruszewski/eclipse/?
>
permalink=Maven2-Eclipse-plugin-with-latest-WTP-from-callisto-update-site.html

>
>
> On 12/1/06, Marco Mistroni <mm...@gmail.com> wrote:
> >
> > Hello,
> >
> >   can you tell steps you made to get to the point of using eclipse with
> > Maven?
> > there's a link on the web (guide to eclipse)... i assume you have
followed
> > it....
> >
> > if you find no help before i get home (7 PM UK)  i'll send you my
project
> > / pom etc and we can take it from there.. ok?
> >
> > but if you follow simple steps in the maven2 guide to eclipse (dont
have
> > URL , p ls google it) i m sure you will get on track...
> >
> > hth
> >  marco
> >
> >


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


Re: Re: m2eclipse plugin

Posted by Marco Mistroni <mm...@gmail.com>.
hello brigitte,
 try this link and see if it can help

http://blogs.unixage.com/blojsom/blog/adam.kruszewski/eclipse/?permalink=Maven2-Eclipse-plugin-with-latest-WTP-from-callisto-update-site.html


On 12/1/06, Marco Mistroni <mm...@gmail.com> wrote:
>
> Hello,
>
>   can you tell steps you made to get to the point of using eclipse with
> Maven?
> there's a link on the web (guide to eclipse)... i assume you have followed
> it....
>
> if you find no help before i get home (7 PM UK)  i'll send you my project
> / pom etc and we can take it from there.. ok?
>
> but if you follow simple steps in the maven2 guide to eclipse (dont have
> URL , p ls google it) i m sure you will get on track...
>
> hth
>  marco
>
>

Re: Re: m2eclipse plugin

Posted by Marco Mistroni <mm...@gmail.com>.
Hello,

  can you tell steps you made to get to the point of using eclipse with
Maven?
there's a link on the web (guide to eclipse)... i assume you have followed
it....

if you find no help before i get home (7 PM UK)  i'll send you my project /
pom etc and we can take it from there.. ok?

but if you follow simple steps in the maven2 guide to eclipse (dont have URL
, p ls google it) i m sure you will get on track...

hth
 marco

Antwort: Re: m2eclipse plugin

Posted by Br...@gi-de.com.
When selecting the compile goal, the console says:
...
[INFO] resources:resources
[INFO] Using default encoding to copy filtered resources.
[INFO] compiler:compile
Compiling 2 source files to D:\my\target\directory
[ERROR] mojo-execute : compiler:compile
Diagnosis: Compilation failure
FATAL ERROR: Error executing Maven for a project
[ERROR] project-execute : my.module.mymodule:jar:1.0-SNAPSHOT (
task-segment: [compile] )
Diagnosis: Compilation failure
FATAL ERROR: Error executing Maven for a project
org.apache.maven.BuildFailureException: Compilation failure
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
DefaultLifecycleExecutor.java:555)
      at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(
DefaultLifecycleExecutor.java:475)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(
DefaultLifecycleExecutor.java:454)
      at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(
DefaultLifecycleExecutor.java:306)
      at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
DefaultLifecycleExecutor.java:273)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(
DefaultLifecycleExecutor.java:140)
      at org.apache.maven.embedder.MavenEmbedder.execute(
MavenEmbedder.java:441)
      at org.apache.maven.embedder.MavenEmbedder.execute(
MavenEmbedder.java:382)
      at org.maven.ide.eclipse.Maven2Executor.main(Maven2Executor.java:68)
Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation
failure
      at org.apache.maven.plugin.AbstractCompilerMojo.execute(
AbstractCompilerMojo.java:505)
      at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:111
)
      at org.apache.maven.plugin.DefaultPluginManager.executeMojo(
DefaultPluginManager.java:412)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
DefaultLifecycleExecutor.java:534)
      ... 8 more



thanks in advance
Brigitte






"Marco Mistroni" <mm...@gmail.com> schrieb am 01.12.2006 13:53:20:

> Hello..
>  works fine for me... what's the error you are receiving?
>
> regards
>  marco
>
> On 12/1/06, Brigitte.Ilsanker@gi-de.com <Br...@gi-de.com>
wrote:
> >
> > Is there anyone there in the universer who is (successfully) using
eclipse
> > 3.x and the m2eclipse plugin even for later goals like package,
install,
> > .... ???
> >
> > I tryed to use it in the following way: select the pom.xml in the
package
> > explorer then in context menu "run as ...", then "Maven build..." .
Early
> > goals work well, like generate sources or process resources. From
> > "compile"
> > on it doesn't work any more. But: On command line it works fine.
> >
> > cheers
> > Brigitte
> >
> >
> > ---------------------------------------------------------------------
> > 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: m2eclipse plugin

Posted by Marco Mistroni <mm...@gmail.com>.
Hello..
 works fine for me... what's the error you are receiving?

regards
 marco

On 12/1/06, Brigitte.Ilsanker@gi-de.com <Br...@gi-de.com> wrote:
>
> Is there anyone there in the universer who is (successfully) using eclipse
> 3.x and the m2eclipse plugin even for later goals like package, install,
> .... ???
>
> I tryed to use it in the following way: select the pom.xml in the package
> explorer then in context menu "run as ...", then "Maven build..." . Early
> goals work well, like generate sources or process resources. From
> "compile"
> on it doesn't work any more. But: On command line it works fine.
>
> cheers
> Brigitte
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: m2eclipse plugin

Posted by Achim <ac...@freenet-ag.de>.


Brigitte.Ilsanker wrote:
> 
> Is there anyone there in the universer who is (successfully) using eclipse
> 3.x and the m2eclipse plugin even for later goals like package, install,
> .... ???
> 
> I tryed to use it in the following way: select the pom.xml in the package
> explorer then in context menu "run as ...", then "Maven build..." . Early
> goals work well, like generate sources or process resources. From
> "compile"
> on it doesn't work any more. But: On command line it works fine.
> 

Hi,

you are not alone. I just tried it myself and the build hangs while
executing a xdoclet task in the generate-sources phase.
I am using eclipse 3.2.1 M20060921-0945 and m2eclipse 0.0.9.

Best regards
Achim
-- 
View this message in context: http://www.nabble.com/Maven2---Hibernate.-tf2737222s177.html#a7637493
Sent from the Maven - Users mailing list archive at Nabble.com.


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


m2eclipse plugin

Posted by Br...@gi-de.com.
Is there anyone there in the universer who is (successfully) using eclipse
3.x and the m2eclipse plugin even for later goals like package, install,
.... ???

I tryed to use it in the following way: select the pom.xml in the package
explorer then in context menu "run as ...", then "Maven build..." . Early
goals work well, like generate sources or process resources. From "compile"
on it doesn't work any more. But: On command line it works fine.

cheers
Brigitte


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


Re: Maven2 & Hibernate

Posted by Marco Mistroni <mm...@gmail.com>.
Hi,
 one idea might be to putyour hbm files in src\main\resources directory
every file in that directory will go automatically in your jar

hth
 marco

On 12/1/06, Gianfranco Oldani <gf...@hotmail.com> wrote:
>
> Hi Rob,
> For a web application for example you can put the xml configuration files
> under the WEB-INF directory. For example my hibernate.cfg.xml is under
> WEB-INF and for the .hbm.xml I have create a separated directory under
> WEB-INF called hibernate_map.
>
> Hope it helps
>
> Regards
>
> Gianfranco OLDANI
>
>
>
> ----Original Message Follows----
> From: "Robert Langridge" <La...@cpw.co.uk>
> Reply-To: "Maven Users List" <us...@maven.apache.org>
> To: "Maven Users List" <us...@maven.apache.org>
> Subject: Maven2 & Hibernate.
> Date: Fri, 1 Dec 2006 10:27:03 -0000
>
>
> Hi,
>
> I'm fairly new to maven and I have the task of creating an automated
> build for one of our hibernate projects. I have written a pom that
> compiles all my source and jar's it up. However when it compiles it does
> not copy across the .xml files of my hibernate entities or any of the
> ..properties files. I have used the <resources> tag to include the
> hibernate.cfg.xml that sits in the base of the source directory, but the
> rest of the entity xml files live in a package structure. Any ideas? I
> have tried the following:
>
>        <plugin>
>          <groupId>org.apache.maven.plugins</groupId>
>          <artifactId>maven-compiler-plugin</artifactId>
>          <configuration>
>                   <includes>
>                         <include>**/*.xml</include>
>                         <include>**/*.properties</include>
>                   </includes>
>          </configuration>
>        </plugin>
>
> When I have this <includes> tag it doesn't include the xml and props
> files and also does not compile any of my source code. Is this a bug? Or
> am I mis-using this tag?
>
> Cheers!
>
> Rob Langridge
> Analyst Programmer
>
>
> This communication together with any attachments transmitted with it
> ("this
> E-Mail") is intended only for the use of the addressee and may contain
> information which is privileged and confidential.  If the reader of this
> E-Mail is not the intended recipient or the employee or agent responsible
> for delivering it to the intended recipient you are hereby notified that
> any
> use, dissemination, forwarding, printing or copying of this E-Mail is
> strictly prohibited.  Addressees should check this E-mail for
> viruses.  The
> Company makes no representations as regards the absence of viruses in this
> E-Mail.  If you have received this E-Mail in error please notify our IT
> Service Desk immediately by e-mail at postmaster@cpw.co.uk  Please then
> immediately delete, erase or otherwise destroy this E-Mail and any copies
> of
> it.
>
> Any opinions expressed in this E-Mail are those of the author and do not
> necessarily constitute the views of the Company.  Nothing in this E-Mail
> shall bind the Company in any contract or obligation.
>
> For the purposes of this E-Mail "the Company" means The Carphone Warehouse
> Group Plc and/or any of its subsidiaries.
>
> Please feel free to visit our website:  http:// www.carphonewarehouse.comor
> http://www.phonehouse.com
>
> The Carphone Warehouse Group Plc (Registered in England No. 3253714) 1
> Portal Way, London W3 6RS
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
> _________________________________________________________________
> Faites de MSN Search votre page d'accueil: Toutes les réponses en un clic!
> http://search.msn.ch/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

RE: Maven2 & Hibernate.

Posted by Gianfranco Oldani <gf...@hotmail.com>.
Hi Rob,
For a web application for example you can put the xml configuration files 
under the WEB-INF directory. For example my hibernate.cfg.xml is under 
WEB-INF and for the .hbm.xml I have create a separated directory under 
WEB-INF called hibernate_map.

Hope it helps

Regards

Gianfranco OLDANI



----Original Message Follows----
From: "Robert Langridge" <La...@cpw.co.uk>
Reply-To: "Maven Users List" <us...@maven.apache.org>
To: "Maven Users List" <us...@maven.apache.org>
Subject: Maven2 & Hibernate.
Date: Fri, 1 Dec 2006 10:27:03 -0000


Hi,

I'm fairly new to maven and I have the task of creating an automated
build for one of our hibernate projects. I have written a pom that
compiles all my source and jar's it up. However when it compiles it does
not copy across the .xml files of my hibernate entities or any of the
..properties files. I have used the <resources> tag to include the
hibernate.cfg.xml that sits in the base of the source directory, but the
rest of the entity xml files live in a package structure. Any ideas? I
have tried the following:

       <plugin>
         <groupId>org.apache.maven.plugins</groupId>
         <artifactId>maven-compiler-plugin</artifactId>
         <configuration>
		  <includes>
			<include>**/*.xml</include>
			<include>**/*.properties</include>
		  </includes>
         </configuration>
       </plugin>

When I have this <includes> tag it doesn't include the xml and props
files and also does not compile any of my source code. Is this a bug? Or
am I mis-using this tag?

Cheers!

Rob Langridge
Analyst Programmer


This communication together with any attachments transmitted with it ("this 
E-Mail") is intended only for the use of the addressee and may contain 
information which is privileged and confidential.  If the reader of this 
E-Mail is not the intended recipient or the employee or agent responsible 
for delivering it to the intended recipient you are hereby notified that any 
use, dissemination, forwarding, printing or copying of this E-Mail is 
strictly prohibited.  Addressees should check this E-mail for viruses.  The 
Company makes no representations as regards the absence of viruses in this 
E-Mail.  If you have received this E-Mail in error please notify our IT 
Service Desk immediately by e-mail at postmaster@cpw.co.uk  Please then 
immediately delete, erase or otherwise destroy this E-Mail and any copies of 
it.

Any opinions expressed in this E-Mail are those of the author and do not 
necessarily constitute the views of the Company.  Nothing in this E-Mail 
shall bind the Company in any contract or obligation.

For the purposes of this E-Mail "the Company" means The Carphone Warehouse 
Group Plc and/or any of its subsidiaries.

Please feel free to visit our website:  http:// www.carphonewarehouse.com or 
http://www.phonehouse.com

The Carphone Warehouse Group Plc (Registered in England No. 3253714) 1 
Portal Way, London W3 6RS


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

_________________________________________________________________
Faites de MSN Search votre page d'accueil: Toutes les réponses en un clic! 
http://search.msn.ch/


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