[Update] I recommend to take a look at the cf-maven-plugin, which makes it much easier to deploy to CloudFoundry, so its no longer needed to work with the vmc tool directly. The GitHub page explains both howto deploy normal and standalone applications with this plugin, and also explains to use the appassembler-maven-plugin for standalone applications. This blog post is also useful to get started. [/Update]
It turned out I was deploying the application in a wrong way to CloudFoundry. I was using the maven-assembly-plugin
, which unpacked the class files of all dependencies into the jar file. In fact I had to use the appassembler-maven-plugin
:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>appassembler-maven-plugin</artifactId>
<version>1.1.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>assemble</goal>
</goals>
<configuration>
<assembledirectory>target</assembledirectory>
<programs>
<program>
<mainClass>my.package.myclass</mainClass>
</program>
</programs>
</configuration>
</execution>
</executions>
</plugin>
I then deployed the application to CloudFoundry like this from the the target/
folder
vmc push <myappname> --path=appassembler
As run command I needed to choose the name of the run script in the appassembler/bin
folder. For example bin/start-up-myapp
.