On 04/25/2011 10:17 PM, Sander van der Waal wrote:
On Mon, Apr 25, 2011 at 10:05 AM, Ross Gardler<[email protected]> wrote:
On 25/04/2011 08:39, Unico Hommes wrote:
The only way I see ATM for a faster development cycle is to use
something like JRebel.
Hmmm... I don't like the sound of that. JRebel is $189, that's rather alot
for someone just wanting to do a few quick fixes. I'd rather we were
configured in such a way as to be able to use whatever tools are common and
thus attract as many developers as possible.
Is this possible with Maven? Still exploring.
I'm not experienced with using the server config from Eclipse so won't
comment on that.
What I'm exploring is using an embedded container so I can use a debug
config in Eclipse.
The cargo plugin, that Ate configured in the rave-portal/pom.xml spins off a
Tomcat instance
as a separate java process. I couldn't find a way of using that from within
Eclipse. If I run
mvn cargo:start as a m2eclipse run/debug config and kill the JVM, the Tomcat
instance will
remain active and I need to manually kill the Java process.
Actually, I never run cargo itself from Eclipse/m2eclipse.
For that I always use the command line.
Not sure how that works (wrongly) from m2eclipse but I'll give it a try and see
if that can be remedied, I'll let you know if I find a solution.
What kind-of works is using embedded Jetty in the configuration of the cargo
plugin.
I strongly suggest not using Embedded Jetty (or other container) from within
Eclipse or through Maven. The problem with an (in-process) embedded container is
that it will be exposed to the current process classpath, which can cause all
kinds of unexpected/undesired side-effects. Which also are not reproducible in a
"standalone" java process. We've actually been bitten by that, ressulting in
very tricky things like masking problems which only then surface when running
standalone...
To get this going replace the<container> in the cargo-maven2-plugin
configuration of
the rave-portal/pom.xml with:
<container>
<containerId>jetty7x</containerId>
<type>embedded</type>
</container>
Also, the shindig war needs to matched to context '/' instead of '/ROOT'.
Ah. I think that defining context '/' will also lead to deploying it to a
ROOT.war to Tomcat so we simply change that.
Gotchas:
- I tried Jetty 6 first but got into a lot of trouble with JSP/JSTL/el-api
misconfiguration,
because there are jstl and el-api libs prebundled in the shindig war that
need to be matched.
- Using the config above I can set breakpoints in the Java code and change
stuff there
which will be hot-deployed, however changes in JSPs were not picked up,
don't know
why yet.
That only works when you use the (embedded) maven-jetty-plugin, which hooks up
filescanner thread to monitor the (maven) resources folders by itself for
changes. So that is an embedded jetty plugin only feature and won't work with Cargo.
If you run mvn cargo:start from the command line, you get the exact same
(remote) debugging capabilities with the Tomcat container, but also without
support for resource (JSPs) changes being picked up (see my easlier longish
reply to Ross).
- When trying to put the embedded jetty7 config in a separate Maven2 profile
my breakpoints
were ignored, don't know why yet.
Because of all this I didn't check in any of my pom.xml changes. Will try
further and
any comment welcome!
Sander
Ross
--
Unico
On Sun, Apr 24, 2011 at 2:59 AM, Ross Gardler<[email protected]>
wrote:
On 24/04/2011 01:31, Ross Gardler wrote:
On 24/04/2011 00:35, Ross Gardler wrote:
On 23/04/2011 23:07, Ross Gardler wrote:
...
I'll keep digging when I find a little more time, but if anyone sees my
silly mistake please let me know.
Getting a little closer, but still not working...
I tried running from the projects context sensitive menu rather than the
server controller view. This opened the browser for me at
http://localhost:8080/rave-portal and the page loaded (with 404's for
each
gadget as the URL for them is not relative.
I'm going to bed now, I hope someone can provide me with a simple step by
step process for getting this working in Eclipse for an efficient
edit/build
cycle.
(Damn those steep learning curves with new build tools.)
Ross
[1]
http://joemorrison.org/blog/2008/06/01/developing-web-applications-with-maven-and-eclipse-you-can-have-it-all/