Tapestry Training -- From The Source

Let me help you get your team up to speed in Tapestry ... fast. Visit howardlewisship.com for details on training, mentoring and support!

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:

Christian Gruber said...

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.

Hazelnut said...

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.

Erik said...

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...

Howard said...

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.

Howard said...

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).

Pepper said...

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?

CadErik said...

"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.

Pepper said...

"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?