Maven 2 NetBeans Plugin Installation Howto
This howto provides several options for installing the Maven 2 NetBeans module.
Prerequisites
- Make sure that you have NetBeans 5.0 Beta installed (or some NetBeans 5.0 development version).
- Make sure that you have the latest version of Maven 2 installed. (Probably beta-3.)
Installation Option #1
The first way to get it done is by adding a "mirror" of the central Maven 2 repository to your settings.xml file:
<mirror> <id>agilejava-mirror</id> <name>Agilejava Mirror</name> <url>http://agilejava.com/maven/</url> <mirrorOf>central</mirrorOf> </mirror>
If you now go to a directory containing a project for which you need NetBeans support, you simply type m2 netbeans:netbeans. This will at least download the meta files and poms of the NetBeans plugin. You may however discover that it fails to resolve all depedencies. That's because agilejava.com is not really a mirror of the central Maven 2 repository. So you may for example discover that it attempts to download stringtemplate-2.2.jar, which doesn't exist in the agilejava repository.
The only way that I can think of to solve this is to go back and forth between a version of the settings.xml that does contain the mirror definition and a version that does not contain the mirror information. But I would be happy to hear about other solutions.
Installation Option #2
An alternative approach is to create a mirror yourself, using maven-proxy. Maven-proxy allows you to create a mirror yourself, which is nothing but a thin virtualization layer on top of existing Maven repositories. The cool thing about is that you can set your mirror properties in your settings.xml file. If you add your own local maven-proxy instance as a mirror, and configure it to use both the agilejava repository as well as the central repository, then it will correctly download all of the missing files.
The big disadvantage is of course that you would need to install maven-proxy.
Installation Option #3
Download the files manually from agilejava.com. Not sure if this works. I haven't actualy given it a try, but I don't see why you wouldn't be able to make all of the required modifications to your local repository yourself.
( Oct 14 2005, 11:52:32 AM CEST ) Permalink Comments [1]Maven 2 NetBeans Plugin Distribution Hassle
Yesterday, I said there was only one thing that I didn't like about Maven 2, which had something to do with Eclipse. Today, I think I can add a couple of other things.
I just went through a tremendous amount of effort to make sure that my plugin can be installed on somebody else's laptop. Whew! That wasn't easy at all!
Uploading to the Maven 2 Repository
First of all, I would really like the NetBeans plugin to end up in the maven-components subversion repository. This is where all of the other default plugins reside, like the maven-javadoc-plugin and the maven-eclipse-plugin. I sent out a message yesterday to the mailing list, trying to figure out how to get it uploaded, but I didn't get any response at all. (This may have something to do with the fact that Maven 2 RC1 is about to be released....)
Installing from other repository
So I can't get things uploade in time in the Maven 2 repository at http://www.ibiblio.org/maven2/. The first alternative seemed to be to just upload it to another repository.
Uploading
But which repository. I figured that I would use my own, hosted at http://agilejava.com/maven/. I had used ftp support in Maven 2 before, so I changed the pom.xml to include the repository location, and did a m2 deploy. What the...?!! It appears that wagon-ftp is no longer activated in the Maven 2 distribution, so that didn't work at all.
Since Maven didn't help me anymore and LunarPages doesn't give me scp support, I ended up doing it manually. I didn't have a proper FTP client though, so I first needed to build gFTP. *sigh*
It seemed that the only way to do this properly was to call m2 release:prepare and m2 release:perform first, but it appears that this plugin no longer works with anyhting else than subversion. And I don't have subversion either. I *did* consider building subversion especially for this purpose, but I got control of myself just before I started. Heck, let's just skip making an official release.
Downloading
Remember that the ultimate goal of this entire excercise is to allow other people to install the plugin. The first time I gave it a try, it didn't work. I removed the relevant artifacts from my local repository, and invoked m2 netbeans:netbeans. Maven correctly downloaded the meta data associated to this plugin, but then for some reason concluded that it couldn't find an appropriate version of the plugin.
It began to feel like I wasn't going to end up anywhere at all... I looken into the repository, and noticed that there were now two different meta data files. One 'downloaded' from central (http://www.ibiblio.org/maven2) and another with a trailing keyword indicating that it was downloaded from my own host. I assumed that it was because of these two files that Maven lost track of what it was doing.
So maybe I should fool Maven in thinking that it downloaded the file from the central server. It took me half an hour to install and configure maven-proxy. Maven-proxy sits between Maven and your own local and remote repositories. It makes Maven believe that it is accessing a single repository, whereas in reality it is just accesssing your hard drive.
When I finally got it working correctly, it did download the files, but it still failed to proceed.
.......
I'm skipping over some of the other things that I've tried. Eventually I noticed that my own maven-metadata-central.xml file was missing <release> tag. In the end, it appeared that everything worked just fine when I added this tag. Darn. It took me about the entire morning, installation of a myriad of tools, examining network traffic with Ethereal and downloading the Maven sources to get it done.
Any way, it works - in some sense..... I'll add a quick installation howto in a minute.
Java Maven ( Oct 14 2005, 11:17:44 AM CEST ) Permalink Comments [2]


