Closed Hugolarson closed 1 month ago
You need to apply the plugin first before you can use the custom configuration named cargo
it provided.
Thank you for the response.
apply plugin: 'com.bmuschko.cargo' is before cargo and after dependencies
Please do you have a short samle build.gradle?
Thanks
c:\projekt\Cargo-tomcat>gradlew cargoDeployRemote
Task :cargoDeployRemote FAILED
FAILURE: Build failed with an exception.
Could not resolve all files for configuration ':cargo'. Cannot resolve external dependency org.codehaus.cargo:cargo-core-uberjar:1.9.10 because no repositories are defined. Required by: project : Cannot resolve external dependency org.codehaus.cargo:cargo-licensed-dtds:1.9.10 because no repositories are defined. Required by: project : Cannot resolve external dependency org.codehaus.cargo:cargo-ant:1.9.10 because no repositories are defined. Required by: project :
apply plugin: 'com.bmuschko.cargo'
dependencies {
cargo ...
}
Im so sorry. it is like that. Going nuts here.
buildscript { repositories { gradlePluginPortal()
}
dependencies {
classpath 'com.bmuschko:gradle-cargo-plugin:2.9.0'
}
}
apply plugin: 'com.bmuschko.cargo'
dependencies { def cargoVersion = '1.9.10' cargo "org.codehaus.cargo:cargo-core-uberjar:$cargoVersion", "org.codehaus.cargo:cargo-licensed-dtds:$cargoVersion", "org.codehaus.cargo:cargo-ant:$cargoVersion" } cargo { ..... }
I will need to see a full project. Please create a new repository including a Gradle Wrapper that reproduces the issue.
Hi, I'm very new to github but created this. hope it's ok https://github.com/Hugolarson/cargo
You are missing the definition of repositories for the Cargo dependencies, as indicated by the following error message:
Execution failed for task ':cargoRunLocal'.
> Could not resolve all files for configuration ':cargo'.
> Cannot resolve external dependency org.codehaus.cargo:cargo-core-uberjar:1.9.10 because no repositories are defined.
Required by:
project :
> Cannot resolve external dependency org.codehaus.cargo:cargo-licensed-dtds:1.9.10 because no repositories are defined.
Required by:
project :
> Cannot resolve external dependency org.codehaus.cargo:cargo-ant:1.9.10 because no repositories are defined.
Required by:
project :
Add the following to your build script:
repositories {
mavenCentral()
}
Still does not work.
I tried with only mavenCentral(). And with both mavenCentral() and gradlePluginPortal(). still does not work.
buildscript { repositories { gradlePluginPortal() mavenCentral() } dependencies { classpath 'com.bmuschko:gradle-cargo-plugin:2.9.0' } }
You added it to buildscript
but that's not where it goes. It need to be added in the same way I posted it in my previous comment. Please refer to the Gradle documentation for more info on the difference.
Thank you so much. Very weak with gradle and looked every where for a full example but alas could not find any.
Thanks again sir!
Hi,
Im using this build.gradle to deploy remote but I'm getting this error when running.
Could not find method cargo() for arguments [org.codehaus.cargo:cargo-core-uberjar:1.9.10, org.codehaus.cargo:cargo-licensed-dtds:1.9.10, org.codehaus.cargo:cargo-ant:1.9.10] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Don't think there is anything wrong with it hence.
buildscript { repositories { gradlePluginPortal()
}
dependencies { def cargoVersion = '1.9.10' cargo "org.codehaus.cargo:cargo-core-uberjar:$cargoVersion", "org.codehaus.cargo:cargo-licensed-dtds:$cargoVersion", "org.codehaus.cargo:cargo-ant:$cargoVersion" } apply plugin: 'com.bmuschko.cargo'
cargo { containerId = 'tomcat10' port = 443
}