What is maven equivalent for gradle's one-liner to include all jars from lib(s) folder? i.e. :
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
}
I have a set of project to mavenize, and for a average project with ~50 jar in lib
folder, it takes at least half a day for thorough searching on http://mvnrepository.com/ , guessing versions and jar dependencies looking inside jar etc work to solve technical debt of jar hell.
The problem is old, and as of July 2017, one can find
- How to include system dependencies in war built using maven
- How to add local jar files in 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-plugin
- non-maven-jar-maven-plugin
at 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 jars an focus on code, not on dependencies (that often has jar put there just for a case, or copied in bulk)
<!-- THIS DOES NOT WORK -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<includes>
<include>lib/*.jar</include>
</includes>
</configuration>
</plugin>