You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Mathias P.W Nilsson" <ma...@snyltarna.se> on 2007/08/16 17:50:43 UTC

hibernate3-maven-plugin not running

I try to get a db schema out of maven. Here is my configuration

<build>
  	<plugins>
  		<plugin>
  			<groupId>org.codehaus.mojo</groupId>
  			<artifactId>hibernate3-maven-plugin</artifactId>
  			<version>2.0-alpha-2</version>
  			<configuration>
				<components>
					<component>
						<name>hbm2ddl</name>
						<implementation>annotationconfiguration</implementation>
						
					</component>
					<component>
						<name>hbm2hbmxml</name>
						<outputDirectory>src/main/resources</outputDirectory>
					
					</component>
				</components>
				<componentProperties>
					<drop>true</drop>
					<create>true</create>
				
<configurationfile>src/main/resources/hibernate.cfg.xml</configurationfile>
						<outputfilename>schema.sql</outputfilename>
				</componentProperties>
  			</configuration>
  		</plugin>
  	</plugins>
  	<resources>
  		<resource>
  			<directory>src/main/resources</directory>
  			<filtering>true</filtering>
  		</resource>
  	</resources>
  </build>

this does not produce any result? When does this run and how can I run the
plugin?
-- 
View this message in context: http://www.nabble.com/hibernate3-maven-plugin-not-running-tf4280489s177.html#a12183982
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


Re: hibernate3-maven-plugin not running

Posted by Johann Reyes <an...@gmail.com>.
Also you can run manually the plugin like this:

mvn hibernate3:hbm2ddl

Regards

Johann Reyes

Re: hibernate3-maven-plugin not running

Posted by Johann Reyes <jr...@hiberforum.org>.
can you run this command and then send the output:

mvn -X hibernate3:hbm2ddl

Regards

Johann Reyes

Re: hibernate3-maven-plugin not running

Posted by ml...@planwerk6.de.
Am Donnerstag, 16. August 2007 19:56 schrieb Mathias P.W Nilsson:
> Thanks for you pation but it still doesn't work
>
> I get this for all my classes. I'm using annotations. Worked perfectly when
> I was using ant.
>

this is my pom snippte and it works with 
    mvn process-resources hibernate3:hbm2ddl
i am not using annotations but maybe it helps you in any way.

<plugin>
				<groupId>org.codehaus.mojo</groupId>
				<artifactId>hibernate3-maven-plugin</artifactId>
				<version>2.0-alpha-1</version>
				<dependencies>
					<dependency>
						<groupId>log4j</groupId>
						<artifactId>log4j</artifactId>
						<version>1.2.13</version>
					</dependency>
					<dependency>
						<groupId>postgresql</groupId>
						<artifactId>postgresql</artifactId>
						<version>8.2-504.jdbc3</version>
					</dependency>
				</dependencies>
				<configuration>
					<components>
						<component>
							<name>hbm2ddl</name>
							<implementation>configuration</implementation>
						</component>
						<component>
							<name>hbm2doc</name>
							<implementation>configuration</implementation>
						</component>
					</components>
					<componentProperties>
						<export>false</export>
						<update>false</update>
						<drop>false</drop>
						<create>true</create>
						<jdk5>true</jdk5>
						<format>true</format>
						<propertyfile>/target/classes/hibernate.properties</propertyfile>
						<outputfilename>schema.sql</outputfilename>
						<fileset>
							<include>**/*.hbm.xml</include>
						</fileset>
					</componentProperties>
				</configuration>
			</plugin>


kind regards,
janning


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


Re: hibernate3-maven-plugin not running

Posted by "Mathias P.W Nilsson" <ma...@snyltarna.se>.
Thanks for you pation but it still doesn't work

I get this for all my classes. I'm using annotations. Worked perfectly when
I was using ant.

org.hibernate.MappingException: Unable to load class declared as <mapping
class="se.digitalsupport.ftc.dto.Customer"/> in the configuration:
        at
org.hibernate.cfg.AnnotationConfiguration.parseMappingElement(AnnotationConfiguration.java:545)


-- 
View this message in context: http://www.nabble.com/hibernate3-maven-plugin-not-running-tf4280489s177.html#a12186381
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


Re: hibernate3-maven-plugin not running

Posted by "Mathias P.W Nilsson" <ma...@snyltarna.se>.
Thank you all!

It's working now! :)
-- 
View this message in context: http://www.nabble.com/hibernate3-maven-plugin-not-running-tf4280489s177.html#a12204851
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


Re: hibernate3-maven-plugin not running

Posted by Johann Reyes <jr...@hiberforum.org>.
Also the phase should be

process-classes

instead of

generate-sources

Your java classes need to be compiled first before they can be added
to the plugin to create the db schema

Regards

Johann Reyes

Re: hibernate3-maven-plugin not running

Posted by Johann Reyes <jr...@hiberforum.org>.
Mathis try this:

<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>hibernate3-maven-plugin</artifactId>
  <version>2.0-alpha-2</version>
  <configuration>
    <components>
      <component>
        <name>hbm2ddl</name>
        <implementation>annotationconfiguration</implementation>
      </component>
      <component>
        <name>hbm2hbmxml</name>
        <outputDirectory>src/main/resources</outputDirectory>
      </component>
    </components>
    <componentProperties>
      <drop>true</drop>
      <create>true</create>

<configurationfile>src/main/resources/hibernate.cfg.xml</configurationfile>
      <outputfilename>schema.sql</outputfilename>
    </componentProperties>
  </configuration>
  <executions>
    <execution>
      <phase>generate-sources</phase>
      <goals>
        <goal>hbm2ddl</goal>
      </goals>
    </execution>
  </executions>
</plugin>

Regards

Johann Reyes

Re: hibernate3-maven-plugin not running

Posted by Wayne Fay <wa...@gmail.com>.
The <executions> node goes inside <configuration> and outside of <components>.

Wayne

On 8/16/07, Mathias P.W Nilsson <ma...@snyltarna.se> wrote:
>
> I got
>
> "Failed to configure plugin parameters for:
> org.codehaus.mojo:hibernate3-maven-plugin:2.0-alpha-2"
>
> here are the pom.xml
>
> ....
> <build>
>        <plugins>
>                <plugin>
>                        <groupId>org.codehaus.mojo</groupId>
>                        <artifactId>hibernate3-maven-plugin</artifactId>
>                        <version>2.0-alpha-2</version>
>                        <configuration>
>                                <components>
>                                        <executions>
>                                                <execution>
>                                                        <phase>generate-sources</phase>
>                                                        <goals>
>                                                                <goal>hbm2ddl</goal>
>                                                        </goals>
>                                                </execution>
>                                        </executions>
>                                        <component>
>                                                <name>hbm2ddl</name>
>                                                <implementation>annotationconfiguration</implementation>
>                                        </component>
>                                        <component>
>                                                <name>hbm2hbmxml</name>
>                                                <outputDirectory>src/main/resources</outputDirectory>
>                                        </component>
>                                </components>
>                                <componentProperties>
>                                        <drop>true</drop>
>                                        <create>true</create>
>
> <configurationfile>src/main/resources/hibernate.cfg.xml</configurationfile>
>                                                <outputfilename>schema.sql</outputfilename>
>                                </componentProperties>
>                        </configuration>
>                </plugin>
>        </plugins>
>        <resources>
>                <resource>
>                        <directory>src/main/resources</directory>
>                        <filtering>true</filtering>
>                </resource>
>        </resources>
>  </build>
> ...
> --
> View this message in context: http://www.nabble.com/hibernate3-maven-plugin-not-running-tf4280489s177.html#a12186181
> 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
>
>

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


Re: hibernate3-maven-plugin not running

Posted by "Mathias P.W Nilsson" <ma...@snyltarna.se>.
I got 

"Failed to configure plugin parameters for:
org.codehaus.mojo:hibernate3-maven-plugin:2.0-alpha-2"

here are the pom.xml

....
<build>
  	<plugins>
  		<plugin>
  			<groupId>org.codehaus.mojo</groupId>
  			<artifactId>hibernate3-maven-plugin</artifactId>
  			<version>2.0-alpha-2</version>
  			<configuration>
				<components>
					<executions>
						<execution>
							<phase>generate-sources</phase>
							<goals>
								<goal>hbm2ddl</goal>
							</goals>
						</execution>
					</executions>
					<component>
						<name>hbm2ddl</name>
						<implementation>annotationconfiguration</implementation>
					</component>
					<component>
						<name>hbm2hbmxml</name>
						<outputDirectory>src/main/resources</outputDirectory>
					</component>
				</components>
				<componentProperties>
					<drop>true</drop>
					<create>true</create>
				
<configurationfile>src/main/resources/hibernate.cfg.xml</configurationfile>
						<outputfilename>schema.sql</outputfilename>
				</componentProperties>
  			</configuration>
  		</plugin>
  	</plugins>
  	<resources>
  		<resource>
  			<directory>src/main/resources</directory>
  			<filtering>true</filtering>
  		</resource>
  	</resources>
  </build>
...
-- 
View this message in context: http://www.nabble.com/hibernate3-maven-plugin-not-running-tf4280489s177.html#a12186181
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


Re: hibernate3-maven-plugin not running

Posted by Wayne Fay <wa...@gmail.com>.
Try "mvn hibernate3:hbm2ddl compile".

Wayne

On 8/16/07, Mathias P.W Nilsson <ma...@snyltarna.se> wrote:
>
> That didn't work.....
>
> I sat an execution and a goal but it didn't work.
> --
> View this message in context: http://www.nabble.com/hibernate3-maven-plugin-not-running-tf4280489s177.html#a12185558
> 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
>
>

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


Re: hibernate3-maven-plugin not running

Posted by "Mathias P.W Nilsson" <ma...@snyltarna.se>.
That didn't work..... 

I sat an execution and a goal but it didn't work.
-- 
View this message in context: http://www.nabble.com/hibernate3-maven-plugin-not-running-tf4280489s177.html#a12185558
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


Re: hibernate3-maven-plugin not running

Posted by Wayne Fay <wa...@gmail.com>.
You didn't attach the plugin to any goals/phases, so it doesn't know
when to run. Fortunately, this is covered in the documentation:
http://mojo.codehaus.org/maven-hibernate3/hibernate3-maven-plugin/examples/phase_embedding.html

Wayne

On 8/16/07, Mathias P.W Nilsson <ma...@snyltarna.se> wrote:
>
> I try to get a db schema out of maven. Here is my configuration
>
> <build>
>        <plugins>
>                <plugin>
>                        <groupId>org.codehaus.mojo</groupId>
>                        <artifactId>hibernate3-maven-plugin</artifactId>
>                        <version>2.0-alpha-2</version>
>                        <configuration>
>                                <components>
>                                        <component>
>                                                <name>hbm2ddl</name>
>                                                <implementation>annotationconfiguration</implementation>
>
>                                        </component>
>                                        <component>
>                                                <name>hbm2hbmxml</name>
>                                                <outputDirectory>src/main/resources</outputDirectory>
>
>                                        </component>
>                                </components>
>                                <componentProperties>
>                                        <drop>true</drop>
>                                        <create>true</create>
>
> <configurationfile>src/main/resources/hibernate.cfg.xml</configurationfile>
>                                                <outputfilename>schema.sql</outputfilename>
>                                </componentProperties>
>                        </configuration>
>                </plugin>
>        </plugins>
>        <resources>
>                <resource>
>                        <directory>src/main/resources</directory>
>                        <filtering>true</filtering>
>                </resource>
>        </resources>
>  </build>
>
> this does not produce any result? When does this run and how can I run the
> plugin?
> --
> View this message in context: http://www.nabble.com/hibernate3-maven-plugin-not-running-tf4280489s177.html#a12183982
> 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
>
>

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