dependencies {
war â$project.group:$project.name:$project.versionâ
}
The default extension is always âjarâ. Youâll have to tell Gradle that youâre looking for a war file, not a jar file by specifying the extension explicitly using â@warâ:
dependencies {
war "$project.group:$project.name:$project.version@war"
}
50.4.1.2. Artifact only notation
As said above, if no module descriptor file can be found, Gradle by default downloads a jar with the name of the module. But sometimes, even if the repository contains module descriptors, you want to download only the artifact jar, without the dependencies. [14] And sometimes you want to download a zip from a repository, that does not have module descriptors. Gradle provides an artifact only notation for those use cases - simply prefix the extension that you want to be downloaded with â@â sign
So the most important thing is to look at the module descriptor in your repository.
Is there any ?
If yes, is it correct ? Is your war file an artifact of this module ?
If no, then the explicit extension notation might help
Let me as well come back to your first post
Could not find method war() for arguments on org.gra dle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler_Decorated@c 1d588
Is this error generated with the code you provided ? Or did you try something else and the error is not here anymore (only you cannot retrieve your artifact) ?
I guess âwarâ is a reserved keyword. You shouldnât name configuration with it. Rather use something that explains what the configurations contains (i.e. myProjectCompile, specificAntLib, etc etc)
Is this the result of resolving your GString â$project.group:$project.name:$project.versionâ ?
In this case, by saying 'â$project.group:$project.name:$project.version@warâ you actually say
I want to retrieve the war file named with the default conventional value, ie web.war
your artifact is probably NOT namef web.war, but something else (non conventional)
in this case you have to use a more explicit dependency definition, such as
dependencies {
war1 "$project.group:$project.name:$project.version" {
artifact {
//useful when some artifact properties unconventional
name = 'someArtifact' //artifact name different than module name
extension = 'war'
type = 'someType' // optional
classifier = 'someClassifier' // optional
}
}
}
What went wrong:
A problem occurred evaluating project â:webâ.
Could not find method quickstart-app:web:1.0() for arguments [build_a0i3qevttf
5dxbfju3veeytsj$_run_closure2_closure10_closure24@129cb02] on org.gradle.api.int
ernal.artifacts.dsl.dependencies.DefaultDependencyHandler_Decorated@fd947e.
The first error which I got. It seems weird!
FYI, This is how my Nexus looks likeâŚ