There are several ways to add compiled external classes to a maven project. This method describes the local repository based method.
- In the project directory, create a folder called repo, which we'll use as a folder based Maven repository.
- Create a jar file from the compiled java classes with the following command.
- Deploy the .jar to the file repository, with the following command:
- After adding the jar file to repository it looks as follows.
- Finally add the file repository details and the dependency to your project pom.xml