For longer-term tactical work as a team, use a repository manager.For personal work, or moving towards a strategic approach, install locally to.For quick hacks - add it as system-scoped maven dependency.The ultimate short-term hack - add it as a dependency in your IDE.
It is quite a long process, so I won’t describe it here, but I have a full write-up on my blog. This is probably the most strategic long-term approach, but it requires you to make your work public.Īll of the other approaches mentioned allow you to keep your work to yourself. This is a much more strategic approach and is good for teamwork and continuous integration processes. You’ll probably want to evaluate which of the repository management tools works best for you and your environment. Configure the pom.xml to have a section and point to your dependency management tool.jar files are installed into this repository, which is accessible by your team, and CI process, and not just your local development machine. You could install a dependency management tool like Nexus or Archiva. I think this is a good tactical approach that supports a longer-term strategic development of your development and automated execution approach. jar was on a repository manager or in Maven Central. This allows me to keep the pom.xml of my projects that use the. jar (which I usually do), then I add the following argument to the command line: -Dsources=target/
I just add the details from the pom.xml into my command line: mvn install:install-file \Īnd if I want the source code JAR to be associated with the. If I didn’t have the pom.xml file, I could still do this. I have not released the game engine to Maven Central, but the code is available on GitHub, as is a release. Game engine (which is now open source on GitHub).m2 directory and repository.Īnd I use this approach at the moment when working with my RestMud game engine. To have the JAR available as a dependency that I can bring in using a normal maven include, I can install the JAR locally to my. This can be a useful tactic, but I don’t think it really scales strategically, e.g. Ĭ:/Users/Alan/Downloads/selenium-2.53.1/selenium-server-standalone-2.53.1.jar I did this in the past when working with a ‘bug fix’ version of Selenium WebDriver that had not yet propagated through to Maven Central - but was available for download.
Adding It to the Project as a System-Scoped FileĪs a short-term tactic, I have also added the. It isn’t very good for CI or version controlīut it might help you get your immediate work done:Īnd then adopt one of the following approaches if it works.It doesn’t help you work with other people.
I demonstrate this in my free publication Java Desktop Application Technical Testing, and you can read a blog post here containing this information. jar as an IntelliJ project dependency and bypass Maven.
Quick Hack: Adding a JAR as an IntelliJ Project Dependencyįor very quick hacks, add the.