8

I am attempting (unsuccessfully) to run IntelliJ Inspections on a java Gradle project in TeamCity. The documentation is a bit confusing; specifically, it states "To run inspections for your project, you must have either an IntelliJ IDEA project file (.ipr) or a project directory (.idea) checked into your version control." However, it also claims support for both Maven (see this post) and Gradle projects, which seems inconsistent with a requirement to commit the IntelliJ project files.

Our team prefers not to commit the IntelliJ project files, and therefore I am attempting to use my build.gradle file and an inspection profile. However, even for the simplest gradle project I can create, I am unable to get IntelliJ inspections to run successfully on TeamCity. Instead, I get this in the log:

[Step 2/2] [ 6968] WARN - .manage.ContentRootDataService - Can't import content roots. Reason: target module (ModuleData: module ':d9cc8a1592d04689:unspecified') is not found at the ide.

Am I attempting the impossible?

Community
  • 1
  • 1
Chad Showalter
  • 211
  • 1
  • 12
  • 2
    You are definetly attempting the possible, but more details are required: TeamCity version, Gradle version, is gradle wrapper used? – Nikita Skvortsov Nov 27 '15 at 13:16
  • TeamCity 9.1.4, Gradle 2.8, using Gradle wrapper. If checking in the IntelliJ project files is a requirement, why bother having Gradle as an option for "Project file type" when configuring an "Inspections (IntelliJ IDEA)" runner for a build step in TeamCity? – Chad Showalter Nov 28 '15 at 15:50
  • @NikitaSkvortsov You know how to run Intellij inspections via Gradle? – Jared Burrows May 23 '17 at 22:18
  • @JaredBurrows one can not run Intellij inspection via Gradle, but you can configure TeamCity to run IntelliJ inspections over the gradle-build project. – Nikita Skvortsov May 25 '17 at 10:26
  • @ChadShowalter Sorry, I must have missed your answer. Not sure if this question is still an issue, but TeamCity is supposed to run inspections successfully in described setup. Otherwise, consider opening an issue in TeamCity tracker: http://youtrack.jetbrains.com/issues/TW – Nikita Skvortsov May 25 '17 at 10:31
  • This is a good question. Being able to run IntelliJ inspections via gradle would allow developers still using Eclipse to benefit. As well as decoupling the project from having to run in TeamCity. – Ben Feb 08 '19 at 07:59

0 Answers0