From users-return-130869-apmail-maven-users-archive=maven.apache.org@maven.apache.org Sun Jan 20 21:35:00 2013 Return-Path: X-Original-To: apmail-maven-users-archive@www.apache.org Delivered-To: apmail-maven-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9BE3CDB42 for ; Sun, 20 Jan 2013 21:35:00 +0000 (UTC) Received: (qmail 31931 invoked by uid 500); 20 Jan 2013 21:34:58 -0000 Delivered-To: apmail-maven-users-archive@maven.apache.org Received: (qmail 31801 invoked by uid 500); 20 Jan 2013 21:34:58 -0000 Mailing-List: contact users-help@maven.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Maven Users List" Reply-To: "Maven Users List" Delivered-To: mailing list users@maven.apache.org Received: (qmail 31790 invoked by uid 99); 20 Jan 2013 21:34:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 20 Jan 2013 21:34:58 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_FRT_PACKAGE X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jeremy.long@gmail.com designates 209.85.214.181 as permitted sender) Received: from [209.85.214.181] (HELO mail-ob0-f181.google.com) (209.85.214.181) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 20 Jan 2013 21:34:51 +0000 Received: by mail-ob0-f181.google.com with SMTP id wc18so6338obb.26 for ; Sun, 20 Jan 2013 13:34:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type; bh=aIBkz2V4NiBchzgAwg/qukXRz954r2IhWqEoRCk5DVo=; b=S3uZl3YSkPwGP+71Lh92hnQ8zPCdhYPBQqiIvoXRVkJJl1CxWyidv0JwO1HxP515x2 T7XVKw9EWr1rJiR2NbWkPaQdsb7wwTQUBFTbQFTVB5jXwS23QPYjRgIQeRx8BzhB84d3 5lpMuheU/RnO7UYXr/YGXt5qzpv9nyq885O/BGBVjZM5JGobeLsVE3rwecX15cq/BQaO jdq68eUr2RCMo2zH4tGjyii9kDmAfWj/xOpJXZQi/RRSdEoZFB96QR/8vnocvs3o9Oar ElLZ3IY8/YxqaYtDJTKFIiAeP56NealIpDXv5t4a/ZJdRogApT+SXC4iuwkSPhHky8O7 BEyw== MIME-Version: 1.0 X-Received: by 10.182.112.34 with SMTP id in2mr9072017obb.80.1358717671213; Sun, 20 Jan 2013 13:34:31 -0800 (PST) Received: by 10.76.28.104 with HTTP; Sun, 20 Jan 2013 13:34:31 -0800 (PST) Date: Sun, 20 Jan 2013 16:34:31 -0500 Message-ID: Subject: Maven Plugin Issue - MavenProject Not Bound From: Jeremy Long To: users@maven.apache.org Content-Type: multipart/alternative; boundary=14dae9399893248b4104d3bf1c3e X-Virus-Checked: Checked by ClamAV on apache.org --14dae9399893248b4104d3bf1c3e Content-Type: text/plain; charset=ISO-8859-1 I am trying to create a simple plugin to inspect project dependencies using the MavenProject - but I'm getting an error because the MavenProject is not bound (see below for details). Here is the code for the plugin: /** * Goal that checks project dependencies * @goal package * @phase package * @requiresProject false * @requiresDependencyResolution runtime * @requiresOnline true * @execute phase="package" */ public class DependencyCheckMojo extends AbstractMojo { /** * POM * * @component */ protected MavenProject project; public void execute() throws MojoExecutionException { if (project != null) { Set artifacts = project.getArtifacts(); for (Artifact a : artifacts) { getLog().error(a.getFile().toString()); } } else { getLog().error("Dependency Check - Maven project is null"); } } } The POM for the plugin is: .... org.codesecure DependencyCheck-Plugin 1.0-SNAPSHOT maven-plugin maven-plugin-plugin 2.3 dependencycheck mojo-descriptor descriptor org.apache.maven maven-plugin-api 3.0 org.apache.maven maven-core 3.0 .... However, when I use this plugin in another project: org.codesecure DependencyCheck-Plugin 1.0-SNAPSHOT package package And I run 'mvn package' I get the following error: [ERROR] Failed to execute goal org.codesecure:DependencyCheck-Plugin:1.0-SNAPSHO T:package (default) on project sample: Execution default of goal org.codesecure: DependencyCheck-Plugin:1.0-SNAPSHOT:package failed: Unable to load the mojo 'pac kage' (or one of its required components) from the plugin 'org.codesecure:Depend encyCheck-Plugin:1.0-SNAPSHOT': com.google.inject.ProvisionException: Guice prov ision errors: [ERROR] [ERROR] 1) No implementation for org.apache.maven.project.MavenProject was bound . [ERROR] while locating org.codesecure.DependencyCheckMojo Any idea what I'm doing wrong? Thanks in advance, Jeremy --14dae9399893248b4104d3bf1c3e--