On Fri, Oct 9, 2009 at 20:33, Steve Ebersole <[email protected]> wrote:
OMG, I actually figured one out on my own!  Yaay :)

So actually, the issue was my misunderstanding of the dependency
configurations.  What I need is a configuration that is used for
compilation, but that is not transitive (similar to provided or optional
in Maven).

I had put them in runtime because in reading
http://www.gradle.org/0.8/docs/userguide/userguide_single.html#sec:java_plugin_and_dependency_management
 (specifically Table 18.5) I initially thought that runtime did just that.  
Re-reading it I misunderstood.

So instead of:
dependencies {
   ...
   runtime {
       'javassist:javassist:3.9.0.GA',
       'cglib:cglib:2.2',
       ...
   }
}

I did:
configurations {
   provided {
       description = 'Non-transitive compile classpath elements'
       transitive = false
   }
}

dependencies {
   ...
   provided {
       'javassist:javassist:3.9.0.GA',
       'cglib:cglib:2.2',
       ...
   }
}

sourceSets {
   main {
       compileClasspath = configurations.compile +
configurations.provided
   }
}



On Fri, 2009-10-09 at 20:57 -0500, Steve Ebersole wrote:
I am having no luck defining secondary Maven repositories.  Most JBoss
projects for example will need to simultaneously access the Maven
central repository as well as the JBoss repository.  So I tried the
following:
subprojects {
    ...
    repositories {
        mavenCentral()
        mavenRepo urls: "http://repository.jboss.com/maven2";
    }
    ...
}

I have also tried:
subprojects {
    ...
    repositories {
        mavenRepo urls: "http://localhost:8081/artifactory/repo/";
    }
    ..
}
where that URL is a local instance of artifactory I run on my machine.

I have tried a few other variations as well.  Yet no matter what, my
compilations end up failing because of not being able to find classes
which should be in jars coming from this JBoss repository.  Heck, the
artifacts should already be in my local Maven repository
(~/.m2/repository), though was not sure how/if Gradle interacted with
that.

So am I doing something wrong here?  I thought I was following
http://www.gradle.org/0.8/docs/userguide/userguide_single.html#sec:repositories 
pretty closely.

--
Steve Ebersole <[email protected]>
Hibernate.org


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email




Hm. The compile configuration is already non-transitive, what you did should 
have worked (and I've had it work just for me in the past as well):

21 repositories {
22     mavenCentral()
23     mavenRepo urls: 'http://repository.jboss.org/maven2'
24 }

I'd have to see what you're doing differently there Steve, maybe we should put 
this up on svn or github or something :)

--
Jason Porter
Real Programmers think better when playing Adventure or Rogue.

PGP key id: 926CCFF5
PGP fingerprint: 64C2 C078 13A9 5B23 7738 F7E5 1046 C39B 926C CFF5
PGP key available at: keyserver.net, pgp.mit.edu

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to