Why gradle 'from' in resources have no effect?


(Yurii) #1

Hi, I am new to gradle and hope on your help very much.

I have such hiearchy in my resources directory in java project build with gradle and i have to include only add directory to the war. Please, can someboby explain for me why next code has no effect??

A/
  |--B
      |--add
      |--notAdd
processResources {
    from("A/B"){
         include 'add/**'
    }
}

(James Justinic) #2

You may need to describe more fully what you have or what you want to happen. Your example works as expected if I run it.

In a build script that only contains:

apply plugin: 'war'

processResources {
    from("A/B") {
        include 'add/**'
    }
}

and the directory structure you outlined, all files in the directory A/B/add are included in the war file, but not any in A/B/notadd.