I tried gluonmobile 4.1.0 and 4.2.0, when I run the "debug" task(Tasks/application/debug), it just blocks:
Executing external task 'debug'...
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:compileDesktopJava UP-TO-DATE
:processDesktopResources UP-TO-DATE
:desktopClasses UP-TO-DATE
:debug
Listening for transport dt_socket at address: 5005
(Blocking forever....)
In Eclipse e.g. you can create a Debug Configuration of type Remote Java Application which will be attached to the corresponding socket:
After you have started the gradle task debug you then have to start the Debug Configuration.
Related
Using gitlab CI, can not reach to sonarqube server.
I have opened the firewall on port 9000 but can not solve the problem. Also try with replacing "localhost" with ip address
The yml file for gitlab ci -
variables:
SONAR_URL: "http://localhost:9000"
SONAR_LOGIN: "admin"
SONAR_PASSWORD: "admin"
image: gradle:latest
build:
stage: build
script:
- bash ./gradlew sonarqube -Dsonar.host.url=$SONAR_URL -Dsonar.login=$SONAR_LOGIN -Dsonar.password=$SONAR_PASSWORD
only:
- master
The output from Gradle:
Starting a Gradle Daemon (subsequent builds will be faster)
> Task :compileJava
> Task :compileGroovy NO-SOURCE
> Task :processResources NO-SOURCE
> Task :classes
> Task :compileTestJava
> Task :compileTestGroovy NO-SOURCE
> Task :processTestResources NO-SOURCE
> Task :testClasses
> Task :test
> Task :sonarqube FAILED
SonarQube server [http://localhost:9000] can not be reached
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':sonarqube'.
> Unable to execute SonarQube
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 28s
4 actionable tasks: 4 executed
I am pretty new to gradle.
I am trying to do a simple tutorial on junit5 and gradle (https://www.petrikainulainen.net/programming/testing/junit-5-tutorial-running-unit-tests-with-gradle/). Everything works fine when i do "./gradlew test". However, doing it the second time it gives me
$ ./gradlew test
:compileJava NO-SOURCE
:processResources NO-SOURCE
:classes UP-TO-DATE
:compileTestJava UP-TO-DATE
:processTestResources NO-SOURCE
:testClasses UP-TO-DATE
:junitPlatformTest UP-TO-DATE
:test SKIPPED
I was under the impression that ./gradlew test should run all my tests. Why is their execution being skipped?
Thanks
It's being skipped because you just ran the tests, didn't change anything to the inputs or the outputs of the task, and running the tests again is thus unnecessary: the result will (or at least should) be identical.
See the documentation.
I am trying to run this simple example
https://github.com/gradle/oreilly-gradle-book-examples/tree/master/web-hello-world
after cloning the repo,
cd oreilly-gradle-book-examples/web-hello-world
gradle JettyRun
Seems to be working fine
compileJava UP-TO-DATE
:processResources NO-SOURCE
:classes UP-TO-DATE
> Building 75% > :jettyRun > Running at http://localhost:8080/web-hello-world
When I access that URL though, I simply get
Directory: /web-hello-world/
web.xml 555 bytes Jul 30, 2017 4:55:48 PM
so the servlet code isnt being called.
Using Gradle 3.4.1
Any idea?
Thanks!
I’m using Gradle 2.7 on Mac Yosemite. When building my WAR, assuming all the tests pass and assembly of the war is successful, I’d like to copy my WAR to my local $CATALINA_HOME/wbeapps directory. So I have defined this in my build.gradle script:
task deployToTomcat(type: Copy) {
from war.archivePath
into "$System.env.CATALINA_HOME/webapps"
}
build.dependsOn deployToTomcat
When I run gradle build I can see that the task is run, but nothing appears in my $CATALINA_HOME/webapps directory. Here is the output:
davea$ gradle build
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:war UP-TO-DATE
:assemble UP-TO-DATE
:compileTestJava UP-TO-DATE
:processTestResources UP-TO-DATE
:update
liquibase-plugin: Running the 'main' activity...
INFO 10/28/15 2:11 PM: liquibase: Successfully acquired change log lock
INFO 10/28/15 2:11 PM: liquibase: Reading from cbc_db.DATABASECHANGELOG
INFO 10/28/15 2:11 PM: liquibase: Successfully released change log lock
Liquibase Update Successful
liquibase-plugin: Running the 'test' activity...
INFO 10/28/15 2:11 PM: liquibase: Successfully acquired change log lock
INFO 10/28/15 2:11 PM: liquibase: Reading from PUBLIC.DATABASECHANGELOG
INFO 10/28/15 2:11 PM: liquibase: Successfully released change log lock
Liquibase Update Successful
:testClasses
:test UP-TO-DATE
:check UP-TO-DATE
:deployToTomcat UP-TO-DATE
:build UP-TO-DATE
Does “UP-TO-DATE” mean it was run? How can I force the task to run?
Edit: In response to the answer given, I changed my task. The WAR file gets copied to a folder named "null/webapps" in the same directory as my "build.gradle" file. Here is the output
davea$ echo $CATALINA_HOME
/opt/apache-tomcat-6.0.44
davea$ gradle build
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:war UP-TO-DATE
:deployToTomcat UP-TO-DATE
:assemble UP-TO-DATE
:compileTestJava UP-TO-DATE
:processTestResources UP-TO-DATE
:update
liquibase-plugin: Running the 'main' activity...
INFO 10/29/15 9:09 AM: liquibase: Successfully acquired change log lock
INFO 10/29/15 9:09 AM: liquibase: Reading from cbc_db.DATABASECHANGELOG
INFO 10/29/15 9:09 AM: liquibase: Successfully released change log lock
Liquibase Update Successful
liquibase-plugin: Running the 'test' activity...
INFO 10/29/15 9:09 AM: liquibase: Successfully acquired change log lock
INFO 10/29/15 9:09 AM: liquibase: Reading from PUBLIC.DATABASECHANGELOG
INFO 10/29/15 9:09 AM: liquibase: Successfully released change log lock
Liquibase Update Successful
:testClasses
:test UP-TO-DATE
:check UP-TO-DATE
:build UP-TO-DATE
BUILD SUCCESSFUL
Total time: 0.865 secs
There's no need to force task to be run. Instead please configure the tasks appropriately:
task deployToTomcat(type: Copy) {
from war.outputs
into "$System.env.CATALINA_HOME/webapps"
}
war.finalizedBy deployToTomcat
archivePath defines the path where war will be placed but to get the war you need to use task's outputs property.
finalizedBy runs given task always after the tasks it finalizes. In this particular case this guarantees that the artifact being built will be prepared.
UP-TO-DATE means that the task wasn't run. It had nothing to do.
I am trying to generate groovydocs in gradle script using command gradle groovydoc. I can see the command executed successfully as below:
Dynamic properties are deprecated: http://gradle.org/docs/current/dsl/org.gradle.api.plugins.ExtraPropertiesExtension.html
:compileJava UP-TO-DATE
:compileGroovy UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:groovydoc UP-TO-DATE
BUILD SUCCESSFUL
But I don't see any API generated in the file system. What am I missing here?
Given the information you provide, it's impossible to say. We'd have to see the build scripts, output of gradle -v, etc. The first line of output indicates that you may have misspelled a configuration property in the build script. Recent versions of Gradle will print the property in question. If you get the UP-TO-DATE even for gradle clean groovydoc, it's a clear sign that something isn't configured correctly.