Well anyways, I got it working, so I figured I may as well put it here. You must be using Maven 2.0.10, the version I tested this method on. If you use other versions, you'll get weird exceptions that are geared toward making you cry instead of cluing you in that you have a version mismatch.
- The obvious first step is to set up an FTP server.
- Make sure your ~/.m2/settings.xml contains information about your server. Look at this for an example:
<settings> <servers> <server> <id>your.server.com</id> <username>username</username> <password>password</password> </server> </servers> </settings>
- Search Google for the following jars on repo1.maven.org:
- Type the ridiculously long command found on this page. Here's an example:
mvn deploy:deploy-file \ -DrepositoryId=your.server.com \ -DgroupId=mygroup \ -DartifactId=myartifact \ -Dversion=1.0 \ -Dpackaging=jar \ -DgeneratePom=true \ -Durl=ftp://your.server.com \ -Dfile=somejar.jar
Make sure the repositoryId matches the id you have set in your settings.xml or you will get a NullPointerException (instead of some sort of authentication error, of course).
- Pray to various gods.
- Hopefully, it worked!
UpdateI recently had to deal with this scenario again. As it turns out, Maven 2.0.9 from the Debian repositories worked fine; I didn't have to grab any extra jars or whatnot, and I used scp instead of ftp in my settings.xml too:
<mirrors> <mirror> <id>maven.lousycoder.com</id> <name>LousyCoder Maven Repository</name> <url>scp://email@example.com:/var/www/maven.lousycoder.com/</url> <mirrorOf>maven.lousycoder.com</mirrorOf> </mirror> </mirrors>
On top of that, I also made a little deployment script to avoid having to type that really really long arse command.