Hi Steve,

On Mar 29, 2009, at 7:01 PM, Steve Appling wrote:

I am attempting to use a custom configuration to resolve the artifacts from another project in a multi-project build as follows:

In proj3 -
  dependencies {
  //... clipped normal compile dependencies.
  //    Including declaring a company internal maven repo ...
      compile project(':proj1')

      addConfiguration('signer')
      signer project(':proj1')
      signer project(':proj2')
  }
        
  // inside task
    String path = dependencies.signer.asPath

This results in :
  Execution failed for task ':proj3:sign'.
  Cause: Not all dependencies could be resolved!

Gradle appears to be trying to resolve the artifact from proj1 using my company internal maven repo instead of from the jar it created in the build directory of proj1.

These types of project dependencies work fine for the compile configuration, but apparently the Java plugin is doing something special to make this work. It doesn't work as I expect for a custom configuration. What can I do to get this to resolve to the project jars without going to the repo?

The problem is that resolve (or the asPath method in your case) does not trigger the build of a dependent project. I assume that you get the exception, because proj2 is not build and its jar is not available. In 0.5 the solution to this is:

dependencies {
        linkConfWithTask('signer', 'myTask')
}

createTask('myTask') {
        String path = dependencies.signer.asPath
}

In 0.6 we provide a nicer solution for this scenario.

- Hans


--
Hans Dockter
Gradle Project lead
http://www.gradle.org





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

   http://xircles.codehaus.org/manage_email


Reply via email to