Comments (13)
You are running into a "limitation" of how Gradle handles classpaths for different contexts, my guess.
- The
deployment.gradle
has its own build script classpath compared to the rootbuild.gradle
file. You have a lot of use of script plugins where one script plugin calls another one. I'd try to get rid of that. Each of them have their own classpath. - The concept of a script plugin isn't necessarily recommended to be used anymore by Gradle. You should implement the plugin as a binary plugin under
buildSrc
. - There's also this weird mismatch in behavior between the
buildscript
andplugins
notation in Gradle especially if you are importing classes. - I would apply the code for deployment only to the
web
subproject. That's the only place where this is really relevant.
Sorry, I can't give you any concrete "fix" or guidance. I simply don't have the time for it. I'd recommend asking about this on the Gradle forum or community Slack channel. Personally, I'd try to move the build code to where it belongs first without the use of script plugins. Then as a next step, implement the logic as binary plugins under buildSrc
. There's still the possibility that the Sonarqube plugin messes with the build script classpath somehow but I'd need to look their source code.
from gradle-cargo-plugin.
@Vampire No worries. This was more of a general statement to community. Thanks!
from gradle-cargo-plugin.
I'd need to see a full example to see what's going on here. Can you put together a GitHub repository that reproduces the issue and doesn't point to your internal binary repository? Make sure to check in your Gradle wrapper.
from gradle-cargo-plugin.
here is a project that reproduces the problem: https://github.com/morayKevin/cargo_bug
I am currently using gradle 6.x but I have the same problem with gradle 7.x. I didn't test with gradle 8.x
in the master branch, the cargo plugin "works"
gradle undeployFromGlassfish -Pbranch=environment/test -PuserLogin=login -PuserPassword=password
I get an error from the cargo plugin just normal:
> java.lang.IllegalStateException: error submitting remote command
and displaying classpath gives this:
Cargo classpath : configuration ':cargo'
in the bug branch, I added the sonarqube plugin, the cargo plugin don't works
gradle undeployFromGlassfish -Pbranch=environment/test -PuserLogin=login -PuserPassword=password
I get an error with the classpath:
No value has been specified for property 'classpath'.
and displaying classpath gives this:
Cargo classpath : null
I hope it can help you
from gradle-cargo-plugin.
Do me a favor and check in the Gradle Wrapper with the version you are using for your project. I am already using Gradle 8 which your project isn't compatible with anymore. A couple of things you should address up-front:
- The
compile
configuration has been replaced withimplementation
. Theruntime
configuration has been replaced withruntimeOnly
. - You are configuring an internal Gradle class:
org.gradle.internal.logging.services.DefaultLoggingManager.setLevel()
. Internal Gradle classes should not be used and can break at any time with a Gradle version upgrade. It does break with Gradle 8. - Why are you configuring the Cargo plugin on the root project. You are not using it there. Then you are configuring it again in subprojects. That's what's likely causing your issues.
from gradle-cargo-plugin.
I am using gradle version 6.9.
I know that if I want to use the 7+ version, I have to replace compile and ...
I did not configure the cargo plugin in a sub-project. the gradles files which is in externalGradles are not part of the project. There is only domain, service, web as a sub-project.
The goal is to have gradle files common to all my projects in order to avoid code duplication. So I have to configure the plugin in the root project for it to work.
And it works, provided you don't add a second plugin.
I can try upgrading to gradle 8.
from gradle-cargo-plugin.
You configure the plugin in deployment.gradle
and the root project. Either way, it is not necessary. And keep in mind that you do add the plugin to the classpath but you do not apply the plugin. That causes the classpath
property of the Cargo tasks not to have a value.
You may think that adding a second plugin is the issue, but it may just cause some evaluation to happen that you don't see otherwise. The real reason is the one above.
from gradle-cargo-plugin.
Ok, i just pushed in the bug branch in order to be compabtible with gradle 8.
I understand your explanation, but I don't see how to solve it?
If I remove from the root project, I get the following error:
Plugin with id 'com.bmuschko.cargo-base' not fount
if I remove it from deployment.gradle I get the following error:
`Could not compile script 'C:\Users\moray\IdeaProjects\cargo_bug\externalGradle\deployment.gradle'.
startup failed:
script 'C:\Users\moray\IdeaProjects\cargo_bug\externalGradle\deployment.gradle': 7: unable to resolve class com.bmuschko.gradle.cargo.convention.Deployable
@ line 7, column 1.
import com.bmuschko.gradle.cargo.convention.Deployable
^
script 'C:\Users\moray\IdeaProjects\cargo_bug\externalGradle\deployment.gradle': 8: unable to resolve class com.bmuschko.gradle.cargo.convention.ContainerProperties
@ line 8, column 1.
import com.bmuschko.gradle.cargo.convention.ContainerProperties
^
script 'C:\Users\moray\IdeaProjects\cargo_bug\externalGradle\deployment.gradle': 9: unable to resolve class com.bmuschko.gradle.cargo.tasks.remote.CargoDeployRemote
@ line 9, column 1.
import com.bmuschko.gradle.cargo.tasks.remote.CargoDeployRemote
^
script 'C:\Users\moray\IdeaProjects\cargo_bug\externalGradle\deployment.gradle': 10: unable to resolve class com.bmuschko.gradle.cargo.tasks.remote.CargoRedeployRemote
@ line 10, column 1.
import com.bmuschko.gradle.cargo.tasks.remote.CargoRedeployRemote
^
script 'C:\Users\moray\IdeaProjects\cargo_bug\externalGradle\deployment.gradle': 11: unable to resolve class com.bmuschko.gradle.cargo.tasks.remote.CargoUndeployRemote
@ line 11, column 1.
import com.bmuschko.gradle.cargo.tasks.remote.CargoUndeployRemote
^
5 errors`
can you tell me what to change?
from gradle-cargo-plugin.
I tried to put the use of the cargo plugin in the web project.
`buildscript {
repositories {
maven {
url = "http://w2016-nexus.fedris.be:8089/nexus/repository/maven-central/"
}
}
dependencies {
classpath("com.bmuschko:gradle-cargo-plugin:2.8.0")
}
}
apply from: System.getenv('GRADLE_UTILS') + '\fedris\deployment.gradle'
apply from: System.getenv('GRADLE_UTILS') + '\fedris\fedrisgwt.gradle'`
and then to use the sonar plugin in the root project. but i still get the same error
`buildscript {
repositories {
maven {
url = "http://w2016-nexus.fedris.be:8089/nexus/repository/maven-central/"
}
maven {
url = "http://w2016-nexus.fedris.be:8089/nexus/repository/plugin-gradle/"
}
}
dependencies {
classpath ("gradle.plugin.io.github.http-builder-ng:http-plugin:0.1.1")
classpath ("org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.4.0.2513")
}
}
apply plugin: 'org.sonarqube'`
from gradle-cargo-plugin.
but if i do the opposite, put sonar in web and cargo in root, it seems ok
from gradle-cargo-plugin.
@bmuschko you can close this, it has nothing to do with your plugin.
It's just the usual classloader fun if someone has the idea to use legacy script plugins.
If you are interested in the full story, see my comment at https://discuss.gradle.org/t/no-value-has-been-specified-for-property-classpath/45212/2.
But you should maybe consider at some point removing the usage of internal convention mapping functionality and replacing it by the proper public APIs. :-) Not that it would have changed anything in this case.
from gradle-cargo-plugin.
@Vampire Thanks, I provided most of your points here: #207 (comment). Happy to accept a PR to change convention mapping as I am not planning to work on it myself at this time. See README.md.
from gradle-cargo-plugin.
I only found this issue after I answered there.
As I'm not even knowing what this plugin is about, don't expect any PRs from me. :-D
from gradle-cargo-plugin.
Related Issues (20)
- Support artifact dependency as alternative to local installer installUrl HOT 7
- Add Option To Set File Mode On Copied Files HOT 2
- Split Out Local Install And Run To Different Tasks HOT 3
- ajp port override not working
- cargoDeployRemote context root HOT 1
- Support using task outputs and configurations as deployables
- Upgrade Plugin to be compatible with Gradle 5.1.1 HOT 1
- Replace org.ajoberstar with newer replacement plugin HOT 1
- Replace custom gradle code with plugins instead HOT 1
- Fix integration tests (or the cargo plugin) to work with gradle 5.1.1 HOT 2
- cargoRunLocal always fail with existing Tomcat installation HOT 6
- Can't dpeloy ear files to Wildfly 10 HOT 4
- gradle syntax how to convert to gradle kotlin script HOT 5
- Gradle 6.0 and NoSuchMethodError getAssembledReader [related to cargo bug 1482] HOT 4
- Adding JARs to the container's classpath as dependencies
- deploy to tomcat subdomain
- Possibility to adjust log level of Cargo internals
- Getting some security alerts after importing Cargo plugin HOT 1
- Glassfish/Payara : deployment order HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gradle-cargo-plugin.