title: Gradle to pack resources with class files in jar
body: <p>With maven pom having this in build configuration we are building a jar file which has resource files right in packages near class files (this is in my case necessary as some class files rely on convention over configuration and expect those resource files to be right next to them).</p>
  
  <pre><code>&lt;build&gt;
      ...
      &lt;resources&gt;
          &lt;resource&gt;
              &lt;directory&gt;src/main/java&lt;/directory&gt;
              &lt;includes&gt;
                  &lt;include&gt;**/*.fxml&lt;/include&gt;
                  &lt;include&gt;**/*.css&lt;/include&gt;
                  &lt;include&gt;**/*.properties&lt;/include&gt;
              &lt;/includes&gt;
          &lt;/resource&gt;
          &lt;resource&gt;
              &lt;directory&gt;src/main/resources&lt;/directory&gt;
              &lt;includes&gt;
                  &lt;include&gt;**/*.xml&lt;/include&gt;
                  &lt;include&gt;**/*.css&lt;/include&gt;
                  &lt;include&gt;**/*.properties&lt;/include&gt;
              &lt;/includes&gt;
          &lt;/resource&gt;
      &lt;/resources&gt;
      ...
  &lt;/build&gt;
  </code></pre>
  
  <p>How can we do the same with gradle? </p>