This FAQ answers some frequent questions already, please read the Getting Started for a quick start guide.
The Reference section contain a comprehensive user guide and documentation about the various plugins that exist for maven.
If these resources don't help you with your problem, the Maven User List is a good source for help. Lots of problems have already been discussed there, you'll probably find a solution in the mailling list archive. Most of the maven developers are subscribed to the Maven User List.
Maven developers meet via IRC: irc.codehaus.org:6667, channel #maven But please don't ask for solutions to maven problems there, as maven user problems should be discussed at the mailing list for several good reasons (e.g. mail archive, more subscribers) and usually you get a quick answer on the mailing list.
All Maven goals are provided by plugins. For example, the goals jar
and jar:install
are provided by the jar plugin. You can find a list of
plugins and there documentation here.
As of Maven 1.1, external entities will not be supported by default in project.xml, and their use is discouraged in Maven 1.0.x as well.
There are several reasons for this, but the main reason is that the content of project.xml needs to be completely self-contained and and able to be reproduced from a history at any point in time.
For this reason, using jelly expressions other than pom references is also not recommended and likely to be unsupported in future.
The most common use of this technique is to manage dependencies across multiple projects. There is unfortunately no other better solutions in the current version of Maven other than copying the dependencies. See transitive dependencies for more information.
Note: special character entities will always be supported and should not have any current issues.
maven.test.skip
and maven.test.failure.ignore
.
Heed the warnings!
test:test
, the exceptions will usually be output to
./target/test-reports/some.package.SomeClassTest.txt
.
If you want to see the errors in the output, set the property maven.junit.usefile
to
false
.
You can't. However, if you really need it, you can use a snippet in maven.xml:
Please think about the reason you need this, and carefully consider whether it is necessary. Usually this is used for writing plugins that handle source generation.
For example, before starting unit tests you might need to start a DB server. The DB server blocks until it is
terminated, so it needs to be started in the background. <ant:parallel>
does not seem to
work in this case because it blocks the main execution thread, which is exactly what needs to be avoided.
The solution is given in this thread.
Write your own maven plugin. It's not as difficult as you may think it is, and it will probably save you much time when your code grows in size.
Documentation on how to write plugins is available here.
It can also be helpful to refer to the source code for the existing Maven plugins which you already have installed.
Plugin properties can be used with the following tags:
maven:get and
maven:set.
(These replace the deprecated versions of ${pom.getPluginContext(...).get/setVariable()}
and maven:pluginVar
.)
Example:
${maven.junit.fork}
property to
yes
.
cvs [log aborted]: there is no version here; do 'cvs checkout' first
ChangeLog found: 5 entries
When you run the cvs change log report in maven, the report hangs or the final output is blank.
This is typically caused by the cvs command not running correctly. The first port of call is to check maven's output, search the lines containing for "SCM".
Try running the command that you find in the log file manually. The results typically speak for themselves.
A common symptom is that the Jelly or Ant tag are output instead of being processed. See MAVEN-156.
The solution is to add the JAXP system property via the Jelly script.
Also make sure that Xalan is declared as dependencies in your project file:
This problem has been observed when a version of Jelly used as a dependency is different than the one distributed with Maven. This is the version of Jelly that is distributed with Maven 1.0-rc2. If you align your versions of Jelly you should be able to generate your site. We hope to alleviate these problems with real ClassLoader isolation using Classworlds.
Early in RC3, the bug that caused project.properties file inheritance to fail was fixed. This means that if you extend another project.xml file, you also inherit the project.properties and build.properties files from the same directory.
While this was a highly demanded fix, some builds may have come to depend on it not working (including the Maven build itself!). This is usually due to having a master build project that also serves as a base project extended by a set of subprojects, and wanting the properties to apply to the master, but not to the subprojects.
We recommend that you separate these concerns by having both a master build project and a parent project for extension (see the maven-plugins CVS tree for an example).
However, should you need to maintain your old structure, and you are encountering these problems, you can add the following property to stop parents from being inherited:
Because it isn't needed. root.maven
is equivalent to the project classloader.
While root
is the Ant classloader, you should not load tasks into it as it will then force itself
on the other plugins executed afterwards. In particular any jakarta-commons libraries should not be in the
root classloader as these can clash with Jelly.
The correct way to use ant tasks in maven.xml or a plugin is something like:
It has been removed from log4j.properties
. It was always created in the directory Maven was run
from, and only repeated what was on the console in most cases, which was quite annoying. You can now get all
the debugging information you need and more by using the -X flag to maven.
Of course, if you would like to write certain information to a file and piping is not an option or you want greater control over what is controlled, you can override the log4j configuration. Refer to the log4j documentation for how to override this using system properties.