title: CloudFoundry .cfignore file to exclude one of two JAR files
body: <p>my Gradle build job creates two JAR files beneath build/libs folder (with changing VERSION placeholder):</p>
  
  <pre><code>$ ls build/libs
  foo-VERSION.jar foo-VERSION-all.jar
  </code></pre>
  
  <p>ONLY the 'foo-VERSION-all.jar' represents an artifact to get uploaded to CloudFoundry instance via</p>
  
  <pre><code>$ cf push
  </code></pre>
  
  <p>My problem is that BOTH JAR files are uploaded to CloudFoundry instance resulting in error messages like</p>
  
  <blockquote>
    <p>No container can run this application. Please ensure that you've
    pushed a valid JVM artifact or artifacts using the -p command line
    argument or path manifest entry.</p>
  </blockquote>
  
  <p>OK, -p CLI argument would be an option, but there should be another one!</p>
  
  <p>In CloudFoundry's manifest.yml I declare a path:</p>
  
  <pre><code>$ grep path manifest.yml
    path: build/libs
  </code></pre>
  
  <p>Now it should be feasible to declare a .cfignore file (should be analogous to well-known .gitignore files) to exclude the foo-VERSION.jar file, but I don't get it, e.g. with the following attempt:</p>
  
  <pre><code>$ cat .cfignore
  *
  !build/libs/*-all.jar
  </code></pre>
  
  <p>What's wrong with that? Any idea to get it work?</p>
  
  <p>Thanks</p>
  
  <p>Christian</p>
  
  <p>PS: I wanted to add a tag ".cfignore" to my post, but unfortunately I'm not allowed to.</p>