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
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
Post a Comment