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 1933A109E8 for ; Tue, 23 Jul 2013 00:38:12 +0000 (UTC) Received: (qmail 80316 invoked by uid 500); 23 Jul 2013 00:38:10 -0000 Delivered-To: apmail-maven-users-archive@maven.apache.org Received: (qmail 80231 invoked by uid 500); 23 Jul 2013 00:38:10 -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 80223 invoked by uid 99); 23 Jul 2013 00:38:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Jul 2013 00:38:10 +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 (nike.apache.org: domain of dantran@gmail.com designates 209.85.215.49 as permitted sender) Received: from [209.85.215.49] (HELO mail-la0-f49.google.com) (209.85.215.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Jul 2013 00:38:04 +0000 Received: by mail-la0-f49.google.com with SMTP id ea20so5622745lab.22 for ; Mon, 22 Jul 2013 17:37:43 -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=p+1v1OqKH2IP9nWHqJmGxk7n9F3JquydDaup3jwEq38=; b=tTQ+//VK4cFPrIq4F98yUjtMPuBRKk2ClbqalC3x8mWyI3Hbgd1STXJm78SJ2RBb0U mO45ZEgQMkLhQIqzkKyPpwnqmFBJYy83j+0bJ/tClTdF4lmbC/HYBjkfYMzZSbKVkFMJ t0/7TZsgHTvnqm/X5//SXi36np1Qb8Qx2Uzrw/B+9PAVD7ot+fWnl512omYHtHcmo4ci wrxXM3sRUJPnlBEF0ckI30CbRdpATCYMMpqOPKOLgRDZeGQSnKmSl4f7QRFBfEkL4rgn +0dsMUElBEvf0oHweLypf+GgcXsN4R6p6AIsXoXGf3zeaQ3n5/BAbPPsoUISxtMRaZhR rUig== MIME-Version: 1.0 X-Received: by 10.112.125.199 with SMTP id ms7mr13334447lbb.29.1374539863389; Mon, 22 Jul 2013 17:37:43 -0700 (PDT) Received: by 10.114.26.227 with HTTP; Mon, 22 Jul 2013 17:37:43 -0700 (PDT) In-Reply-To: References: <1a7501ce84a6$db9166e0$92b434a0$@idfconnect.com> <9DC01468-1326-46F7-969D-8C20E45CC435@gmail.com> <1ac701ce84b8$693716f0$3ba544d0$@idfconnect.com> <010601ce85be$c1143310$433c9930$@idfconnect.com> <01fa01ce869f$bc155600$34400200$@idfconnect.com> <92A31A88-643C-4623-9305-024BC27E09C0@gold-family.us> <038c01ce870c$de5b5d50$9b1217f0$@idfconnect.com> <51ED83D2.2060605@artifact-software.com> <03cc01ce871a$4767af80$d6370e80$@idfconnect.com> <51ED9EA9.1050800@artifact-software.com> <041801ce8726$213ff630$63bfe290$@idfconnect.com> Date: Mon, 22 Jul 2013 17:37:43 -0700 Message-ID: Subject: Re: API to resolve an artifact in Maven3 From: Dan Tran To: Maven Users List Content-Type: multipart/alternative; boundary=089e012284fa497bf504e2230078 X-Virus-Checked: Checked by ClamAV on apache.org --089e012284fa497bf504e2230078 Content-Type: text/plain; charset=UTF-8 Yes, I am also at a odd situation whether I need to have my custom plugin to support both maven 3 and 3.1 at the same time. Btw, maven 2 api should support most of the requirement, do you have specific needs for maven 3 artifact api? -D On Mon, Jul 22, 2013 at 4:57 PM, Anthony Dahanne wrote: > On Mon, Jul 22, 2013 at 6:59 PM, Dan Tran wrote: > > > Eclipse aether is the api you need resolve your artifact for maven 3.1. > > > > Yeah, and that would mean bye bye maven 2 and maven 3.0 support ! > > > > > > I > > think there are plenty of examples for you to base on. If you have > > question, you can post it here at user group, there are plenty of dev > folks > > here always trying to help out > > > > -D > > > > > > On Mon, Jul 22, 2013 at 2:55 PM, Richard Sand > > wrote: > > > > > Ok good points, thanks Ron. I'll try what you suggested, and see if I > can > > > get some assistance on the developers list. I'm happy to volunteer to > > > update > > > some documentation around what I've learned writing this plugin. > > > > > > Best regards, > > > > > > Richard > > > > > > > > > -----Original Message----- > > > From: Ron Wheeler [mailto:rwheeler@artifact-software.com] > > > Sent: Monday, July 22, 2013 5:06 PM > > > To: Richard Sand > > > Cc: 'Maven Users List' > > > Subject: Re: API to resolve an artifact in Maven3 > > > > > > My point is that most of the people here are users and not interested > in > > > plug-in development or knowledgeable about plug-in development. > > > Custom plug-ins are not required for development of standalone or web > > > applications in Java most of the time. > > > > > > Most appear to be developed to support specific specific non-java > > > activities. I use one developed as a front-end for DITA document > > production > > > to simplify the use of the DITA-OT. I use another to simplify the > > packaging > > > of applications into an installer using IzPack. > > > > > > These are pretty simple Maven plug-ins and likely do not include very > > much > > > coordination with or use of Maven internal methods. > > > > > > I am not sure if there is a better forum for you to get the kind of > help > > > that you need. > > > The kind of information that you seem to need is probably known by the > > > people who frequent the dev list but they are going to be pretty > focused > > on > > > Maven development and may not welcome third-party development > questions. > > > > > > You might get some help by offering to add documentation to the code in > > the > > > dev list in return for specific questions. Certainly you are doing a > > level > > > of research into the examples, docs and code that could lead to useful > > > updates to the docs or examples. > > > > > > > > > > > > Ron > > > > > > > > > On 22/07/2013 4:30 PM, Richard Sand wrote: > > > > Hi Ron - I'm not sure what you're telling me. I thought that the > > > > capability to easily write custom plug-ins was part of the goal of > > > > Maven. If Maven doesn't want people outside of Maven writing > plug-ins, > > > > then you're right the information I'm looking for isn't useful. > > > > > > > > But the javadocs are published - they just aren't filled in. Examples > > > > are published, but they're for Maven 2 and either don't work or are > > > deprecated. > > > > Basic tasks that *seem* to be within the scope of what Maven wants to > > > > do are surprisingly difficult. That's frustrating. > > > > > > > > The questions I've asked on this this have been as specific and > > > > technical as I could make them. I'm not trying to waste anyone's time > > > > or not respect the work that others have volunteered. > > > > > > > > -Richard > > > > > > > > > > > > -----Original Message----- > > > > From: Ron Wheeler [mailto:rwheeler@artifact-software.com] > > > > Sent: Monday, July 22, 2013 3:11 PM > > > > To: users@maven.apache.org > > > > Subject: Re: API to resolve an artifact in Maven3 > > > > > > > > You are not using Maven; you are developing a custom plug-in. > > > > > > > > That is a development activity so you should expect that it will be > > > > more difficult than what other users need to do and you will need > > > > information that is of no use to anyone else. > > > > > > > > It appears that you are trying to extend Maven in a way that is > > > > outside what Maven likes to do so you can expect that some > information > > > > will be hard to find outside the code. > > > > > > > > > > > > Ron > > > > > > > > > > > > On 22/07/2013 2:54 PM, Richard Sand wrote: > > > >> Hey Russell - DependencyGraphBuilder seems to be for resolving the > > > >> dependencies that the project already has, i.e. in the > > > >> element. What I'm trying to do now is > > > >> configure additional dependencies used by my plugin at runtime > > > >> outside of the project dependencies. > > > >> > > > >> I've used a lot of open source projects but I cannot remember one as > > > >> opaque as Maven. I'm looking through maven-dependency-plugin now to > > > >> see if I can glean any insights. It seems that plugin used the same > > > >> technique you did in its DefaultArtifactsResolver utility class. I'm > > > >> going to check out the project from svn to see how its initializing. > > > >> > > > >> -----Original Message----- > > > >> From: Russell Gold [mailto:russ@gold-family.us] > > > >> Sent: Monday, July 22, 2013 7:22 AM > > > >> To: Maven Users List > > > >> Subject: Re: API to resolve an artifact in Maven3 > > > >> > > > >> Hi Richard, > > > >> > > > >> Believe me, I share your frustration. Like many open-source > projects, > > > >> Maven is woefully under-documented. I've spent a significant amount > > > >> of time over the past months researching how to do things for the > > > >> course I've been writing, and also for the plugins I'm writing. > > > >> > > > >> Mostly, I've been reading source code - especially the > maven-supplied > > > >> plugins. The problem, of course, is figuring out what the "official" > > > >> and supported way of doing things is. > > > >> > > > >> To resolve artifacts, I wound up using MavenProject, > > > >> ArtifactResolver, ArtifactFactory, and both the local and remote > > > >> repositories. I didn't even see DefaultDependencyGraphBuilder. If > > > >> that's easier, I may consider revising my approach. > > > >> > > > >> Thanks, > > > >> Russ > > > >> > > > >> On Jul 22, 2013, at 1:53 AM, Richard Sand > > wrote: > > > >> > > > >>> 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-relyin > > > >>>> g > > > >>>> - > > > >>>> o > > > >>>> n-aeth > > > >>>> > er-be-compatible-with-maven-3-0-x-and-3-1-x#comment25769765_1768648 > > > >>>> 2 > > > >>>> > > > >>>> Now I am using something like that : > > > >>>> Artifact enforceArtifact = > > > >>>> > defaultArtifactFactory.createArtifact(enforceGroupId,enforceArtifac > > > >>>> t > > > >>>> I > > > >>>> d > > > >>>> ,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/% > > > >>>>> 3 > > > >>>>> c > > > >>>>> 7 A BC22E9-32C5-44F6-BDB3-117414907DB8@gmail.com%3e > > > >>>>> It should helps you > > > >>>>> > > > >>>>> On Jul 19, 2013, at 9:39 PM, "Richard Sand" < > rsand@idfconnect.com> > > > >> 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 > > > > > > > > -- > > > > Ron Wheeler > > > > President > > > > Artifact Software Inc > > > > email: rwheeler@artifact-software.com > > > > skype: ronaldmwheeler > > > > phone: 866-970-2435, ext 102 > > > > > > > > > > > > --------------------------------------------------------------------- > > > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org > > > > For additional commands, e-mail: users-help@maven.apache.org > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > Ron Wheeler > > > President > > > Artifact Software Inc > > > email: rwheeler@artifact-software.com > > > skype: ronaldmwheeler > > > phone: 866-970-2435, ext 102 > > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org > > > For additional commands, e-mail: users-help@maven.apache.org > > > > > > > > > --089e012284fa497bf504e2230078--