简体   繁体   中英

Spring Tool Suite can't find JDBC Driver class

During the project building, i received an error:

Could not load JDBC driver class [com.mysql.jdbc.Driver]

I have jdbc connector attached to my project (mysql-connector-java-5.1.18-bin.jar) and i specified in 'database.properties.svn-base' that i'm using MySQL. And the service is running. And I placed this 'jar' int webapp/web-inf/lib/ directory.

But i've noticed, that system can't add this class into Maven dependencies.

How could i resolve this problem?

Add this to your pom, and remove the jar that you have added by hand

    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.6</version>
    </dependency>

Maven controlles the libs in your target web application lib folder, not the other way arround.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM