"Could not resolve" is not a useful error message

(Trejkaz (pen name)) #1

With the following build:

apply plugin: 'java'
apply plugin: 'idea'

repositories {

dependencies {
    compile 'net.posick:mdnsjava:2.2.0'


gradle idea

The output I get is:

Could not resolve: net.posick:mdnsjava:2.2.0


I’ll ignore the “build successful” lie, as it has already been mentioned elsewhere and seemingly nobody was interested in fixing it, but the “Could not resolve” error is not particularly helpful because it doesn’t describe the problem, giving me absolutely nothing to go on unless I want to read the debug logs.

The way it is now, I read “Could not resolve” as “Did not resolve”, which is to say, Gradle is doing something wrong, until it can provide evidence to the contrary.

(René Groeschke) #2

Ignoring again your repetitive bad attitude in this forum seeking for help, I don’t understand what you want Gradle to do here? I tries to resolve the dependency and stated that it can’t. I think this is good enough as a default output.

Running your build again with -i (info logging) provides you with the information you’re looking for. You would have seen that Gradle tries to resolve the parent pom of net.posick:mdnsjava:2.2.0 but can’t find it at https://jcenter.bintray.com/net/posick/mdnsjava-full/2.2.0/mdnsjava-full-2.2.0.pom thats why the artifact couldn’t be resolved. Without this parent pom there’s no way to resolve this maven dependency.

In general I think its better to continue for Gradle in this case and generate idea project files without the missing artifacts instead of just breaking the build here.

(Trejkaz (pen name)) #3

What Gradle actually stated was that it couldn’t resolve the dependency “mdnsjava”.

When I actually went to the artifact server manually, I found the dependency there, and say, “well, I was able to resolve it, so I guess Gradle just sucks.” Which, IMO, is an accurate evaluation of the situation.

If the actual problem was with some other dependency, the error message should mention that dependency, not some other one which is fine.

Basically, unhelpful error messages are unhelpful. We shouldn’t have to run with extra logging enabled and comb through more output to figure out the underlying cause for an exception. That’s the build tool’s job. The build tool should do its job, and stop wasting time I should be spending trying to do mine.

And if you think my attitude is repeatedly bad, maybe it’s because I’m forced to use a build tool which wastes more time getting in the way of my work than any amount of time which it could theoretically have saved, had only it worked correctly.

We’re also in disagreement about the failure handling for the idea task. It would be far better for failures to be proper failures, rather than generating an incorrect result. If the problem is you thinking that generating an incorrect result is better, then I don’t know how you can fix that problem.

(Dimitar Dimitrov) #4

I can totally empathize - nobody should be treated like you’ve been. Unfortunately, much too often, good people are forced by the powers that be to use crappy tools.

Your effort is wasted on this forum. Regarding your work situation - I can only suggest that you quit your job and go somewhere where they can really appreciate the value you bring.

(jean_pierre.delouche) #5

What do you suggest javac or maven ?

(Trejkaz (pen name)) #6

The suggestion is just to report the file with the actual issue, so that when the error message is seen, there is enough information to act upon.