Maven run project with dependencies

I found question where run main class but did not found questions where ask how run main class when project have several dependencies.

I have follows pom.xml for my project:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns=""









But when I try run main class from maven:

mvn exec:java

I get follow exception:

[INFO] Scanning for projects...
[WARNING] Some problems were encountered while building the effective model for org.onbrains:ExportQueryResult:jar:1.0-SNAPSHOT
[WARNING] 'dependencies.dependency.systemPath' for should not point at files within the project directory, ${basedir}/lib/ojdbc6.jar will be unresolvable by dependent projects @ line 18, column 25
[WARNING] 'build.plugins.plugin.version' for org.codehaus.mojo:exec-maven-plugin is missing. @ line 42, column 21
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[INFO] ------------------------------------------------------------------------
[INFO] Building ExportQueryResult 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] --- exec-maven-plugin:1.4.0:java (default-cli) @ ExportQueryResult ---
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(
    at java.lang.reflect.Method.invoke(
    at org.codehaus.mojo.exec.ExecJavaMojo$
Caused by: java.lang.NullPointerException
    at query.QueryUtils.executeQuery(
    at Runner.main(
    ... 6 more
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.008 s
[INFO] Finished at: 2015-12-03T15:15:08+03:00
[INFO] Final Memory: 10M/304M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.4.0:java (default-cli) on project ExportQueryResult: An exception occured while executing the Java class. null: InvocationTargetException: NullPointerException -> [Help 1]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1]


I think oracle jdbc jar is missing in your local maven repository. Download the jar directly from mvn repository as it will add oracle jar to local maven repository.

Below is the dependency snippet for oracle jdbc


Change the version as needed by you.

If you already have an existing jar add to local maven repository.

Anyways, you have to remove <systemPath> tag from your dependency.

Try to add classpath :


Need Your Help

The Cleanest Reset for an ARM Processor

c arm reset processor

Lately, I've been cleaning up some some C code that runs on an ARM7 controller. In some situations (upgrade, fatal error, etc...) the program will perform a reset. Presently it just jumps to 0 and