Uploaded image for project: 'Gradle'
  1. Gradle
  2. GRADLE-2177

When a subproject classesDir have been altered, if the subproject is used as a dependency the new output location is not used in the compile classpath

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Won't Fix
    • Affects Version/s: 1.0-milestone-9
    • Fix Version/s: None

      Description

      Specifying a different project output folder than the default for a source set, such as in the following:

      sourceSets.main {
             output.classesDir=rootProject.deploymentLib + File.separator + archivesBaseName + '.jar'
             output.classesDir=rootProject.deploymentLib + File.separator + archivesBaseName + '.jar'
      }

      will result in the project being unusable as a dependency. This is currently being used to create an exploded jar in a library directory which we use to share among deployments in JBoss. We specify the dependency as the following:

      configure(subprojects.findAll { it.name != 'common-lib'}){
              dependencies {
                      compile project(':modules:common-lib')
              }
      }

      Our current workaround is to put the output directory into a variable and specify the directory as the following:

      configure(subprojects.findAll { it.name != 'common-lib'}){
              dependencies {
                      compile files( commonLibJarFolder )
              }
      }

      Attached is a sample project which displays the issue.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              jonathan_imperial Jonathan Imperial
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: