Reputation: 19805
I have a maven-java project and I use git at the same time. Now I need to use some libraries which does not have any maven support. I have the .jar files of the libraries.
How will I add them to my maven project? and.. Will the other people who pull my code from my git repo be able to run my code without having the .jars?
Upvotes: 1
Views: 596
Reputation: 32597
If you have an artifact repository manager such as Nexus, Archiva, or Artifactory, you can deploy the jars to it. Then you can define them as dependencies in your pom.xml
files.
If you don't, you can install them to your local repository using the maven-install-plugin using the install-file
goal.
If you don't want to do that, there's also a not-recommended option of defining a dependency with <scope>system</scope>
as illustrated here. Again, this is highly NOT recommended, as you would be expecting people would have the artifact on their file system and quite possibly, this jar might end up in your version control, which is really not the way to do it, but is also possible.
Upvotes: 3
Reputation: 291
answer is that others will not be able to build your code unless some conditions are met.. As mentioned by carlspring, you would have to either install to your own local repo or put a system scope dependency.
Upvotes: 1