I’m having a strange issue with gradle. My build task is working with version 1.0-milestone-2, but is not working with version 1.1.
In my project I have the following build.gradle:
apply plugin: 'java'
apply plugin: 'eclipse'
version = '1.8-SNAPSHOT'
manifest.mainAttributes("Main-Class": "br.com.caelum.tubaina.Tubaina",
"Class-Path": "lib/commons-logging-1.1.1.jar lib/commons-codec-1.4.jar lib/commons-cli-1.1.jar lib/gson-2.1.jar lib/commons-io-1.3.1.jar lib/httpclient-4.1.3.jar lib/httpcore-4.1.4.jar lib/freemarker-2.3.10.jar lib/jai_codec.jar lib/jai_core.jar lib/jai_imageio.jar lib/java2html-5.0.jar lib/log4j-1.2.12.jar lib/Tidy.jar lib/jericho-html-3.1.jar lib/itext-2.1.7.jar lib/xstream-1.4.2.jar lib/xmlpull-1.1.3.1.jar lib/xpp3_min-1.1.4c.jar")
[compileJava, compileTestJava]*.options*.encoding='UTF-8'
task zip(type: Zip) {
from "$buildDir/libs"
into('lib') {
from configurations.runtime
}
into('etc') {
from "etc/"
}
into('templates') {
from "templates/"
}
}
repositories {
mavenCentral()
mavenRepo urls: 'https://repository.jboss.org/nexus/content/groups/public/'
}
dependencies {
compile group: 'net.htmlparser.jericho', name: 'jericho-html', version: '3.1'
compile group: 'de.java2html', name: 'java2html', version: '5.0'
compile group: 'log4j', name: 'log4j', version: '1.2.12'
compile group: 'commons-io', name: 'commons-io', version: '1.3.1'
compile group: 'commons-cli', name: 'commons-cli', version: '1.1'
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.1.3'
compile group: 'org.freemarker', name: 'freemarker', version: '2.3.10'
compile group: 'com.sun.media', name: 'jai_codec', version: '1.1.2_01'
compile group: 'javax.media', name: 'jai_core', version: '1.1.2_01'
compile group: 'com.sun.media', name: 'jai_imageio', version: '1.0_01'
compile group: 'com.google.code.gson', name: 'gson', version: '2.1'
compile group: 'com.lowagie', name: 'itext', version: '2.1.7'
compile group: 'com.thoughtworks.xstream', name: 'xstream', version: '1.4.2'
testCompile group: 'junit', name: 'junit', version: '4.+'
testCompile group: 'org.mockito', name: 'mockito-all', version: '1.9.0'
compile files(fileTree(dir:"$projectDir/lib" as File, includes: ['*.jar']))
}
Using gradle-1.1, I get the following error:
csokol@clockwork:~/tmp/tubaina (master)$ ~/downloads/gradle-1.1/bin/gradle build
The 'urls' property of the RepositoryHandler.mavenRepo() method is deprecated and will be removed in a future version of Gradle. You should use the 'url' property to define the core maven repository & the 'artifactUrls' property to define any additional artifact locations.
:compileJava
Download http://repo1.maven.org/maven2/net/htmlparser/jericho/jericho-html/3.1/jericho-html-3.1.pom
Download http://repo1.maven.org/maven2/org/apache/httpcomponents/httpclient/4.1.3/httpclient-4.1.3.pom
Download http://repo1.maven.org/maven2/org/apache/httpcomponents/httpcomponents-client/4.1.3/httpcomponents-client-4.1.3.pom
Download http://repo1.maven.org/maven2/org/apache/httpcomponents/project/5/project-5.pom
Download http://repo1.maven.org/maven2/com/google/code/gson/gson/2.1/gson-2.1.pom
Checksum missing at https://repository.jboss.org/nexus/content/groups/public/com/google/code/gson/gson/2.1/gson-2.1.pom.sha1 due to: Could not GET 'https://repository.jboss.org/nexus/content/groups/public/com/google/code/gson/gson/2.1/gson-2.1.pom.sha1'.
Download https://repository.jboss.org/nexus/content/groups/public/com/google/code/gson/gson/2.1/gson-2.1.pom
Download http://repo1.maven.org/maven2/org/sonatype/oss/oss-parent/5/oss-parent-5.pom
Download http://repo1.maven.org/maven2/com/lowagie/itext/2.1.7/itext-2.1.7.pom
Download http://repo1.maven.org/maven2/com/thoughtworks/xstream/xstream/1.4.2/xstream-1.4.2.pom
Download http://repo1.maven.org/maven2/com/thoughtworks/xstream/xstream-parent/1.4.2/xstream-parent-1.4.2.pom
Download http://repo1.maven.org/maven2/org/codehaus/codehaus-parent/3/codehaus-parent-3.pom
Download http://repo1.maven.org/maven2/org/apache/httpcomponents/httpcore/4.1.4/httpcore-4.1.4.pom
Download http://repo1.maven.org/maven2/org/apache/httpcomponents/httpcomponents-core/4.1.4/httpcomponents-core-4.1.4.pom
Download http://repo1.maven.org/maven2/bouncycastle/bcmail-jdk14/138/bcmail-jdk14-138.pom
Download http://repo1.maven.org/maven2/bouncycastle/bcprov-jdk14/138/bcprov-jdk14-138.pom
Download http://repo1.maven.org/maven2/bouncycastle/bctsp-jdk14/138/bctsp-jdk14-138.pom
Download http://repo1.maven.org/maven2/xmlpull/xmlpull/1.1.3.1/xmlpull-1.1.3.1.pom
Download http://repo1.maven.org/maven2/xpp3/xpp3_min/1.1.4c/xpp3_min-1.1.4c.pom
Download http://repo1.maven.org/maven2/org/bouncycastle/bctsp-jdk14/1.38/bctsp-jdk14-1.38.pom
Download http://repo1.maven.org/maven2/org/bouncycastle/bcprov-jdk14/1.38/bcprov-jdk14-1.38.pom
Download http://repo1.maven.org/maven2/org/bouncycastle/bcmail-jdk14/1.38/bcmail-jdk14-1.38.pom
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all dependencies for configuration ':compile'.
> Could not resolve group:commons-io, module:commons-io, version:1.3.1.
Required by:
:tubaina:1.8-SNAPSHOT
> Could not HEAD 'http://repo1.maven.org/maven2/commons-io/commons-io/1.3.1/commons-io-1.3.1.pom'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 1 mins 29.234 secs
While using older versions such as gradle-1.0-milestone-2, it works fine:
:compileJava
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:processResources
:classes
:jar
:zip
:assemble
:compileTestJava
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /home/csokol/tmp/tubaina/src/test/java/br/com/caelum/tubaina/builder/replacer/ListReplacerTest.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
:processTestResources
:testClasses
:test
:check
:build
BUILD SUCCESSFUL
Total time: 41.89 secs
Any ideas of what’s going on?