For your question 2, I removed its executions section from my pom.xml and run it 
explicitly with "mvn -Pwhatever clean hibernate3:hbm2java".  I then manually 
move the generated files as needed.

           <plugin>
               <groupId>org.codehaus.mojo</groupId>

               <artifactId>hibernate3-maven-plugin</artifactId>

               <version>2.1</version>

               <configuration>
                   <components>
                       <component>
                           <!--
                           output goes to
                           target/hibernate3/generated-sources
                           -->
                           <name>hbm2java</name>
                           <implementation>jdbcconfiguration</implementation>
                       </component>
                   </components>

                   <componentProperties>
                       
<configurationfile>src/main/hbm/hibernate.cfg.xml</configurationfile>
                       
<revengfile>src/main/hbm/hibernate.reveng_${db.flavor}.xml</revengfile>

                       <!-- hbm2java -->
                       <jdk5>true</jdk5>
                       <ejb3>true</ejb3>
                   </componentProperties>
               </configuration>
           </plugin>


Andreas Rudolf wrote:
Hi all,

I use the hibernate3 plugin to generate the Java domain classes via
hbm2java.

Currently the plugin always generate everything even if there are no changes
on the hibernate mapping resource files. Q1: Is it possible to generate only those Java domain classes which depends
on a particulary hibernate mapping resource file which have changed and
leave all others unchanged?

Q2: And why is it necessary to define explicit the execution phase?

The plugin logging is quite verbose. I see a lot of INFO Logmessages ( See
below ) .
Q3: Is it possible to disable or at least to reduce the amount of messages?


------------------------------snipp
----------------------------------------------------------
[INFO] Preparing hibernate3:hbm2java
[WARNING] Removing: hbm2java from forked lifecycle, to prevent recursive
invocation.
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[WARNING] POM for 'org.hibernate:jtidy:pom:r8-20060801:runtime' is invalid.
It will be ignored for artifact resolution. Reason: Parse error reading POM.
Re
\t\t\t<license>... @12:13)  for project org.hibernate:jtidy at
c:\dev\.m2\repository\org\hibernate\jtidy\r8-20060801\jtidy-r8-20060801.pom
[INFO] [hibernate3:hbm2java {execution: default}]
[INFO] using annotationconfiguration task.
[INFO] Configuration XML file loaded:
file:/c:/dev/mydev/klavirant/src/main/resources/hibernate.cfg.xml
13:37:16,694  INFO org.hibernate.cfg.annotations.Version - Hibernate
Annotations 3.4.0.GA
13:37:16,709  INFO org.hibernate.cfg.Environment - Hibernate 3.3.1.GA
13:37:16,725  INFO org.hibernate.cfg.Environment - hibernate.properties not
found
13:37:16,725  INFO org.hibernate.cfg.Environment - Bytecode provider name :
javassist
13:37:16,725  INFO org.hibernate.cfg.Environment - using JDK 1.4
java.sql.Timestamp handling
13:37:16,772  INFO org.hibernate.annotations.common.Version - Hibernate
Commons Annotations 3.1.0.GA
[INFO] Configuration XML file loaded:
file:/c:/dev/mydev/klavirant/src/main/resources/hibernate.cfg.xml
13:37:16,787  INFO org.hibernate.cfg.Configuration - configuring from url:
file:/c:/dev/mydev/klavirant/src/main/resources/hibernate.cfg.xml
13:37:16,897  INFO org.hibernate.cfg.Configuration - Reading mappings from
resource : User.hbm.xml
13:37:17,006  INFO org.hibernate.cfg.Configuration - Configured
SessionFactory: sessionFactory
[INFO] No hibernate properties file loaded.
13:37:17,053  INFO org.hibernate.cfg.HbmBinder - Mapping class:
de.carifin.klavirant.domain.User -> USER
13:37:17,069  INFO org.hibernate.cfg.AnnotationConfiguration - Hibernate
Validator not found: ignoring

------------------------------snipp
----------------------------------------------------------

I use the following plugin configuration:

                        <plugin>
                                <groupId>org.codehaus.mojo</groupId>
                                <artifactId>hibernate3-maven-plugin</artifactId>
                                <version>2.2</version>
                                <executions>
                                        <execution>
                                                <phase>generate-sources</phase>
                                                <goals>
                                                        <goal>hbm2java</goal>
                                                </goals>
                                        </execution>
                                </executions>
                                <configuration>
                                        <components>
                                                <component>
                                                        <name>hbm2java</name>
                                                </component>
                                        </components>
                                        <componentProperties>
                                                <drop>true</drop>
                                                <jdk5>true</jdk5>
                                        
<configurationfile>/src/main/resources/hibernate.cfg.xml</configurationfile>
                                        </componentProperties>
                                </configuration>
                        </plugin>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email


Reply via email to