So, what dependency should I be using to get access to the maven project class? 
 I get the feeling I'm using the wrong one.

I've opted to use:

import org.apache.maven.project.Project;

From:
        <dependency>
          <groupId>maven</groupId>
          <artifactId>maven</artifactId>
          <version>1.1-beta-3</version>
        </dependency>

I feel like this is the maven1 version...
 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jeff MAURY
Sent: Wednesday, December 12, 2007 3:21 AM
To: Maven Users List
Subject: Re: Getting a dependency list in a custom plugin

On 12/12/07, EJ Ciramella <[EMAIL PROTECTED]> wrote:
>
> Hello all - I have what seems like a simple question that's got me
> stumped at the moment.
>
> Is there a way to iterate over the dependencies in a particular project
> inside a custom plugin?
>
> I keep wanting to do something like:
>
>     ArrayList deps = (ArrayList) proj.getDependencies();
>     for(int x = 0; x < deps.size(); x++)
>     {
>      getLog().info("--> "+deps.get(x));
>     }
>
> Just for testing purposes, but at runtime, I keep getting this
> stacktrace:
>
> java.lang.NoClassDefFoundError: org/apache/maven/project/Model
>        at org.apache.maven.project.Project.<init>(Project.java:120)
>        at com.upromise.maven.helpers.ManiGen.execute(ManiGen.java:20)
>        at
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginMa
> nager.java:420)
>        at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Default
> LifecycleExecutor.java:539)
>        at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoa
> l(DefaultLifecycleExecutor.java:493)
>        at
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultL
> ifecycleExecutor.java:463)
>
> I get the feeling I'm not using the right Project class.


I think you're missing a dependency in your plugin POM so that the classpath
affected to your plugin is not complete.

Jeff


Any suggestions would be really helpful.
>



-- 
La mélancolie c'est communiste
Tout le monde y a droit de temps en temps
La mélancolie n'est pas capitaliste
C'est même gratuit pour les perdants
La mélancolie c'est pacifiste
On ne lui rentre jamais dedans
La mélancolie oh tu sais ça existe
Elle se prend même avec des gants
La mélancolie c'est pour les syndicalistes
Il faut juste sa carte de permanent

Miossec (2006)

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to