Importing database implementation classes and packages.

Answered

I am in the process of trying to build a plugin that requires the ability to create and manage datasources. I have not had much luck being able to include the classes that are mentioned in several other posts here and here. So while I wait for a slack invite I thought I might post here.

The posts referenced above seem a bit dated, however I did attempt to add the database-impl.jar to the class path in project settings. Unfortunately I still cannot seem to access import this package. Its a bit unclear how I configure my project to be able to access this package?

3 comments
Comment actions Permalink

Well I have made progress, IDEA now recognizes the classes by adding the .jar as a library in the project settings. However the Gradle build is not unable to resolve the classes within the library. It is also worth noting I am using kotlin and the project is cloned from https://github.com/JetBrains/intellij-platform-plugin-template


build.gradle.kts


dependencies {
implementation("com.beust:klaxon:5.5")
implementation(files("$projectDir/libs/database-impl.jar"))
}

Build Error


Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:
class com.intellij.database.dataSource.LocalDataSource, unresolved supertypes: com.intellij.database.model.RawConnectionConfig
class com.intellij.database.dataSource.AbstractDataSource, unresolved supertypes: com.intellij.database.model.DasDataSource, com.intellij.database.model.DatabaseSystem
class com.intellij.database.dataSource.DatabaseConnectionPoint, unresolved supertypes: com.intellij.database.model.RawConnectionConfig
Adding -Xextended-compiler-checks argument might provide additional information.

 

0
Comment actions Permalink

Please go ahead an mark this one answered. The solution was to also add 

implementation(files("libs/database-openapi.jar"))

 to the dependencies in build.gradle.kts

0
Comment actions Permalink

The above is fake news. Although it works the correct way is to update the gradle.properties files like so:

platformPlugins = DatabaseTools

And the plugin.xml to add:

<depends>com.intellij.database</depends>


And finally you must use IJ Community edition to build the plugin.

Many thanks to Jakub Chrzanowski for the assist on this one!

0

Please sign in to leave a comment.