I'm working with custom jfrog-artifactory maven re...
# gradle
m
I'm working with custom jfrog-artifactory maven repo, when trying to fetch a dependency from it via gradle, it's not resolving the dependency dependencies, I don't think it's even searching for them, what could be the cause? I did defined my custom repo in the buildscript block and on the allprojects block
a
ddn't jcenter recently shutdown?
v
Yea and no. It stays around read-only and will not shut down at all, current statement at least. But that has nothing to do with a custom artifactory instance either. What is the error message you get?
m
It's just the typical "could not find artifact x required by y" error, but usually it prints "searched in the following locations: .." but this time it's not even printing it, although when I'm trying to type the implementation(x) it does resolves it correctly, so maybe it's not even searching in the repo?
a
It sounds like you put it in the buildscript repositories when you wanted it in just repositories (outside of buildscript)
m
I need it in both, for plugins and artifacts
a
And you added it in both?
m
Yep
v
Try running with -i and -s to get more information
c
Did you add the credentials?
m
@Vampire ModuleVersionNotFound: Could not find io.cucumber:cucumber-core Required by io.cucumber:cucumber-java This is just one example, it has this error on each dependency, although when I am specifically adding this dependency to the build.gradle file it finds it without any issue
@corneil Yes, it does find and downloads artifacts from the artifactory but seems like it has issues with some of the dependencies
v
Well, what is the full message? Does it say where it searched for it? Did
-i
give you more pointers? If not, maybe
-d
tells you what is going on.
m
@Vampire I found with -d that it's says "No meta-data file or artifact found for module X in repository maven"
v
And "X" is the dependency or the dependee?
I guess it is the dependee and it does not find the metadata file in the repository, either because they are missing and you have only the JARs in there, or because the repository in the Gradle scripts is defined to look only for artifacts or only for other metadata files
m
well, it does exists there because I can fetch it from the repo when I'm declaring it on the gradle.build file
And I've deployed with the internal pom, maybe the internal jar's pom is defected?
v
If you declare it in the build.gradle file, it finds it because if no metadata file (gradle module metadata, maven pom, ivy xml - as configured when declaring the repository or according to defaults) is found, it looks for the actual artifact, so it finds the jar and uses it. But without the metadata file Gradle has no information about the dependencies and so cannot pull them in.
What is wrong is hard to tell without being hands-on
Maybe you even have the metadata files present in artifactory, and also configured Gradle correctly, but you have some access rules which denies the http request that tries to download the metadata file
could be many reasons and is just guesswork from here
m
I will try then to deploy the jars with the exact pom file attached to it and not the internal jar's pom
@Vampire HI again, I've tried to deploy the jars with their pom.xml files as maven artifacts in the correct path this time and still, the same issue occurs, I really have no clue why it isn't even trying to search for it in the repo because it does exists there
Here is the issue log in debug level
v
Ah well, my guess does not fit as you didn't properly answer my question. I asked whether
X
is the dependency (
cucumber-core
) or the dependee (
cucumber-java
) and gave a possible explanation if it is the dependee. But
X
is the dependency, so it doesn't fit and actually I slighty misread the message.
cucumber-java
does actually have metadata referencing
cucumber-core
, but for
cucumber-core
neither artifact nor metadata is found as it seems. If I do this, it tells me exactly in the debug log which URLs it tries to GET and so on. I really cannot tell you anything more from the information you provided. Maybe you want to use some network sniffer to see what is going on.
m
@Vampire it actually does exists in the repo (I've deployed the artifact with the actual pom.xml as is from maven central repo) so I don't get it why it's not finding it
c
I don't see version numbers in the error report.
m
Yeah apparently the package does not specify a version number for the dependencies, this is the cucumber-java8-6.10.4.pom that deployed
v
That doesn't look right.
cucumber-java8
is its own parent. While on MC it is
cucumber-jvm
. The versions are probably defined in one of the parent poms, that's a typical setup for Maven projects.
m
@Vampire now it's the right parent and still the same issue, the cucumber-jvm is deployed also btw
v
Well, maybe that pom is also wrong? Gradle is working fine. If you replace your internal repo with Maven Central you will see that. Just get your broken repo fixed or better delete everything and start over cleanly. Can't Artifactory just proxy Maven Central like Nexus can?
228 Views