I\'ve followed the simplest maven example and made the following pom.xml
file:
The problem is, you are setting the classpath to a single .jar file, thus java command can not find the dependency. (json-simple-1.1.1.jar in your case..)
You can tell maven to include the dependencies in target folder that you compiling your class to.
This is done by the following change in the pom.xml:
maven-dependency-plugin
install
copy-dependencies
${project.build.directory}/lib
Now try mvn package (or mvn clean install, I am not sure..) and you will see in /target/lib the dependencies are copied.
Run your application like this:
java -cp target/my-app-1.0-SNAPSHOT.jar:target/lib/json-simple-1.1.1.jar com.mycompany.app.App
{"hello":"world"}