Configuring external jars via POM.xml in Maven
Configuring external jars via POM.xml in Maven
Maven uses the concept of Repositories to configure dependencies at run time. In case if required dependency is not available in maven repositorie, You can configure your Maven project in following way to resolve external jars dependency.
Step 1. Add lib folder to the src folder.
Step 2. Copy external jar to the lib folder. (eg. sikuli-script.jar, which is dependent jar for sikuli operations)
Now our project structure should look like the following −
Project
|-> src
|->lib
|-> external Jar
Here what we hae done is to specify your own jars, pom.xml needs to be updated as follow:
This way external jars can be configured via pom.xml.
Best practices to configure external jars to system:
1. Specify groupId same as the name of the library.
2. Specify artifactId same as the name of the library.
3. Specify scope as system.
4. Specify system path relative to the project location.
0 comments