Wednesday, 20 November 2013

How to include external/user defined jar in pom.xml

Step1:There must be apache-maven-3.0.4 in system.

Step2:Check whether  apache-maven-3.0.4 is present.
Go to command prompt
type mvn press enter.

If there is no apache-maven-3.0.4 we get above image output.

Step3:Download apache-maven-3.0.4 place in any drive.
Go to Computer-->Properties-->Environmental Variable-->path
append path D:\apache-maven-3.0.4\bin.

Go to command prompt
type mvn press enter.

If we have apache-maven-3.0.4 we get above image output. 

Step4:Place all jars in one folder D:\userJars

Step5:open command prompt

mvn install:install-file -Dfile= D:\userJars\sqljdbc4.jar -D groupId=com.microsoft.sqlserver -DartifactId=sqljdbc4 -Dversion=4.0 -Dpackaging=jar
mvn install:install-file -Dfile= D:\userJars\flex-messaging-common.jar -DgroupId=flex -DartifactId=flex-messaging-common -Dversion=0.1.0 -Dpackaging=jar

add all jars in same manner.

Step6:Run it.

Now all jars added to maven in .m2 repository.

No comments: