implements Elegance {

// Elwyn Malethan's musings on software development, mountain biking and general navel–gazing...

Maven Troubles

I‘ve been having a bit of a mare this morning with trying to get my first Maven archetype for SeemoreJ up and running. I‘ve created a SeemoreJ example application from which I want to generate an arcehtype.

I‘ve recently been following Rick Hightower's efforts with Crank and noticed he‘s been tackling maven based issues as well. Though with rather more success than me.

Anyway, as per Nino Martinez's tip I used mvn archetype:create-from-project to attempt to create an archetype from my example project.

First I get this error, despite the fact that – as I understand it – the file maven complains about being missing is not actually required and that it should prompt me for the values usually found in this file.

[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] ------------------------------------------------------------------------
[INFO] Building seemorej-example
[INFO]    task-segment: [archetype:create-from-project]
[INFO] ------------------------------------------------------------------------
[INFO] [archetype:create-from-project]
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Cannot create archetype from this project.

Embedded error: /xxxx/seemorej-example/src/main/archetype/archetype.properties (No such file or directory)
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Sat Jan 17 12:06:10 GMT 2009
[INFO] Final Memory: 4M/67M
[INFO] ------------------------------------------------------------------------

So, I add archetype.properties with some values suggested from this page and now it builds "successfully". Quotes used because I think it kind of worked in that it copied the pom.xml file over and the contents of src/main/java, src/main/resources and src/test/java into a target/archetype.jar but completely ignored the contents of my web application folder (in src/main/webapp). Also the plugin doesn't seem to behave like any of the documentation suggests. Mine seems to generate the file target/archetype.jar, unlike what Rick and Nino both describe should happen, which is the archetype project should be generated in target/generated-sources.

Well, enough sitting in front of my computer now. I‘m going to prepare my flat for some GSI (like DIY but lazier), which is in-turn to prepare it for tenants in a month or so. If anyone is looking to rent a city-centre flat in Cardiff, I‘m your man! Get in touch.

First published on Jan 17, 2009. Last updated on: Mar 12, 2009.

Comments (0)

Leave a reply »

 

Leave a Reply

Your name
 
Email
 
Website
 
Comment

You may use Textile notation here
 
 

Please perform this simple arithmetic test to prove you are human
 
 
 
People I like
Other sites