To use Commons Codec in a Maven 2 project, add the following
dependency to your project's pom.xml
:
Example 2.1. Adding a Dependency on Commons Codec
<dependency> <groupId>commons-codec</groupId> <artifactId>commons-codec</artifactId> <version>1.3</version> </dependency>
If you are not sure what this means, I'd suggest reading Maven: The Definitive
Guide. When you depend on a library in Maven 2, all you need to
do is add the dependency groupId
,
artifactId
, and version
to your
project's dependencies. Once you do this, Maven 2 will download the
dependency and make it available on your project's classpath.
The Commons Codec library is a small library, which includes
encoders and decoders for common encoding algorithms, such as Hex
, Base64
; and phonetic encoders, such as
Metaphone
, DoubleMetaphone
, and Soundex
. This tiny component was created to
provide a definitive implementation of Base64
and Hex
, encouraging reuse and reducing the amount
of code duplication between various Apache projects.
To learn more about Commons Codec, visit the Commons Codec project at http://commons.apache.org/codec/.