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 A2DB410106 for ; Mon, 22 Jul 2013 05:53:43 +0000 (UTC) Received: (qmail 5563 invoked by uid 500); 22 Jul 2013 05:53:41 -0000 Delivered-To: apmail-maven-users-archive@maven.apache.org Received: (qmail 5380 invoked by uid 500); 22 Jul 2013 05:53:41 -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 5372 invoked by uid 99); 22 Jul 2013 05:53:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Jul 2013 05:53:40 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [72.5.230.100] (HELO sender1.zohomail.com) (72.5.230.100) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Jul 2013 05:53:36 +0000 Received: from langebro (pool-98-114-184-117.phlapa.fios.verizon.net [98.114.184.117]) by mx.zohomail.com with SMTPS id 1374472395984189.75978167127005; Sun, 21 Jul 2013 22:53:15 -0700 (PDT) From: "Richard Sand" To: "'Maven Users List'" References: <1a7501ce84a6$db9166e0$92b434a0$@idfconnect.com> <9DC01468-1326-46F7-969D-8C20E45CC435@gmail.com> <1ac701ce84b8$693716f0$3ba544d0$@idfconnect.com> <010601ce85be$c1143310$433c9930$@idfconnect.com> In-Reply-To: Subject: RE: API to resolve an artifact in Maven3 Date: Mon, 22 Jul 2013 01:53:03 -0400 Message-ID: <01fa01ce869f$bc155600$34400200$@idfconnect.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQKGDLArBBhhpu2fpRLGg7jxIN0o6wEIRsXCAihtHVACFDxrNQG7f5TZAk/21wmXtqGvAA== Content-Language: en-us X-ZohoMailClient: External X-Zoho-Virus-Status: 2 X-Virus-Checked: Checked by ClamAV on apache.org Hi Russel - The use case is simple - I've written a plug-in which takes in as input a list of dependencies, just like any other plugin or the pom itself. So, given a String representation of an artifact, how do I resolve the artifact so I end up with a local File object I can load? This API has seemed like total voodoo - I want to write a paper that demystifies how to write plugins for maven3. I think I need to find some time to sit with each of the principle author of maven3 and publish what I learn. -Richard -----Original Message----- From: Russell Gold [mailto:russ@gold-family.us] Sent: Sunday, July 21, 2013 7:52 AM To: Maven Users List Subject: Re: API to resolve an artifact in Maven3 Hi Richard, Can you be more specific? What exactly is your goal? - Russ On Jul 20, 2013, at 11:02 PM, Richard Sand wrote: > Can someone please share the secret of how to do dependency resolution > in Maven3? And specifically in 3.1? > > -Richard > > -----Original Message----- > From: Richard Sand [mailto:rsand@idfconnect.com] > Sent: Friday, July 19, 2013 3:45 PM > To: 'Maven Users List' > Subject: RE: API to resolve an artifact in Maven3 > > +1 Anthony. The question is what is the preferred 3.x way of doing it, > +not > how to do it the old way. Unless the official answer is "do it the old > way because..." > > > -----Original Message----- > From: Anthony Dahanne [mailto:anthony.dahanne@gmail.com] > Sent: Friday, July 19, 2013 2:32 PM > To: Maven Users List > Subject: Re: API to resolve an artifact in Maven3 > > 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-o > n-aeth > er-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 > ,enfor > ceVersion,"",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/%3c7 >> A BC22E9-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 >>> >> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org > For additional commands, e-mail: users-help@maven.apache.org > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org > For additional commands, e-mail: users-help@maven.apache.org > ----------------- Come read my webnovel, Take a Lemon , and listen to the Misfile radio play ! --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@maven.apache.org For additional commands, e-mail: users-help@maven.apache.org