java - ClassNotFoundException with Maven dependency system scoped -


i getting classnotfoundexception , noclassdeffounderror exceptions when attempt run application using maven defined dependency.

i added maven dependency jar in question pom.xml file 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 correctly added dependencies netbeans project

enter image description here

but when deploy app dependency missing

java.lang.noclassdeffounderror: com/novell/ldap/ldapexception 

if read maven documentation scope, seems expected behavior if application server doesn't provide library @ runtime:

this scope similar provided except have provide jar contains explicitly.

the provided scope states :

this compile, indicates you expect jdk or container provide dependency @ runtime.

not advised solution : add library in lib folder of application server.
cleaner solution : add maven dependency in maven repositories manually or mvn install:install-file.
, remove system scope of dependency. use default scope.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -