Friday, March 27, 2009

Another bad day with Maven

Another bad day with Maven ... first, something changed in the Maven Archetype plugin, so now my archetypes don't work anymore ... and I'm far from the only person with this problem.

Second, I thought I'd use mvn eclipse:eclipse instead of my Ruby script to keep my Eclipse .classpath file up to date: but it doesn't seem to want to download and connect the Tapestry Java sources. So back to the script it is.

8 comments:

  1. Honestly, howard. Stop using mvn eclipse:eclipse. In fact, stop using .classpath/.project on a maven project. Use the latest m2eclipse and let it keep your project in sync with the maven metadata. It maintains the classpath in an internal container derived directly from your dependencies, not via a brittle sync process.

    As to the archetype process, they screwed that puppy up, didn't they.

    ReplyDelete
  2. I thought you were planning to wean Tapestry off Maven Howard? Are you too invested in it now, or have you changed your mind?

    We stayed clear of Maven due to your unhappiness and intention to change and it does cause us problems occasionally because T5 uses Maven, but I hope that it's sparing us some of this kind of M2 pain. Although we do have some problems with Ivy, mostly it just works for dependency management.

    ReplyDelete
  3. Anonymous7:39 PM

    Two things: from your google search the solution to the archetype seems to be to delete the local repository, secondly with eclipse:eclipse, there is an option to download sources which is by default disabled...

    ReplyDelete
  4. Erik: good notes, but I found those and they didn't work; Deleting the repository did not resolve the archetype problem, and only some sources were downloaded.

    ReplyDelete
  5. Thanks to Raphaël Piéroni the error was found: there was an extra <directory> element in my archetype-metadata.xml. This was not reported at all by Maven.

    You should convert:

    <fileSet filtered="true" packaged="false">
    <directory>src/test/resources</directory>
    <directory>src/test/conf</directory>
    </fileSet>

    to:

    <fileSet filtered="true" packaged="false">
    <directory>src/test/resources</directory>
    </fileSet>

    <fileSet filtered="true" packaged="false">
    <directory>src/test/conf</directory>
    </fileSet>

    Future versions of the archetype plugin will report the first error, rather than ignore it leading to the second incomprehensible error (I received).

    Meanwhile, this has spurred me to locate a new tool even more strongly than before, and right now Buildr looks like the right approach (there's also Gradle, Savant and probably others).

    ReplyDelete
  6. I've always been put off using maven for individual projects. I don't like the idea of having to debug yet another framework when something i dont quite understand goes wrong. I'm happy enough downloading binaries/sources when i need to or want to upgrade (generally infrequently) and the pain of doing so manually is absolutely minimal.

    I seem to be alone here though since everyone else uses it. What am I missing out on?

    ReplyDelete
  7. Anonymous10:48 AM

    "I don't like the idea of having to debug yet another framework", I used maven quite alot on many projects. I never had to debug it to understand what is going wrong. Howard uses cases are quite complex - I wouldn't generalize from his experience.

    Maven helps you to introduce a good testing process in your projects and you configure the build instead of scripting it.

    ReplyDelete
  8. "Howard uses cases are quite complex - I wouldn't generalize from his experience."

    How do you know my use cases are any less complex, if not more?

    ReplyDelete

Please note that this is not a support forum for Tapestry. Requests for help will be deleted. Please subscribe to the Tapestry user mailing list if you are in need of support, or contact me directly for professional (for pay) support.

Spammers: Don't bother. I delete your comments and it's a waste of time for both of us. 垃圾邮件发送者:不要打扰。我删除您的评论和它的时间对我们双方的浪费