In Maven, is it possible to link additional dependent java src from outside the project folders, so that when we build our main package, maven may include such classes into final jar?
just as we can link any source folder to our project in Eclipse and eclipse treats it as regular project source?
External dependencies (library jar location) can be configured in pom. xml in same way as other dependencies. Specify groupId same as the name of the library. Specify artifactId same as the name of the library. Specify scope as system.
Contrary to what people have said here, you can put an external jar in a folder under your checked-out project directory and haven Maven find it like other dependencies. Here are two crucial steps: Use "mvn install:install-file" with -DlocalRepositoryPath. Configure a repository to point to that path in your POM.
In Maven, is it possible to link additional dependent java src from outside the project folders
Technically, it's possible to add source folders to a build and this is usually done using the build-helper-maven-plugin. However, I would recommend against doing so for directories outside a given module, a maven module should be self contained.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With