Downloaded artefacts from maven trouble

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Downloaded artefacts from maven trouble

Giovanni
Hello!
I'm currently investigating ways to use Gradle and Artifactory efficiently for my company. I was able to build a few small test programs depending on each other and junit for testing.
One of the things we want to achieve is to have the third party libraries we use on our local Server with Artifactory (so not a mirror from Maven). And this is where some problems came up: junit could not function without hamcrest.
So my first question is:

    Is there a simple way to download an artefact from Maven along with it's dependencies in one go to avoid waste of time and frustration at build time?

But then I downloaded it but to make the build work I had to specify that extra dependency:  
>testCompile 'org.hamcrest:hamcrest-core:1.3'  

But I did not have to do that when using Maven central, only when dealing with my downloaded artefacts on Artifactory.
Obviously, having to do that for libraries with many dependencies would be a pain.  
Has anyone ran into this problem? Is there a way to solve it simply or did I just miss something?  

(btw I wrote a test: program1 depends on program2, which depends on program3, I then built program3 and published it to Artifactory, then program2 and finally program1. I only had to declare it's dependency to program2 for the build to work, there was no problem in that case)  
I hope I was clear enough, thanks in advance!