I want to include one .jar file which has classes of my core automation framework. I created a "lib" folder in my selenium project and then gave its path in the pom.xml dependency. This Jar file of framework is not a runnable jar. I exported the framework project as a jar and want to use its classes in my project.

However, im not able to use any class/method from that jar(framework) in my test scripts. Am i doing something wrong.

enter image description here

enter image description here

1 Answer 1


Try changing this line in your pom.xml:




Do confirm is it works.

  • NO, this does not work. I cant use my classes from jar. Not sure what's the issue? :/
    – harry234
    Feb 3 at 7:34
  • Do i need to use something like Maven assembly plugin or else. I dont want to use classes directly in a package, i want to just use a .jar file.
    – harry234
    Feb 3 at 7:38
  • You mean for using classes from a Jar file included in the configure build path? Feb 3 at 7:43
  • Yes. Do i need to add the jar to the build path or only in pom.xml?
    – harry234
    Feb 3 at 7:46
  • I have added jar in the build path as well. Still project doesnt recognise the classes inside the jar file. Am i doing something wrong here?
    – harry234
    Feb 3 at 7:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.