title: How to properly replace Gradle 'jar' task?
body: <p>I am trying to force Gradle to create jar my own way. I wrote my own Gradle task (separate class) to do this and now I want to replace the default <code>jar</code> task with it, so that:</p>
  
  <ul>
  <li>the archive is ALWAYS generated with my new task and NEVER with the old <code>jar</code> task</li>
  <li>my new task has the same relationship with other tasks as the default <code>jar</code> task - it depends on <code>classes</code> task, the <code>build</code> task uses it, etc.</li>
  <li>I would like my task not to be invoked when it's <code>UP-TO-DATE</code> (just like the default <code>jar</code>)</li>
  </ul>
  
  <p>I'm struggling to do this and I'm having a lot of trouble to achieve this. For example, I was unable to force the <code>build</code> task to always use my new task.</p>
  
  <p>I would really appreciate it if someone could support me with a short howto.</p>