Reputation: 1447
First off, I am new to build automation and dependency management tools, so please go easy on me!
I am currently working on a proof of concept project using the following assets:
At first I started the project by manually downloading all JARs myself from mvnrepository.com, but after a while it became very complicated and overwhelming to manage all transitive dependencies myself, so here comes the next requirement for the proof of concept: a build automation and dependency management tool.
I work in a corporate environment, so connecting to the internet to download dependencies all the time is not an option. We have to have something internal, and then developers across the enterprise would get their dependencies from it.
We have not yet established our choice between Maven or Gradle yet. Our goal is to use them both and then pick the one we prefer. I know Gradle uses/supports Maven repositories so that's why I have added the Gradle tag in order to get Gradle users attention.
So, I would like to know how to set-up an internal maven repository without a repository manager like Archiva or Artifactory. Every single asset used in my corporate environment must go through a rigorous approval process so I would really like to save some time and focus on Spring and Maven or Gradle.
My proof of concept must run on a Windows environment, so my first idea is to get it to work on a Windows Server with HTTP capability (IIS?). In my pom.xml/build.gradle, I could point to that repository instead of the Maven Central.
Basically, I need to clone the Maven Central structure on my internal repository for everything related to assets listed above. Then, I would convert some internal librairies into Maven or Gradle projects and then publish them to that same repository.
I tried starting a simple Maven project, and then add Spring dependencies to it, followed by the mvn compile command, but I must admit I find it quite difficult to figure out dependencies/folders I need to get from the .m2/repository folder on my local drive. Maven seems to put his own dependencies in that folder so I don't want to bring them uselessly on my internal repository. There is probably a better way to achieve my goal.
Your help and guidance would be much appreciated.
Thank you
Charles
Upvotes: 1
Views: 460
Reputation: 1883
Your .m2/repository
folder is a Maven repository. If you're just working out a proof of concept then you can stick to that local Maven cache. It won't download anything from Maven Central unless it encounters a dependency which it can't find in the cache repo.
If it's important that you have a shareable repository, but it's just for testing/evaluation purposes, then you could even copy that cache repo to a shared drive or something and declare the repository in your pom.xml
using a file://
URL.
Upvotes: 1