Thanks for the response Wayne. This was pretty much a learning exercise. I let my misreading of some documentation guide me. Now that you say it, seems pretty obvious now that a third-party plug-in is just like a Maven-provided plug-in, but from another repository. So I need to define the Codehaus mojo repository in my pom and leave maven to sort things out.
Thing is when I read "install:install-file<http://maven.apache.org/plugins/maven-install-plugin/install-file-mojo.html>is mostly used to install an externally created artifact into the local repository, along with its pom. In that case the project information can be taken from an optionally specified pomFile, but can be given using command line parameters" at http://maven.apache.org/plugins/maven-install-plugin/index.html, I took that to mean that this is the "normal" way to do things, and the pom would provide the required details. From what I understand now, I would only use this goal if the artifact wasn't currently available in a repository. Don't think I'll raise any RFEs, I'm quite happy to get things done the right way now that I think I know what it is. I see...! (I thinkl!) On 31/08/2007, Wayne Fay <[EMAIL PROTECTED]> wrote: > > I think this is simply an incorrect assumption on your part. > > I'm not surprised Maven doesn't like URLs specified for install-file. > You are welcome to file an RFE in Jira and perhaps someone will add > that feature, it sounds reasonable. > > Same goes with expecting Maven to get the groupId etc fields out of > the pom rather than specifying them on the command line. That's just > not how it works -- you must specify them. Parsing them out of the pom > file is not a bad idea, so file an RFE and someone will implement it > if it makes sense to them. > > Is there a specific reason you were using the install-file goal rather > than simply configuring a <repository> or adding a dependency and > allowing Maven to download (and install) the plugin automatically? > > In other words, was this a learning experiment, or do you just not > know how Maven works and so you thought this was necessary to install > a plugin due to other incorrect assumptions or perhaps unclear > documentation? You're not the first and certainly won't be the last > person I've seen on this list who was manually downloading and > install-file'ing everything, rather than allowing Maven to do its job, > so I'm guessing there is some missing or unclear documentation > somewhere. > > Wayne > > On 8/31/07, Gary Bauer <[EMAIL PROTECTED]> wrote: > > Hi > > > > I have a question regarding the use of the install:install-file goal for > > instalation of a Codehaus mojo. I managed to install the Cobertura > mojo, > > but I am sure I didn't do it in the intended manner. > > > > From the page > > > http://maven.apache.org/plugins/maven-install-plugin/install-file-mojo.html > > I expected to be able to install the pojo as follows: > > > > mvn install:install-file -Dfile= > > > http://repository.codehaus.org/org/codehaus/mojo/cobertura-maven-plugin/2.1/c > > obertura-maven-plugin-2.1.jar -DpomFile= > > http://repository.codehaus.org/org/code > > haus/mojo/cobertura-maven-plugin/2.1/cobertura-maven-plugin-2.1.pom > > > > But this fails with a message telling me that groupId, artifactId, > packaging > > and version are required. I expected these to be picked up from the > POM. > > > > In the end I had to download the plug-in's jar file manually (because it > > treated the url I specified on the command line as a directory path > relative > > to the directory I was in! ) and open the POM to get the missing > details. > > > > Finally I got it working with: > > > > mvn install:install-file > > -Dfile=c:/mydir/cobertura-maven-plugin-2.1.jar-DgroupId= > > org.codehaus.mojo -Dversion=2.1 -DartifactId=cobertura-maven-plugin > > -Dpackaging=maven-plugin > > > > Obviously this is not the clever way to do it. I guess I just needed > some > > way to specify that I pom and jar locations were urls,not file paths, > but I > > am not sure how. What should I have dome? > > > > Thanks! > > > > Gary > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
