Documentation Home
MySQL Connector/J 8.0 Developer Guide
Related Documentation Download this Manual
PDF (US Ltr) - 477.3Kb
PDF (A4) - 477.9Kb
HTML Download (TGZ) - 114.8Kb
HTML Download (Zip) - 132.7Kb


MySQL Connector/J 8.0 Developer Guide  /  Connector/J Installation  /  Installing Connector/J Using Maven

4.2 Installing Connector/J Using Maven

You can also use Maven dependencies manager to install and configure the Connector/J library in your project. Connector/J is published in The Maven Central Repository with "GroupId: mysql" and "ArtifactId: mysql-connector-java", and can be linked to your project by adding the following dependency in your pom.xml file:

<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>x.y.z</version>
</dependency>

Note that if you use Maven to manage your project dependencies, you do not need to explicitly refer to the library protobuf-java as it is resolved by dependency transitivity. However, if you do not want to use the X DevAPI features, you may also want to add a dependency exclusion to avoid linking the unneeded sub-library. For example:

<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>x.y.z</version>
    <exclusions>
        <exclusion>
            <groupId>com.google.protobuf</groupId>
            <artifactId>protobuf-java</artifactId>
        </exclusion>
    </exclusions> 
</dependency>