How to install a 3rd party library.
Prepare the 3rd party library
This tutorial will show how to use a third party library as an
maven dependency. I use PHPUnit as an sample 3 party library.
First, download the source code and unzip it. (For example
http://pear.phpunit.de/get/PHPUnit-3.3.9.tar
)
So now create a zip,tar,tgz where the first "source folder" is the
root folder of the zip. At PHPUnit the root folder of the zip should
be PHPUnit not PHPUnit-3.3.9.
Install the library to your local repository.
Than run the install:install goal. For PHPUnit the call looks like.
install:install-file -Dfile=PHPUnit.zip -DgroupId=org.phpunit -DartifactId=phpunit5 -Dversion=3.3.9 -Dpackaging=jar -DgeneratePom=true
Than you can add a dependency in your pom. PHP for Maven will
simple unzip these dependency and add it to your include path.
For more informations visit
Guide to deploying 3rd party JARs to remote repository
at the maven website.
Deploy the library to an remote repository.
To deploy the third party library to an remote repository call mvn
deploy:deploy-file.
mvn deploy:deploy-file -DgroupId=org.phpunit -DartifactId=phpunit5 -Dversion=3.3.9 -Dpackaging=jar -Dfile=PHPUnit.zip -DrepositoryId=Id in your settings -Durl= scp: //