On 15/12/2010, at 11:58 PM, Hans Dockter wrote: > Hi Graeme, > > On Wed, Dec 15, 2010 at 5:40 AM, Graeme Rocher <groc...@vmware.com> wrote: > Hi, > > I have a pretty simple Gradle build: > > apply plugin:"java" > repositories { > > mavenRepo urls:'http://maven.springframework.org/milestone' > mavenCentral() > } > dependencies { > compile("org.springframework.data:spring-data-redis:1.0.0.M1") { > exclude name:"jredis-anthonylauzon" > } > > try: > > compile("org.springframework.data:spring-data-redis:1.0.0.M1") { > exclude module:"jredis-anthonylauzon" > } > > The exclude property 'name' is not defined. Gradle should throw an exception. > Why you run into this strange behavior when using the name property I don't > know yet.
Looking at the code, it looks like Gradle does no validation of the exclude rule parameters, and just treats them as a map. Then, when actually using the rule, it sets up an 'exclude everything' ivy exclusion and then fills in the group and module, if present. So this means, for example, a typo (such as using 'name' instead of 'module') will exclude everything. I've added http://jira.codehaus.org/browse/GRADLE-1255 > > - Hans > > -- > Hans Dockter > Founder, Gradle > http://www.gradle.org, http://twitter.com/gradleorg > CEO, Gradle Inc. - Gradle Training, Support, Consulting > http://www.gradle.biz > compile 'redis.clients:jedis:1.5.0-RC2' > } > jar.appendix = 'redis' > > > When you run gradle assemble with this build in an empty directory it > downloads the jedis JAR but not the "spring-data-redis:1.0.0.M1" JAR. > This is causing compilation errors in my project. > > The equivalent Maven build works without issue: > > <project xmlns="http://maven.apache.org/POM/4.0.0" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 > http://maven.apache.org/xsd/maven-4.0.0.xsd"> > <modelVersion>4.0.0</modelVersion> > > <groupId>org.codehaus.mojo</groupId> > <artifactId>my-project</artifactId> > <version>1.0</version> > > <repositories> > <repository> > <id>milestone</id> > <name>SpringSource Milestone</name> > <layout>default</layout> > <url>http://maven.springframework.org/milestone</url> > <snapshots> > <enabled>false</enabled> > </snapshots> > </repository> > </repositories> > > <dependencies> > <dependency> > <groupId>org.springframework.data</groupId> > <artifactId>spring-data-redis</artifactId> > <version>1.0.0.M1</version> > </dependency> > </dependencies> > </project> > > > Any clues as to why Gradle doesn't download the dependency? > > Thanks > > -- > Graeme Rocher > Grails Project Lead > SpringSource - A Division of VMware > http://www.springsource.com > > --------------------------------------------------------------------- > To unsubscribe from this list, please visit: > > http://xircles.codehaus.org/manage_email > > > -- Adam Murdoch Gradle Developer http://www.gradle.org CTO, Gradle Inc. - Gradle Training, Support, Consulting http://www.gradle.biz