Quite often I’ve cursed Maven for missing the simplest usecase: Being able to place a .jar file in a lib/ directory in the project directory and make Maven use the jar file as if it was part of the dependencies.
The odd thing is that this is both easy and simple to do - if you happen to know every Maven detail. Fortunately there is Google Driven Development (GDD), where I ended up findingthis post.
The post says that if you define a dependency as”system”and add a path, then you are good to go. Here’s what I use to get the latest version of the Rome rss library installed:
<br /><dependency><br /><groupId>rome</groupId><br /><artifactId>rome</artifactId><br /><version>1.0RC1</version><br /><scope>system</scope><br /><systemPath>${basedir}/lib/rome-1.0RC1.jar</systemPath><br /><br /></dependency><br />
Update:I ended up findingthis bugthat says that if you use a system scoped jar then it will not be included in a war file. It seems that the only way around this is create a central repository for your projects and add the jar files there. I wish this was easier.