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

archive_war task fails if the target build dir is a nested directory

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Not A Bug
    • Affects Version/s: 0.5.2
    • Fix Version/s: 0.6

      Description

      (this looks like a duplicate of http://jira.codehaus.org/browse/GRADLE-131)

      Hi,

      I have the following structure:

      • root
      • (F) build.gradle
      • (F) settings.grade
      • (D) jarA
      • (D) jonah
      • - (D) nah
      • - (F) build.gradle

      root/settings.gradle includes jonah/nah

      If I build webapps/webapp1 then it fails with the following error message:

      — start
      :jonah/nah:archive_war

      Build failed with an exception.
      Run with -s or -d option to get more details. Run with -f option to get the full (very verbose) stacktrace.

      Build file '/Users/colinyates/Projects/orca/jonah/trunk/jonah/nah/build.gradle'

      Execution failed for task :jonah/nah:archive_war.
      Cause: Problem creating war: /Users/colinyates/Projects/orca/jonah/trunk/jonah/nah/build/jonah/nah-1.0.war (No such file or directory) (and the archive is probably corrupt but I could not delete it)

      BUILD FAILED

      — end

      jonah/nah/build.gradle:

      — start
      // name still becomes nah-1.0.war
      // archivesBaseName = 'nah'

      usePlugin('war')

      dependencies

      { compile project(':test-utils') compile project(':orca-core') compile project(':orca-support') // REVIEW - move these to a common parent build.settings providedCompile('javax.servlet:servlet-api:2.5') providedCompile('javax.servlet:jsp-api:2.0') compile('javax.servlet:jstl:1.2') }

      // REVIEW - urgh! The jars on the dependant projects aren't being copied
      // http://jira.codehaus.org/browse/GRADLE-425
      archive_war {
      additionalLibs(dir: '../../orca-core/build/')

      { include('*.jar') }
      additionalLibs(dir: '../../orca-support/build/') { include('*.jar') }

      }
      archive_war.doLast {
      File nahWarFile = "$buildDir/nah.war" as File
      ant.copy(file: archive_war.getArchivePath(), tofile: nahWarFile)
      }

      // create the exploded war
      File explodedDir = "$buildDir/exploded" as File
      createTask('explodedWar', dependsOn: archive_war) {
      ant.unzip(src: archive_war.getArchivePath(), dest: explodedDir)
      }

      — end

        Attachments

          Activity

            People

            Assignee:
            hans_d Hans Dockter
            Reporter:
            yatesco Colin Yates
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: