background preloader

Maven

Facebook Twitter

A Survival Guide to Maven, OR, Why Maven's Still Cool. The Problem: Confusion I've had a lot of small discussions recently with people where they were just absolutely not interested in using Maven.

A Survival Guide to Maven, OR, Why Maven's Still Cool

Has it somehow gotten a bad reputation when I wasn't looking? Am I missing something? When did I suddenly become the guy using a tool that was too slow, or not agile enough for everybody? I can still sing and dance and jump like you guys, too! So, let old Josh tell you a little bit about Maven. Maven, like this guide, assumes you're trying to solve the 80% cases effectively. I'm pretty confident that your first thoughts on that last sentence were to what Maven considers "80%," and you're probably wondering what you might reasonably call Ant's "80%" cases. I haven't met an Ant build yet that couldn't be cut down in complexity by using Maven. I'm pretty convinced Ant suffers from both of those kinds of complexities. Compiling Java source files into classes copying resources to the right place, such as .XML files, .properties files, etc.

Run Your Own Maven Repository With Nothing but an FTP Server. I hope I’ve demonstrated in the last few posts that Maven is pretty cool, not so scary.

Run Your Own Maven Repository With Nothing but an FTP Server

But the public Maven repositories sometimes leave a bit to be desired. They don’t have entries for every possible library, and occasionally they have incorrect dependencies or other metadata. Also, the process of adding new libraries to the central repositories is somewhat involved. Maybe you want to depend on a project that isn’t in the public repos. Or maybe you want to publish development snapshots of your own projects. Fortunately, running your own Maven repository is dirt simple. Step 1: Get Some Web Space I’m assuming you have a web site somewhere. Using your favorite FTP client, create a directory named maven2 inside your web site directory (public_html in our example). Congratulations, you just created a Maven 2 repository! Check that you can visit in a web browser. Step 2: Configure Your Project Deployment. Maven’s Not So Bad: Further Thoughts on Clojure Package Manageme. Update Sept. 4: How to get the latest builds of Clojure & Contrib Maven is a touchy subject.

Maven’s Not So Bad: Further Thoughts on Clojure Package Manageme

People tend to have strong opinions about it. But like it or not, it’s the de-facto standard for dependency management in the Java world. Clojure lives in the Java world, so that means we have to live with Maven. Here are some good things about Maven: “Convention over configuration.”Plugins are downloaded & installed automatically.Handles dependencies of dependencies.Declarative configuration, not imperative like Ant.Only stores one copy of each JAR, shared by all projects. Here are some bad things about Maven: XML configuration file.Verbose command line options.Doesn’t track latest source code of projects. In my estimation, the good outweigh the bad. So let’s develop a Clojure app using Maven.

Step 1: Install Maven. If you don’t already have it, that is. Step 2: Create a new project. Type the following at the command line: mvn archetype:generate Maven will ask a series of questions: Step 6: Start coding! OSGi With Scala, Java, Groovy, Maven and PAX. In this first installment, I'm going to attempt to walk you through the setup of an OSGi project that is comprised of three OSGi bundles; one for Java, one for Groovy and one for Scala.

OSGi With Scala, Java, Groovy, Maven and PAX

In an effort to keep it simple, I'm going to employ a trivial hello world example in each bundle. The emphasis of this post is to introduce some concepts and illustrate how to get an environment up and running. I'm going to leverage maven and the extremely useful PAX maven plugin to automate much of the grunt setup work, packaging and runtime management. In subsequent posts, I'll show how we can leverage Spring DM to eliminate the OSGi API from our code and I'll show how to get these bundles to actually interact with each other. I think that OSGi has an enormous amount of potential. These technologies are all advancing at a pretty rapid pace, so in an attempt to future-proof this post I'd like to take a quick moment to identify precisely what versions I'm using for these toolsets. 3.cd helloworld.

Maven, another nice idea botched.