Rob,
Many thanks for this :)
Rob van Oostrum-2 wrote:
>
> add this to your pom.xml (for a modular archetype use the pom in the
> core module):
>
> <profiles>
> <profile>
> <id>test</id>
> <activation>
> <property>
> <name>!nodb</name>
> </property>
> </activation>
> <build>
> <plugins>
> </plugins>
> </build>
> </profile>
> </profiles>
>
> and cut/paste the hibernate3-maven-plugin and dbunit-maven-plugin
> <plugin> elements into the <plugins> element of the profile.
>
> This way, the profile is active by default. When you want to run the
> cobertura stuff, pass -Dnodb and it'll skip the hibernate/dbunit
> steps. I don't think you really need to move the dbunit stuff but
> that's what I ended up doing, not exactly sure why since I haven't
> touched this particular project in a little while.
>
> R.
>
> On 4/6/07, sarat.pediredla <[EMAIL PROTECTED]> wrote:
>>
>> Rob,
>>
>> I am not too clued into maven but how do I do this?
>>
>>
>> Rob van Oostrum-2 wrote:
>> >
>> > I worked around this by adding a profile to the pom and move the
>> > hibernate3 and dbunit plugins into it. The profile deactivates when I
>> > pass -Dnodb. So whenever I want to run the cobertura stuff I make it
>> > skip the hibernate stuff.
>> >
>> > R.
>> >
>> > On 4/5/07, sarat.pediredla <[EMAIL PROTECTED]> wrote:
>> >>
>> >> I am facing this same exact problem. Do I have to add a dependancy to
>> my
>> >> own
>> >> war in the pom.xml?
>> >>
>> >> hibernate3 keeps copping out with the following error
>> >>
>> >> [INFO] Instrumentation was successful.
>> >> [INFO] [resources:testResources]
>> >> [INFO] Using default encoding to copy filtered resources.
>> >> [INFO] Preparing hibernate3:hbm2ddl
>> >> [WARNING] Removing: hbm2ddl from forked lifecycle, to prevent
>> recursive
>> >> invocation.
>> >> [INFO] [warpath:add-classes {execution: default}]
>> >> [INFO] [native2ascii:native2ascii {execution: native2ascii-utf8}]
>> >> [INFO] [native2ascii:native2ascii {execution: native2ascii-8859_1}]
>> >> [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.
>> >> Reason: TEXT must be immediately followed by END_TAG and not START_TAG
>> >> (position: START_TAG seen ...<licenses>\n\t\t\t<license>... @12:13)
>> >> [WARNING] POM for 'org.hibernate:jtidy:pom:r8-20060801:runtime' is
>> >> invalid.
>> >> It will be ignored for artifact resolution. Reason: Parse error
>> reading
>> >> POM.
>> >> Reason: TEXT must be immediately followed by END_TAG and not START_TAG
>> >> (position: START_TAG seen ...<licenses>\n\t\t\t<license>... @12:13)
>> >> [INFO] [hibernate3:hbm2ddl {execution: default}]
>> >> [INFO] Configuration XML file loaded:
>> >> C:\Users\Sarat\workspace\workpad\src\main\resources\hibernate.cfg.xml
>> >> [INFO] Configuration XML file loaded:
>> >> C:\Users\Sarat\workspace\workpad\src\main\resources\hibernate.cfg.xml
>> >> [INFO]
>> >>
>> ------------------------------------------------------------------------
>> >> [ERROR] FATAL ERROR
>> >> [INFO]
>> >>
>> ------------------------------------------------------------------------
>> >> [INFO] Unable to load class declared as <mapping
>> >> class="com.hedgehoglab.workpad.model.TaskCategory"/> in the
>> >> configuration:
>> >> [INFO]
>> >>
>> ------------------------------------------------------------------------
>> >> [INFO] Trace
>> >> org.hibernate.MappingException: Unable to load class declared as
>> <mapping
>> >> class="com.hedgehoglab.workpad.model.TaskCategory"/> in the
>> >> configuration:
>> >> at
>> >>
>> org.hibernate.cfg.AnnotationConfiguration.parseMappingElement(AnnotationConfiguration.java:545)
>> >> at
>> >>
>> org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1479)
>> >> at
>> >> org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1458)
>> >>
>> >>
>> >> mraible wrote:
>> >> >
>> >> > Sorry, I'm out of answers - you know as much as I do at this point.
>> >> >
>> >> > On 3/6/07, Rob van Oostrum <[EMAIL PROTECTED]> wrote:
>> >> >> Just tried it. No luck. Same error.
>> >> >>
>> >> >> On 3/6/07, Matt Raible <[EMAIL PROTECTED]> wrote:
>> >> >> > I believe I received an e-mail off-list where someone said
>> reverting
>> >> >> > to version 2.0 of the cobertura plugin fixed there problem.
>> >> >> >
>> >> >> > Matt
>> >> >> >
>> >> >> > On 3/6/07, Rob van Oostrum <[EMAIL PROTECTED]> wrote:
>> >> >> > > I get this error running 'mvn site' on my projects:
>> >> >> > >
>> >> >> > > [INFO] Instrumentation was successful.
>> >> >> > > [INFO] [resources:testResources]
>> >> >> > > [INFO] Using default encoding to copy filtered resources.
>> >> >> > > [INFO] [compiler:testCompile]
>> >> >> > > [INFO] Nothing to compile - all classes are up to date
>> >> >> > > [INFO] Preparing hibernate3:hbm2ddl
>> >> >> > > [WARNING] Removing: hbm2ddl from forked lifecycle, to prevent
>> >> >> > > recursive invocation.
>> >> >> > > [INFO] [resources:resources]
>> >> >> > > [INFO] Using default encoding to copy filtered resources.
>> >> >> > > [INFO] [hibernate3:hbm2ddl {execution: default}]
>> >> >> > > [INFO] Configuration XML file loaded:
>> >> >> > >
>> >> >>
>> >>
>> /Users/rob/Documents/workspace/project/core/src/main/resources/hibernate.cfg.xml
>> >> >> > > [INFO] Configuration XML file loaded:
>> >> >> > >
>> >> >>
>> >>
>> /Users/rob/Documents/workspace/project/core/src/main/resources/hibernate.cfg.xml
>> >> >> > > [INFO]
>> >> >>
>> >>
>> ------------------------------------------------------------------------
>> >> >> > > [ERROR] FATAL ERROR
>> >> >> > > [INFO]
>> >> >>
>> >>
>> ------------------------------------------------------------------------
>> >> >> > > [INFO] Unable to load class declared as <mapping
>> class="foo.Bar"/>
>> >> in
>> >> >> > > the configuration:
>> >> >> > > [INFO]
>> >> >>
>> >>
>> ------------------------------------------------------------------------
>> >> >> > > [INFO] Trace
>> >> >> > > org.hibernate.MappingException: Unable to load class declared
>> as
>> >> >> > > <mapping class="foo.Bar"/> in the configuration:
>> >> >> > > at
>> >> >>
>> >>
>> org.hibernate.cfg.AnnotationConfiguration.parseMappingElement(AnnotationConfiguration.java:545)
>> >> >> > > at
>> >> >>
>> >>
>> org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1479)
>> >> >> > >
>> >> >> > > (etc, etc)
>> >> >> > >
>> >> >> > > I can reproduce this on both projects I'm currently working on.
>> >> One
>> >> >> > > that I hadn't looked at for a while and is still on Appfuse
>> >> 2.0-m2,
>> >> >> > > and my main project right now which is using 2.0-m4-SNAPSHOT.
>> In
>> >> both
>> >> >> > > cases running 'mvn test' works fine, as does running 'mvn site'
>> as
>> >> >> > > long as I somehow keep the hibernate3 plugin from running (the
>> >> >> > > workaround I use is to deactivate it by passing -Dnodb which
>> >> causes a
>> >> >> > > profile holding the hibernate3 and dbunit plugins to not
>> activate;
>> >> as
>> >> >> > > long as I prime the database prior to generating the site and
>> its
>> >> >> > > reports I don't have to worry about dbunit since all the junit
>> >> tests
>> >> >> > > rollback their transactions anyway).
>> >> >> > >
>> >> >> > > Am I missing something obvious here? There's some chatter about
>> >> >> > > cobertura doing nasty things with the maven classpath(s) which
>> >> might
>> >> >> > > go to explain these errors on the hibernate3 side. If this is a
>> >> >> > > legitimate issue, I'm not sure there is a solution, but
>> hopefully
>> >> >> this
>> >> >> > > workaround is halfway usable for some people.
>> >> >> > >
>> >> >> > >
>> >> >> > > Cheers
>> >> >> > > Rob
>> >> >> > >
>> >> >> > >
>> >> ---------------------------------------------------------------------
>> >> >> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> >> > > For additional commands, e-mail:
>> [EMAIL PROTECTED]
>> >> >> > >
>> >> >> > >
>> >> >> >
>> >> >> >
>> >> >> > --
>> >> >> > http://raibledesigns.com
>> >> >> >
>> >> >> >
>> >> ---------------------------------------------------------------------
>> >> >> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> >> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >> >> >
>> >> >> >
>> >> >>
>> >> >>
>> ---------------------------------------------------------------------
>> >> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> >> For additional commands, e-mail: [EMAIL PROTECTED]
>> >> >>
>> >> >>
>> >> >
>> >> >
>> >> > --
>> >> > http://raibledesigns.com
>> >> >
>> >> >
>> ---------------------------------------------------------------------
>> >> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >> >
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/hibernate3-and-cobertura-plugins-not-getting-along-tf3357955s2369.html#a9864014
>> >> Sent from the AppFuse - User mailing list archive at Nabble.com.
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> >> For additional commands, e-mail: [EMAIL PROTECTED]
>> >>
>> >>
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: [EMAIL PROTECTED]
>> > For additional commands, e-mail: [EMAIL PROTECTED]
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/hibernate3-and-cobertura-plugins-not-getting-along-tf3357955s2369.html#a9870070
>> Sent from the AppFuse - User mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
--
View this message in context:
http://www.nabble.com/hibernate3-and-cobertura-plugins-not-getting-along-tf3357955s2369.html#a9882040
Sent from the AppFuse - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]