Building PDFBox from source is only necessary if you're wanting to contribute code to the PDFBox project. Most users should use the binary releases instead.
You can obtain the latest source of PDFBox from our SVN repo. The current trunk is 4.0.0-SNAPSHOT. There is a separate branch for the 3.0.x and the 2.0.x series. You can fetch the latest trunk version using Subversion:
svn checkout http://svn.apache.org/repos/asf/pdfbox/trunk/ cd trunk
You can also browse the Subversion repository using ViewVC.
git clone https://gitbox.apache.org/repos/asf/pdfbox-jbig2.git cd pdfbox-jbig2
Building PDFBox 2.0 requires a JDK with "unlimited strength" cryptography, which requires extra files to be installed. For JDK 7, see Java Cryptography Extension (JCE). If these files are not installed, building PDFBox will fail the following test:
TestPublicKeyEncryption.setUp:70 JCE unlimited strength jurisdiction policy files are not installed
In the root directory of PDFBox:
mvn clean install