Mvn builds ( was Re: RHQ initial server startup error: NoClassDefFoundError: org/jboss/wsf/spi/deployment/UnifiedVirtualFile (RHQ_3_0_0_EmbJopr2 tag) )
John Mazzitelli
mazz at redhat.com
Fri Oct 15 12:13:38 UTC 2010
On 10/15/2010 08:00 AM, Heiko W.Rupp wrote:
> It looks like if you have M2Eclipse installed, you can also launch
> mvn builds from there, which seems to have different (classloader ?)
> semantics.
>
> So when in doubt, use command like mvn.
I would not use M2Eclipse. I've always had problems with that. I've not
tried it in a while, but every time I've tried in the past, it just
didn't work nicely for me. I would say if you are using that, do not
expect RHQ to build successfully (or at minimum do not be surprised if
it fails to build).
However, you can always use our Eclipse External Tool definitions - they
will always work the same as if you launched directly from a command
line console using the same arguments the external tool definitions pass
in. (btw: you will get these RHQ external tool definitions in Eclipse
automatically as soon as you import the RHQ project into Eclipse - you
just have to set that M2 variable as described in that wiki page I
linked to earlier).
Those external tool configurations will launch mvn builds externally and
thus there are no issues with Eclipse messing with classloaders and
things like that - using these Eclipse tools are just as if you launched
them from the command line - except you can see its output in the
Eclipse Console view.
Note: most of those Eclipse tool definitions pass in "-o" to maven
because 90% of the time, using it in offline mode doesn't hurt and it
makes the build go faster. However, if new dependencies were added to
the project poms, you'll need to run a mvn build without -o so it knows
to download new deps - in fact we have an Eclipse External Tool
configuration that you can use to ask it to download dependencies - "RHQ
Maven Build - Download Dependencies".
More information about the rhq-devel
mailing list