|
|
January 2006
[
Brett
]
11:04, Thursday, 19 January 2006
Riding in an elevator today I saw this headline come up on screen... those who stay married on average have double the income of those who are single or divorced.
What do you know, 1 + 1 = 2 after all.
That aside, the dual meaning of the headline struck me more - getting and staying married certainly leads to a richer life, even if that's not the case financially.
[
Brett
]
22:01, Tuesday, 10 January 2006
Do yourself a favour - check out Jetty6.
It's been a while since I've done any form of webapp development, so I'm a bit rusty. The last place I worked at ran Tomcat servers (quite successfully), so development was naturally done against the same, with the occasional foray into Resin. But both suffered from the problem that fairly regularly, someone would get their dev environment misconfigured and spend some time troubleshooting where it had all gone wrong. It was inevitably something simple and completely unrelated to the NullPointerException or some other runtime exception that had popped up in the logs or in the browser.
With IDEA having Tomcat support built in, when I was starting to test the new webapp I naturally fell back to the old habit of firing that up. And then, no end of of problems:
- The Windows install of Tomcat omits all the startup scripts because you get a service, and you'd never want anything else, right? The IDEA support requires the scripts, so I grab the tarball instead.
- Errors on startup. SEVERE: Error filterStart. I know that means an exception in the filters I have configured. I'd like to know what it is. But the only way I'm extracting it is with a breakpoint and startup in debug mode (yes, this was my fault, but a little more helpful error message would be nice).
- Ok, everything working. Webapp redeploys most of the time, in about 15-20 seconds after making changes. Sometimes it needs a stop/start cycle to pick it up though.
- Somehow I manage to get a NullPointerException on startup when it was working before. Googling seems to indicate this is an invalid ROOT.xml, as I see a user getting reprimanded for not bothering to do validation on the XML. Sorry, but a NullPointerException is a bug, user error or not. I can't find the cause, the XML is valid and I've deleted IDEA's cache of the tomcat base to no avail.
The IDEA support for Tomcat is actually quite good, but I just didn't have time for this. This was with a default configuration! Luckily, Jetty6 to the rescue. I've heard much about it recently and I know they just did a Maven 2 plugin that sounded cool. I wasn't really aiming to learn another new technology, but thought it was worth a shot since it was on my todo list and I wasn't getting anywhere. Less than 5 minutes later, the environment is running flawlessly with features I've had to fumble around to set up for other containers in the past: - web resources read directly from the source tree, so you can edit, save, refresh without any deploying, etc.
- detects changes on a scheduled interval (I'm using 10 seconds), reloads the webapp if classes/descriptors/libs change. It reloads fast and I haven't seen it fall over on it yet.
- Very little setup required.
What setup was required? First, the normal Maven2 stuff: run the archetype command to generate a skeleton webapp project, start adding web content, and run mvn package to build the WAR. I'd done all this before using Tomcat today. Because of the way I was using Tomcat, I wasn't using mvn package, but had used mvn idea:idea to generate the appropriate webapp IDEA module and was letting it do all the exploded webapp creation in the Maven layout, so I could continue to use that as is. To set up Jetty6, I added this to the POM:
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty6-plugin</artifactId>
<configuration>
<scanIntervalSeconds>10</scanIntervalSeconds>
<contextPath>/</contextPath>
</configuration>
</plugin> The rest of the defaults were fine. Then: mvn jetty6:run Jetty is now sitting on localhost:8080 with the webapp running, listening for changes. This is my ideal set up for development, and I don't see myself going back any time soon. A huge thanks to the Greg and Jan for their work on this. I'm really looking forward to using it some more.
[
Brett
]
11:45, Friday, 6 January 2006
Both Steve and Lars have been talking about how they think Maven repositories could be improved. Lots of good points, lots I agree with, lots I'd have already done if there were more hours in the day :)
I'm sure there are plenty of folks out there that have thoughts of their own on this topic. So, if that's you, how can you help?
There are a few different categories of people that can help in their own ways.
- Open source library and framework developers and release managers - Even if you don't use Maven yourself, chances are your users do. Treat that support as importantly as any other feature request. You can submit your own Maven metadata, and even have your releases automatically published to the Maven repository system. Here are the instructions for both. It's also important to consider how your choice of dependencies affects your users. Putting all your functionality into one library is a distribution convenience, but can cause confusion for users about what the dependencies really are if they only use a part. Give them a choice. Produce libraries with discrete, independant functionality and clear dependencies (including clear version requirements), and produce the convenient bundled archive with the lot.
- Developers interested in working on an application - participate in the Maven Repository Manager. We are building an application that does all the fun things like reporting on bad data, converting Maven 1.x repositories, and doing searches and browsing of the repository. You can comment on the brief feature and design notes. You can help us fix or implement issues in the repository manager, or in Maven itself. Vote for the ones important to you. Or discuss your ideas on dev@maven.apache.org with the other developers.
- Users of the Maven repository - Help us fix metadata with usability problems. Even better, get the project you are using to buy into the problem and help fix it.
One of Maven's biggest strengths is the repository, it's size and openness to input from users and project owners. However, one of Maven's biggest pain points is the repository, it's size and openness to input from users and project owners :) The good news is that you can help - we've gotten plenty and have seen quite an improvement since Maven 2.0 was released. There's still work to do, but we are moving forward.
|