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 0732CCC3D for ; Fri, 19 Jul 2013 18:32:39 +0000 (UTC) Received: (qmail 6009 invoked by uid 500); 19 Jul 2013 18:32:36 -0000 Delivered-To: apmail-maven-users-archive@maven.apache.org Received: (qmail 5642 invoked by uid 500); 19 Jul 2013 18:32:33 -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 5632 invoked by uid 99); 19 Jul 2013 18:32:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Jul 2013 18:32:31 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of anthony.dahanne@gmail.com designates 209.85.212.169 as permitted sender) Received: from [209.85.212.169] (HELO mail-wi0-f169.google.com) (209.85.212.169) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Jul 2013 18:32:27 +0000 Received: by mail-wi0-f169.google.com with SMTP id c10so953489wiw.4 for ; Fri, 19 Jul 2013 11:32:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=O+qsCxejdPgmJjeKIQOnQnMRvV/55Ik9Xp3Xi0qH/bs=; b=hddzY+51luODUPf+6LGzRFBod350GfNirWV3Z9VOm9nGOlhZzv48A1pTvXqiW2Qd1H J6RqUAsCGMZAK4RSAsHqqIuP5nm3eZ35J2kRPvRDBwij6BDFMxTqm9sm7pJxF9rNVclL IgGNld1ZWp/OWi4o1lAU7oZfBtvhEhALfatM6b5hdcVOkTod89d4l+RlHXcGJSMkKEZO 16ypYmmet1MT8dodQ1qHXgesDkqRuln/0B0X+tyqjIYktT/cTEwVMnStMT54BdswTW/o hizcrhM/H8Q7mAsEYSLdVKJGhGaxk9wH54vqHAf+gP0Ht4KrNsUPWDehcIek6uzNbvW5 +kig== MIME-Version: 1.0 X-Received: by 10.180.207.43 with SMTP id lt11mr23331035wic.57.1374258726119; Fri, 19 Jul 2013 11:32:06 -0700 (PDT) Received: by 10.194.88.225 with HTTP; Fri, 19 Jul 2013 11:32:06 -0700 (PDT) In-Reply-To: <9DC01468-1326-46F7-969D-8C20E45CC435@gmail.com> References: <1a7501ce84a6$db9166e0$92b434a0$@idfconnect.com> <9DC01468-1326-46F7-969D-8C20E45CC435@gmail.com> Date: Fri, 19 Jul 2013 14:32:06 -0400 Message-ID: Subject: Re: API to resolve an artifact in Maven3 From: Anthony Dahanne To: Maven Users List Content-Type: multipart/alternative; boundary=001a11c3f7ec33322704e1e18bc9 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c3f7ec33322704e1e18bc9 Content-Type: text/plain; charset=ISO-8859-1 hello, I 'm slightly confused about your answer Igor. The other day I was wondering about how to keep a maven plugin doing artifact resolution compatible with both maven 3.0 and 3.1 and Robert answered me to use the maven dependency tree api : http://stackoverflow.com/questions/17685441/can-a-maven-mojo-relying-on-aether-be-compatible-with-maven-3-0-x-and-3-1-x#comment25769765_17686482 Now I am using something like that : Artifact enforceArtifact = defaultArtifactFactory.createArtifact(enforceGroupId,enforceArtifactId,enforceVersion,"",enforceType); MavenProject enforcePom = mavenProjectBuilder.buildFromRepository( enforceArtifact, remoteRepositories, localRepository); DependencyNode rootNode = dependencyGraphBuilder.buildDependencyGraph(enforcePom, new CumulativeScopeArtifactFilter(Arrays.asList(Artifact.SCOPE_COMPILE, Artifact.SCOPE_RUNTIME))); and that works pretty well (I used to think relying on aether directly was the best approach, until this change of package made my plugins not maven 3.1 compatible) Which approach would you consider the best then (when writing a plugin doing dependency resolution) , using the Maven 2 API with maven-compat or relying on maven-dependency-tree ? Thanks for your answer ! Anthony On Fri, Jul 19, 2013 at 1:44 PM, wrote: > Please check next post > > http://mail-archives.apache.org/mod_mbox/maven-users/201307.mbox/%3c7ABC22E9-32C5-44F6-BDB3-117414907DB8@gmail.com%3e > It should helps you > > On Jul 19, 2013, at 9:39 PM, "Richard Sand" wrote: > > > Quick Q- what's the proper way to resolve an artifact in a Maven3 > plug-in, e.g. where the artifact isn't already a managed dependency in the > project. > > > > I found the Mojo Developer Cookbook ( > http://docs.codehaus.org/display/MAVENUSER/Mojo+Developer+Cookbook) but > it gives the Maven2 technique, and the classes used are deprecated. > > > > -Richard > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org > > For additional commands, e-mail: users-help@maven.apache.org > > > --001a11c3f7ec33322704e1e18bc9--