How do I prevent including JARs in WEB-INF/lib? I need a "compile only" scope!

The scope you should use for this is provided. This indicates to Maven that the dependency will be provided at run time by its container or the JDK, for example.

Dependencies with this scope will not be passed on transitively, nor will they be bundled in an package such as a WAR, or included in the runtime classpath.

How do I list available plugins?

To see a list of available plugins, browse the Maven 2 plugin repository at http://www.ibiblio.org/maven2/plugins/. Plugins are organized according to a directory structure that resembles the standard Java package naming convention. To see a list of available plugins from the Maven project look in the org/apache/maven subfolder of this directory.

How can I use Ant tasks in Maven 2?

There are 3 alternatives:

  • For use in a plugin written in Java, Beanshell or other Java-like scripting language, you can construct the Ant tasks using the instructions given in the Ant documentation
  • You can write your plugin using Marmalade, and use the Ant tasks much like you would from Jelly in Maven 1.0.
  • If you have very small amounts of Ant script specific to your project, you can use the AntRun plugin.
How do I set up Maven so it will compile with a target and source JVM of my choice?

You must configure the source and target parameters in your pom. For example, to set the source and target JVM to 1.5, you should have in your pom :

... org.apache.maven.plugins maven-compiler-plugin 1.5 1.5 ... ]]>
Is it possible to create my own directory structure?

Absolutely yes!

By configuring <sourceDirectory>, <resources> and other elements of the <build> section.

In addition, you may need to change plugin configuration if you are not using plugin defaults for their files/directories.

Where is the source code? I couldn't seem to find a link anywhere on the Maven2 site.

The source code can be found in subversion: http://svn.apache.org/repos/asf/maven/components/trunk.

For more information, see Building Maven 2.0.

Maven can't seem to download the dependencies. Is my installation correct?

You most probably need to configure Maven to use a proxy. Please see the information on configuring settings.xml for how to configure your proxy for Maven.

I have a jar that I want to put into my local repository. How can I copy it in?

If you understand the layout of the maven repository, you can copy the jar directly into where it is meant to go. Maven will find this file next time it is run.

If you are not confident about the layout of the maven repository, then you can adapt the following command to load in your jar file, all on one line.

-DgroupId= -DartifactId= -Dversion= -Dpackaging= Where: the path to the file to load the group that the file should be registered under the artifact name for the file the version of the file the packaging of the file e.g. jar ]]>

This should load in the file into the maven repository, renaming it as needed.