MavenTips - shark8me/lenskit GitHub Wiki

Maven tips

The best way to get started with LensKit is to use Apache Maven (or a compatible tool such as Ivy, SBT, or Groovy Grapes) to automatically figure out and download all of the Java jars your project will need. (We recommend using Maven3, at least for experiments, since the lenskit-eval-maven-plugin relies on some Maven3 features.)

These tools are part of the toolchain for expert Java developers. They manage the set of libraries used by a large Java project, helping the developers keep track of which versions of which library they are getting, and automatically downloading the appropriate versions for a new developer. There are some startup costs for learning how to use tools like Maven, but if you want to become an expert Java developer you will be well-rewarded for getting at least a basic working knowledge of one of these tools.

Maven Resources

Running Goals

You can use mvn plugin:goal, where plugin is the name of the plugin and goal the name of the goal, to run arbitrary Maven goals. Goals in Maven are the rough equivalent of tasks or targets in other build systems.

You can also shorten plugin names. If a plugin is named maven-foo-plugin or foo-maven-plugin, you can execute its goal bar with mvn foo:bar.

Configuring Executions

Unfortunately, you cannot run a particular execution (specified in the Maven POM) from the command line. However, running a goal from the command line uses the execution ID default-cli. Customizing this execution in the POM allows you to configure what happens when the goal is run.