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