The current version 1.03-Beta of the maven dbunit plugin doesn’t allow multiple source files within the same execution.
The easiest way to handle this is by using multiple execution blocks that all get activated on the same phase.
The current version 1.03-Beta of the maven dbunit plugin doesn’t allow multiple source files within the same execution.
The easiest way to handle this is by using multiple execution blocks that all get activated on the same phase.
We use Sonar to handle code metrics for our projects. Recently, we upgraded our stack to the latest and greatest of Spring, Spring MVC and all things Hibernate. We are using hibernate annotations to create our database schema and dbunit to populate our test data. We run the sonar plugin (maven) nightly to provide metrics.
After getting our annotations all happy and working properly, our sonar plugin started to fail.
Cobertura: Loaded information on 257 classes.
Instrumenting 257 files to /myproject/target/generated-classes/cobertura
Cobertura: Saved information on 257 classes.
Instrument time: 2083ms
17:47:14,153 INFO org.hibernate.cfg.annotations.Version - Hibernate Annotations 3.4.0.GA
17:47:14,160 INFO org.hibernate.cfg.Environment - Hibernate 3.3.1.GA
17:47:14,163 INFO org.hibernate.cfg.Environment - hibernate.properties not found
17:47:14,165 INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
17:47:14,166 INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
17:47:14,202 INFO org.hibernate.annotations.common.Version - Hibernate Commons Annotations 3.1.0.GA
Configuration XML file loaded: file:/myproject/src/main/resources/hibernate.cfg.xml
17:47:14,203 INFO org.hibernate.cfg.Configuration - configuring from url: file:/myproject/src/main/resources/hibernate.cfg.xml
BUILD ERROR
Can not execute Sonar
Embedded error: Unable to execute maven plugin
myproject.domain.Address
I found this link which cleared up the entire thing.
I needed to add a cobertura dependency to the hibernate plugin in my pom.xml.
I also realized that a new version of Sonar came available last week. I upgraded!
We ran into a couple of problems using the maven dbunit plugin. We have used it on several projects before, but always with MySQL.
Some things to look out for.