aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Building Archetypes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Building Archetypes" Watch "Building Archetypes" New topic
Author

Building Archetypes

Christopher Burns
Ranch Hand

Joined: Oct 21, 2008
Posts: 33
Hi gang,

Reaching out for the incredible help here at JR, once again.

So, now that I have gotten over most of the humps and learning curve of Maven, I am spreading my (still wet) wings a bit, and trying to create an Archetype for our development team.

We use Spring, Struts, and Velocity, plus a couple of other systems such as JUnit, Cobertura, and PMD. I could not find a provided archetype that set things up like this (closest was one of the AppFuse archetypes), so I figured I'd roll it myself.

I have it all together, but when I go to compile/install it I am getting errors that I cannot resolve.

First question, is there a way to do this from within eclipse?

Next, I first tried to use:

which I ran from the command line within my project root.

I get the following error:
Unable to find resource 'org.apache.maven.plugins:maven-archetype-plugin:plugin:12-SNAPSHOT' in repository central (http://central)

I am using Nexus Repo Manager, and have my settings.xml pointed to our repo as the mirror for *

When I tried to research that I found an article saying that archetype was deprecated and to use archetypeng instead. So I tried:

and I get:
The plugin 'org.apache.maven.plugins:maven-archetypeng-plugin' does not exist or no valid version could be found.


I noticed that org.apache.maven.plugins was not the proper groupId, so I changed to:

and I get:
The plugin 'org.apache.maven.plugins:maven-org.codehaus.mevenide.archetypeng-plugin' does not exist or no valid version could be found.

What am I doing wrong??!?!

Thanks,

Chris


"It is our choices, much more than our abilities, that make us who we are."
- Albus Dumbledore
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

What version of Maven are you using? Remember from 2.0.9 onwards the versions of plugins (including archetype) are 'locked' in the super POM and you may need to override that if there is a newer version than what comes default with your version of Maven.

Another thing to fdo is to actually go to the maven central repo via your web browser and make sure that the plugin version that you're looking for actually exists (if it does then you've probably got a Nexus config issue).


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Christopher Burns
Ranch Hand

Joined: Oct 21, 2008
Posts: 33
Hi Martijn,

I am running v2.1.0 of Maven.

Part of the problem is that I cannot find the bloody plugin anywhere... It isn't in org.apache.maven.plugins. I can't find it in org.codehaus.mojo either.

In the Apache docs at in the Attributes section it says:
This plugin goal has been deprecated: Please use the generate mojo instead.


But I cannot find the generate mojo anywhere either.

Is all of this documentation stale, or am I really missing something again?

Thanks,

Chris

BTW - I am assuming you are Dutch from the spelling of your name... true? Are you in Holland, or the US?
Christopher Burns
Ranch Hand

Joined: Oct 21, 2008
Posts: 33
Ok... got it, finally...



worked.

But now, I am not understanding the mechanism that mapped my generic archetype:create-from-project to the 12-SNAPSHOT version. Can you 'splain that?

C
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Hi Chris,

Yes I'm Dutch, but raised mainly in NZ and now resident of the UK (until I move on again) .

[Edit] Ah didn't see your new post. The reason is that the super pom references a default version (the lock down from 2.0.9 builds I mentioned before), so you had to manually override.

Yes the docs in some places aren't great, one small hint is that maven the definitive guide gets constantly updated _online_ only at the sonatype site, it's worth checking out for the latest info.
Christopher Burns
Ranch Hand

Joined: Oct 21, 2008
Posts: 33
Got it. Thanks for clearing that up, and, once again, for the help.

Dutch, NZ, UK... that must make for a very interesting accent!
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

You're welcome and apparently my accent is still mainly Kiwi and reasonable shocking!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Building Archetypes
 
Similar Threads
wants to know the basic things about maven
Build Error In creating new project in Maven
mvn --version runs but not mvn:install
how to run a project using maven
Not Getting Started with Maven - Archtype plugin Not found