Smoother Development with Maven FAQ
Table of Contents
- How to find a pom snippet for a given jar
- How to use a socks proxy
- How to use a HTTP proxy
- How to get code completion in an IDE
- How to make javadoc and sources available to your IDE
- How to set how much memory Maven can use?
- How to run a single test with Maven?
- How to start a an application by running public static void main with Maven?
- How to use apache and codehaus snapshot repos?
How to find which jar a class belongs to
jarFinder or javacio.us/jarhoo
How to find a pom snippet for a given jar
Places to start:
How to use a socks proxy
Set up a SSH tunnel to a server somewhere:
and use 6655 as socks port.
Linux (bash):
Windows:
How to use a HTTP proxy
How to get code completion in an IDE
Add the following to settings.xml.
How to make javadoc and sources available to your IDE
Eclipse:
IntelliJ IDEA:or
If you use pom.xml to open your IDEA project, then javadoc and sources under ~/.m2/repository are automatically available. To download sources to ~/.m2/repository click Download artifacts in IDEA's Maven panel.
How to set how much memory Maven can use?
Linux (bash):
Windows:
How to run a single test with Maven?
Use the Surefire plugin for running a single test class.
How to start a an application by running public static void main with Maven?
Use the exec plugin to start applications with a main method.
How to use apache and codehaus snapshot repos?
- Inherit from objectware-parent
- Add them to a profile in settings.xml and use with -Papache or -Pcodehaus
It is not recommended to put these repositories directly in pom.xml, because they cannot be used in a final release. (And we do not want to support habits that adds yetAnotherThingToRemember before a release.)