Upgrading from Gradle 4.0 to 6.1, the com.moowork.glup plugin seems to have vanished. Yet, the https://plugins.gradle.org/plugin/com.moowork.gulp page show that the plugin does exist. The sample code works with the com.moowork.gulp line commented out.
plugins {
id 'java'
id 'maven'
id "com.moowork.gulp" version "1.3.0"
id "nebula.ospackage" version "8.0.3"
}
task testAgain {
println 'Configuration stage'
doLast {
println 'Execution stage'
}
}
Once the offending line is uncommented, the Gradle example fails.
$ ./gradlew -q testAgain
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'example'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not find com.moowork.gradle:gradle-node-plugin:1.3.0.
Searched in the following locations:
- https://plugins.gradle.org/m2/com/moowork/gradle/gradle-node-plugin/1.3.0/gradle-node-plugin-1.3.0.pom
If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
Required by:
project : > com.moowork.gulp:com.moowork.gulp.gradle.plugin:1.3.0
[...]
BUILD FAILED in 1s
What am I missing?
I have a Gradle project set up, which has a buildSrc module inside of it. Inside buildSrc, in build.gradle, I have the following:
dependencies {
compile 'org.codehaus.groovy:groovy-all:2.4.12'
...
}
When trying to do a build for the project, I receive the following error message:
2:07:13 PM: Executing external task 'build --stacktrace'...
:buildSrc:compileJava NO-SOURCE
:buildSrc:compileGroovy FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':buildSrc:compileGroovy'.
> java.lang.ExceptionInInitializerError (no error message)
In the stacktrace, I see the following error:
Caused by: groovy.lang.GroovyRuntimeException: Conflicting module versions. Module [groovy-all is loaded in version 2.4.11 and you are trying to load version 2.4.12
... 15 more
So, when I look at the project structure, I see that the groovy-all-2.4.11.jar is automatically being loaded into the buildSrc module.
If I remove the compile dependency for Groovy in build.gradle, it will work, but is there any way to force the module to use the version of Groovy that I want?
Gradle always applies the default build script to buildSrc project. This script contains following line:
compile localGroovy()
that is how groovy-all-2.4.11 gets in. To override this behaviour, try setting the resolutionStrategy, e.g.:
configurations.compile {
resolutionStrategy {
force 'org.codehaus.groovy:groovy-all:2.4.12'
}
}
but more importantly think, why would you want to build against a groovy version that differs from one available in your plugin's runtime...
I have encountered a problem when creating my gradlew file using the gradle wrapper command. My setup is simple: Ubuntu 14.04 + Java 8 (openjdk version "1.8.0_91") + Gradle 3.0
tutorials used:
https://spring.io/guides/gs/spring-boot/#scratch
https://docs.gradle.org/current/userguide/gradle_wrapper.html
The curious thing of this problem is that the reason why gradle wrapper fails is because the cacerts file or directory is apparently missing - but it's not (see 'check cacerts file/directory' below). Though - and please let me know if this is the issue - it's a link and not the actual file/dir. I don't know if there are any other problems given the missing cacerts error seems to be at the end of a cascade of errors, but any help to debug this would be appreciated.
My relevant files and outputs are listed below.
Cheers
AHL
build.gradle:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.4.0.RELEASE")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'spring-boot'
jar {
baseName = 'gs-spring-boot'
version = '0.1.0'
}
repositories {
mavenCentral()
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
dependencies {
// tag::jetty[]
compile("org.springframework.boot:spring-boot-starter-web") {
exclude module: "spring-boot-starter-tomcat"
}
compile("org.springframework.boot:spring-boot-starter-jetty")
// end::jetty[]
// tag::actuator[]
compile("org.springframework.boot:spring-boot-starter-actuator")
// end::actuator[]
testCompile("junit:junit")
}
issue/error:
org.apache.http.ssl.SSLInitializationException: /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/cacerts (No such file or directory)
check cacerts file/directory:
vagrant#vagrant:/vagrant/BootTutorial$ ll /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/cacerts
lrwxrwxrwx 1 root root 27 Apr 22 13:29 /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/cacerts -> /etc/ssl/certs/java/cacerts
vagrant#vagrant:/vagrant/BootTutorial$
output from running gradle wrapper:
vagrant#vagrant:/vagrant/BootTutorial$ gradle wrapper --gradle-version 3.0 --info
Initialized native services in: /home/vagrant/.gradle/native
Connected to daemon DaemonInfo{pid=21004, address=[61084cbc-02a2-47e1-9f7b-07d285c509b7 port:43425, addresses:[/0:0:0:0:0:0:0:1%lo, /127.0.0.1]], idle=true, lastBusy=1473685805551, context=DefaultDaemonContext[uid=b5dcb202-0edb-4f81-bd5b-bd4b828045a5,javaHome=/usr/lib/jvm/java-8-openjdk-amd64,daemonRegistryDir=/home/vagrant/.gradle/daemon,pid=21004,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]}. Dispatching request Build{id=ac0e688f-bffe-4828-abe8-58f12354dcf6.1, currentDir=/vagrant/BootTutorial}.
Received result org.gradle.launcher.daemon.protocol.BuildStarted#6986852 from daemon DaemonInfo{pid=21004, address=[61084cbc-02a2-47e1-9f7b-07d285c509b7 port:43425, addresses:[/0:0:0:0:0:0:0:1%lo, /127.0.0.1]], idle=true, lastBusy=1473685805551, context=DefaultDaemonContext[uid=b5dcb202-0edb-4f81-bd5b-bd4b828045a5,javaHome=/usr/lib/jvm/java-8-openjdk-amd64,daemonRegistryDir=/home/vagrant/.gradle/daemon,pid=21004,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]} (build should be starting).
The client will now receive all logging from the daemon (pid: 21004). The daemon log file: /home/vagrant/.gradle/daemon/3.0/daemon-21004.out.log
Starting 7th build in daemon [uptime: 39 mins 8.147 secs, performance: 91%]
Executing build with daemon context: DefaultDaemonContext[uid=b5dcb202-0edb-4f81-bd5b-bd4b828045a5,javaHome=/usr/lib/jvm/java-8-openjdk-amd64,daemonRegistryDir=/home/vagrant/.gradle/daemon,pid=21004,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]
Starting Build
Settings evaluated using settings file '/master/settings.gradle'.
Projects loaded. Root project using build file '/vagrant/BootTutorial/build.gradle'.
Included projects: [root project 'BootTutorial']
Evaluating root project 'BootTutorial' using build file '/vagrant/BootTutorial/build.gradle'.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'BootTutorial'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not resolve org.springframework.boot:spring-boot-gradle-plugin:1.4.0.RELEASE.
Required by:
:BootTutorial:unspecified
> Could not resolve org.springframework.boot:spring-boot-gradle-plugin:1.4.0.RELEASE.
> Could not get resource 'https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-gradle-plugin/1.4.0.RELEASE/spring-boot-gradle-plugin-1.4.0.RELEASE.pom'.
> org.apache.http.ssl.SSLInitializationException: /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/cacerts (No such file or directory)
* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.
BUILD FAILED
Total time: 1.391 secs
Received result Failure[value=org.gradle.initialization.ReportedException: org.gradle.internal.exceptions.LocationAwareException: A problem occurred configuring root project 'BootTutorial'.] from daemon DaemonInfo{pid=21004, address=[61084cbc-02a2-47e1-9f7b-07d285c509b7 port:43425, addresses:[/0:0:0:0:0:0:0:1%lo, /127.0.0.1]], idle=true, lastBusy=1473685805551, context=DefaultDaemonContext[uid=b5dcb202-0edb-4f81-bd5b-bd4b828045a5,javaHome=/usr/lib/jvm/java-8-openjdk-amd64,daemonRegistryDir=/home/vagrant/.gradle/daemon,pid=21004,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]} (build should be done).
vagrant#vagrant:/vagrant/BootTutorial$
You are probably hitting a bug that left your symlink to the certs dangling as reported here and here. One suggested solution is to reinstall the ca-certificates-java package. Like this:
$ sudo dpkg --purge --force-depends ca-certificates-java
$ sudo apt-get install ca-certificates-java
I am facing the following problem. I need to build the multi-project, but when I try to add the dependency I got the following error.
Root Project's settings.gradle:
include 'DbServices','HelloWeb'
Root Project's build.gradle:
apply plugin: 'java'
project(':HelloWeb') {
dependencies {
compile (':DbServices')
}
}
DbServices's build.gradle:
apply plugin: 'java'
HelloWeb's build.gradle:
apply plugin: 'java'
However, then I am getting the following error when synchronize with the gradle tasks on Root Project:
Executing command: "tasks"
FAILURE: Build failed with an exception.
Where:
Build file 'D:\MyDeployment\RootProject\build.gradle' line: 21
What went wrong:
A problem occurred evaluating root project 'RootProject'.
Could not find method compile() for arguments [:DbServices] on org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler_Decorated#3b3e3b3e.
Try:
Run with --info or --debug option to get more log output.
Exception is:
org.gradle.api.GradleScriptException: A problem occurred evaluating root project 'RootProject'.
The documentation uses the following syntax:
dependencies {
compile project(':DbServices')
}
The notion of compile dependencies is introduced by the java plugin. Therefore, this plugin has to be applied (to the HelloWeb project) before declaring dependencies. The easiest way to fix this is to move the dependencies block into HelloWeb's build.gradle. Additionally, the project dependency syntax needs to be fixed according to JB Nizet's answer.
I'd like to use both the Gradle project-report and jacoco plugins in my project. To illustrate the problem I'm having though, I opened build.gradle at: gradle-1.7-rc-1/samples/testing/jacoco/quickstart and modified it to be:
apply plugin: "java"
apply plugin: "jacoco"
apply plugin: "project-report"
running a gradle projectReport then gives me the error:
gradle projR
:dependencyReport
:propertyReport
:taskReport FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':taskReport'.
> Could not determine the dependencies of task ':jacocoTestReport'.
Any advice on how to get these two plugins to play nice together would be appreciated (note, they both work independently of each other).
Thanks
Covered by GRADLE-2917, will be fixed in version 1.10 as described in the Gradle Forum