It took a lot of ferreting out, but I eventually learned that you can put a <version/> tag in your site.xml, and Maven will put the project version number into the generated site. By default, it appears at the top, next to the (default position of) the publish date. <version/> can have a position attribute, as with <publishDate/>.
Begin rant.
And by ferreting, I mean about an hour of following broken links and scanning undocumented code, jumping to random places in the Maven SVN, trying experiments, and other forms of unnecessary guesswork. As usual, it would have been nice if it was documented; likewise it would be nice if the Maven brats ate their own fucking dog food when it comes to site generation.
As is, if you want to figure this stuff out, your have to guess and hunt around to figure out which of the bajillion plugins is responsible, then you have to guess where the site for that plugin is generated (or try a Google search and hunt around), and then guess where the source code is in the repository (since the documentation is usually fucking wrong and entirely missing). Fucking project comprehension my ass.
The Maven crew has always been about slopping out undocumented, broken shit, rather than actually producing useful tools. I can't wait to get off of it forever.
End rant. I still like the concept of the repository and the transitive dependencies; that aspect of Maven is worthwhile, but as a build tool, it sucks up far more time and energy than it saves. Possibly an order of magnitude more.
Howard, are you drunk?! :-D
ReplyDeleteNo, just frustrated (as usual) with Maven.
ReplyDeleteI've wasted far too many hours on maven. Bad/outdated docs, bugs, design misfeatures. Much of it is obtuse and seems to be designed to keep maven priests employed...
ReplyDeleteBut its adoption seems to be increasing!
For just the repository and the transitive dependencies, Ivy is really good.
ReplyDeleteYou probably didn't have a look at the good documentation :
ReplyDeletehttp://books.sonatype.com/maven-book/reference/site-generation.html#d0e19991
http://books.sonatype.com/maven-book/reference/site-generation.html#d0e20038
Arnaud -- good pointers. Strange that my initial searches didn't find those contents. Funny, doing a reasonable search, maven add version number site), even now doesn't find it (it does find my own blog posting!).
ReplyDeleteDont be too happy with that book Howard, it's supposedly the "Definitive guide", but it's still lacking soooo many things... and silent about sooooo many issues !
ReplyDeleteBut yes, the <version/> tag is in it.
Use Ant+Ivy!
ReplyDeleteI am going to have a look at buildr. I hope that it is awfull like all the other ruby-stuff.
ReplyDeleteI just don't get it ....
ReplyDeleteWhy are people just frustrated using Maven. Just stop using it and go back to ANT which works all the time. End of frustration!
Hey Howard, while it's fresh in your mind, how about a patch to update the docs and save everyone else the trouble you're ranting about?
ReplyDeleteI didn't have to go to an Ivy League school to learn that Ivy is pretty darn good. Good enough for a fairly sizeable two-module project, anyway.
ReplyDeleteBrian,
ReplyDeleteMy time isn't infinite, anything but. Time I spend away from Tapestry affects far more people than time spent with Maven. If my main line of business was helping people with build system and continuous integration, I'd be more motivated. It isn't, I'm not. I could add a Maven bug, but those rarely get acted on, and even when they do, it's impossible to know if you are using the fix due to the dense thicket of plugins.
Maven Ant Tasks are the way to go, or Ivy.
maven is worst tools I have used.
ReplyDeleteYes, give a try on ivy+ant.
Here:
http://www.wibokr.com/page/page.do#Wibokr%20Community$SPWibokr%20build%20story:%20Advocate%20of%20Ivy
Howard,
ReplyDeleteI certainly agree with some aspects of your findings.
Unfortunately since I first used it in 2003 or presented it to the Eclipse community on EclipseWorld in 2005 (including the WTP lead Tim Wagner, now at Microsoft or other IBM folks now using it e.g. via Geronimo) not much has happened.
I was surprised and a little angry to see, that the e2m project had cancelled their presentation on ESE last week.
The only good thing for me was that I had more time to prepare my Babel speech regarding beamers, etc. ;-)
Nevertheless the fact, not only Apache has 3-5 different approaches to a repository as well as Eclipse now having 2 competing(!) Maven projects at a time won't make this any better.
The only thing to hope is that whichever of them overcomes flaws like the one you spotted is more likely to survive.
Let the Games begin!
Howard,
ReplyDeleteI agree with Brian Fox's tack - you have time to rant but not to help.
Imagine if someone had written this post, word for word, but replaced the word Maven with Tapestry. I don't think you would see it their way.
I think you should post the bug at the very least. Otherwise you have very little to stand on here.
Well, Ant does not have site generation, just a thought but, why the tapestry site is not generated with tapestry itself?, would be good to have runables examples build in the site.
ReplyDeleteTaylor, you are right about adding a bug; that's something I will go do. Just the frustration speaking.
ReplyDeleteBy comparison, when I find bugs in IDEA I add them to their JIRA because I get a quick response (sometimes minutes!) and the next release will usually address my problem (when it isn't user error).
The "word for word" part is different; Tapestry is the bread-and-butter of people building Tapestry applications, not a sideline the way a build system is.
Good bug report Howard; looks like you get your wish soon: http://people.apache.org/~baerrach/maven-site-plugin-2.0-beta-8-SNAPSHOT/examples/sitedescriptor.html. I just hope you apply the same standards to yourself as you do to others - one of the most frequent complains on Tapestry list is that T5 documentation is out of date. Of course, you could have just filtered the resources and displayed the version right on the home page - well documented at http://maven.apache.org/plugins/maven-site-plugin/examples/creating-content.html
ReplyDeleteI see that several user pointed to Ant+Ivy, I will add that I know a (still-in-development, not even really alpha) project which goal is to fully integrate Ant and Ivy : EasyAnt.
ReplyDeleteSee http://easyant.abrm.info/trac for more info.
Some of the concepts brougth by the POC are already in the Ant trunk :)
- I'm not the author, it's just a project I carefully follow, it seems really promising.
Kalle
ReplyDeleteI'm glad I got some attention and this issue was addressed. One done, a few thousand to go.
In terms of standards; I hold myself to very high standards, and Tapestry's code quality and stability speaks for itself.
I also eat my own dogfood; I spend considerable time creating Tapestry applications, and training people (at Formos, and at clients) in how to use Tapestry. Many of the changes in Tapestry from 5.0.14 on reflect feedback directly from clients I have trained in the last few months, as well as issue I (at the rest of the team at Formos) experienced directly.
I also can't tell you how many "patches" I receive that require me to write new tests and write or update documentation. Which I do.
greetings from germany (and sry for english problems, correct me if you like, i read and learn)
ReplyDeletejust wanted to let you know some experiences (not really pro or contra maven)
first some background....
here at my job we have 400+ "J2EE" (ear and war mixed, even mixed with bea, websphere and jboss application servers) Components
our typical GUI component has about 50 sub components (read .jar) from those 50 id say about 30 are "real" business components, other 20 are from the inhouse framework
im not counting in the 3rd party components !
to explain this awful lot of components:
- standard design - GUI - Business Layer - DAO Layer(Hibernate) - Domain Layer(Objects + Hibernate Mappings)
- reuse rating of one domain layer is about 2,9 (read - one domain layer is reused in almost 3 different business layers)
we use
- ant and ivy
- Eclipse (and from now on Rational Application Developer IDE + Websphere)
- in eclipse are some external tools (ant tasks) defined
- cruise control as continuous integration tool
...
well and all i can say, it works but its a mess sometimes
biggest plus - we have an entire team(5-7 people) working on the inhouse framework, that includes the build script(s)
biggest problem - about 10.000+ lines of build scripts + a new release of the framework 2 times/year (fixed dates, releases mostly for new jsf components or ESB etc. pp. but often changed build scripts too)
the problem comes through history (look above at 3 application servers and till now about 3 complete rebuilds of the inhouse framework)
in the end i would call this "normality" for medium sized companies ;-)
ive a second job where we start completely new and we decided to try maven out
...now to the thoughts on maven vs ant+ivy
Contra Maven
- really bad documented - but with the sonatype book (even bought it) im feeling better
- hard to understand concepts, even with the sonatype book i had problems to see the "big picture"
- Plugin Version Problem, how to make the build work in 10 years ? hell even in 3 months ?
- why does the (locally) used maven version decide witch plugin versions come into the build ?
- much time needed to get it "just work"
Well why still Maven ?
- with Repository Manager (we use nexus) the plugin version problem is (almost) solved, just backup the entire repo for each final Release
- if the release cycle is to often/too much components - well then its time to pin down the plugin version with customized super-poms, but i just hope that newer maven versions have the possibility to set fixed version numbers easily
- netbeans - with netbeans i had really no problems with maven till now (well after i switched from the inside maven to cli version...)
- no need to write the low level stuff (like ant) + (many) working conventions
- it seems to work for completely new projects (read: new it-infrastructure)
- i know ant+ivy and i wanted to know "new stuff"
it would be nice if the Maven brats ate their own dog food when it comes to site generation
ReplyDeleteagreed, also the site generation is not IMO the best designed component of maven.
You may end up in the same frustration with ant and ivy once you will have a dozen build files, a hell of plugins.
For simple projects, yes you can write beautiful ant files, 5 targets, few dependencies... But as soon as you start to need multiple deployments, different builds, manage the testing, releases, versions then these files tend to become incredibly ugly. At least with the declarative style of maven, the changes you make are localized.
maven is worst tools I have used.
Yes, give a try on ivy+ant.
I've seen too many ugly ant files... Adding ivy doesn't make them more manageable!
Tapestry is the bread-and-butter of people building Tapestry applications, not a sideline the way a build system is. that's funny you see it this way... A web presentation framework is just *one* of the multiple frameworks and sometimes just a little part of the whole job needed to maintain and create a web site.