David,
You are correct that the new buildpack doesn't detect the presence of .jar files. Instead it makes the assumption that if you're pushing a JAR, Cloud Foundry's support for exploding archives comes into play and we end up with a filesystem that has a bunch of .class, .groovy, etc. that it'll detect and work against. In the case of Java
main() applications, this results in a filesystem that contains a
/META-INF/MANIFEST.MF which
we then examine for the
Main-Class attribute. Now clearly your application doesn't fit this pattern as it's an archive within an archive (Cloud Foundry doesn't expand the inner archive) which is why it is not being detected. The closest analog that we've got to this is Spring Boot applications that are packaged as self-executing JAR files. They package their dependency JARs within themselves and use
a special loader mechanism to get everything onto the classpath. Ideally, this would be how we'd like all applications to work (it fits better with the Cloud Foundry model and doesn't require us to do any guesswork), but you've got an application that used to work but doesn't any longer, so let's take a look at what we can do.
My understanding from your email is that the ZIP file contains all of the dependencies for the primary JAR, however in your example custom command you don't seem to mention them. How are you getting those JARs onto the classpath, Class-Path manifest entries? In addition, how is the primary JAR uniquely identified; is it semantic knowledge about the application, the only one with a Main-Class manifest entry, or something else?
Our goal is to make the Java buildpack work without any custom configuration in the majority of cases, and the custom command counts as custom configuration to my mind. In fact, the custom command is a bit more insidious as necessarily bypasses the all of the smarts we do with memory sizing, zero-touch services, and other great things that the buildpack provides. If it's possible and reasonable, I'd like to add the ability for the buildpack to support the deployment scenario so that you don't have to specify that custom command any longer.
-Ben Hale
Cloud Foundry Java Experience