datasource specific to code inspections?

I've got a bunch of "Hibernate DB-related XML mappings problems" in my code inspection.. I suspect this is because the datasource I have configured locally does not match the database on the teamcity build agent machine... If I were to configure a datasource in IDEA that should work on the build agent machine, how could I tell the code inspection build runner to use this specific datasource instead of the default one we use for local development?

Comment actions Permalink


I'm really curious how other people manage thing... do I just need to ensure my dev DB names and credentials match the DBs on my build agent machines?

Comment actions Permalink


Inspections runner creates IDEA's config directory before the actual run to populate it with necessary JDK/libraries definitions. You can specify Inspections' "Run before build" Ant script that will create the necessary data in ${}/config/options/dataSources.xml that stores the datasources defined for the workspace.

Hope, this helps.

Best regards,

Yegor Yarko
Project Manager
JetBrains, Inc
"Develop with pleasure!"

Comment actions Permalink

That is helpful!

Is there an example of the bare minimum set of goo that needs to go in this file? can I just put the DB name and credentials in there and expect it to refresh the schema and all that?


Comment actions Permalink

Inspections don't connect to the real DB, they use the schema that is loaded from the file.
If you run DB-related inspections online during the coding - just use the datasource.xml from your environment.
If you need to load/update the DB structure stored in that file use Tools/Data Sources dialog.

Comment actions Permalink

Thanks, i think i get it now.

It would be useful to be able to specify the location of this file per datasource.. then it could be checked in with the project.

even better... it would be great if I could point at a file specifying the db credentials and it could refresh at inspection time... this would ensure that the specified schema matches the mappings... and I could generate the file for each developer and the teamcity envs.


Please sign in to leave a comment.