Creating Custom Maven Remote Repository Using Third Party Jars
Some of the third party jar which doesn’t have maven artifacts for that we can create maven dependency and make it available remotely using github kind of public repositories.
use below command to install that jar as a local maven artifact
STEP-1 : installing into local repository
$/>mvn install:install-file -Dfile=sfs2x-client-core.jar -DgroupId=org.gotoandplay.smartfox -DartifactId=sfs2x-client-core -Dversion=1.0 -Dpackaging=jar -DgeneratePom=true -DcreateChecksum=true
above command will install maven artifact into local maven repository by default it will be under Users/{username}/.m2/repository folder.
STEP-2 : creating remote repository
create public git repository (in this tutorial we used github.com) .
create one organization as shown in the link https://github.com/go2andplay
create repository https://github.com/go2andplay/smartfox-dev
clone this repository into your local drive
using $/>git clone https://github.com/go2andplay/smartfox-dev.git
STEP-3 : copy local maven artifact into this git repository and commit
git add .
git commit -m ‘write you comment’
git push origin master
STEP-4 : finally you need add this repository into pom.xml
NOTE: you need to add raw representation of the URL. for github.com it is https://raw.githubsercontent.com
that you can find using raw button on the specific file.
STEP-5 : add dependencies like any other maven dependencies
Comments
Post a Comment