What is the Maven equivalent for Gradle's one-liner to include all JAR files from a library/libraries folder? I.e.,
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
}
I have a set of project to mavenize, and for a average project with approximately50 JAR files in the lib folder, it takes at least half a day for thorough searching on http://mvnrepository.com/, guessing versions and JAR file dependencies looking inside the JAR files, etc. work to solve the technical debt of JAR hell.
The problem is old, and as of July 2017, one can find
- How to include system dependencies in a WAR file built using Maven
- How can I add local JAR files to a Maven project? listing similar answers with their limitations.
New for me were plugins:
addjars-maven-plugin, now dead at https://github.com/kahing/addjars-maven-pluginnon-maven-jar-maven-pluginat https://github.com/stephenc/non-maven-jar-maven-plugin
Thinking over again, the first step to mavenize a project should be to let compiler use existing JAR files and focus on code, not on dependencies (that often has a JAR file put there just for a case, or copied in bulk).
org.apache.maven.plugins
maven-compiler-plugin
lib/*.jar