I am getting ClassNotFoundException and NoClassDefFoundError exceptions when I attempt to run my application using a maven defined dependency.
I added my maven dependency for the jar in question to my pom.xml file with the following declaration:
<dependency>
<groupId>ldap</groupId>
<artifactId>com.novell.ldap</artifactId>
<systemPath>${local.lib.dir}/ldap.jar</systemPath>
<scope>system</scope>
<version>1</version>
</dependency>
The jar is correctly added to the Dependencies NetBeans project
But when I deploy the app the dependency is missing
java.lang.NoClassDefFoundError: com/novell/ldap/LDAPException

systemscope means that you need to make sure yourself that the jar file is in the classpath - Maven is not going to do it for you. If you don't make sure yourself that the jar containing the necessary class is available, then you get aNoClassDefFoundError. See: Dependency Scopes for a description of what the different Maven scopes mean.