Inspections with Maven

I have a Maven project that doesn't have checked in ipr files. I'd like to run inspections against it. How do I specify which inspections to run? I've found a configuration setting called "Inspection profile path" that looks promising, but I don't know how to create a "inspection profile file". What am I supposed to do here?

18 comments

I'm running our maven build with the default inspections, but haven't found a way to specify the inspections to run. This is supported, right?

0

Look at the bottom of the page where you configure the build runner. Should be there if you are using latest TeamCity 3.3.1.

Jørund

0

Inspection profile file can be created in IntelliJ IDEA only, so you have to install IDEA to configure your inspections.

--
Pavel Sher

0

I know how to configure inspections for use in IDEA. There doesn't appear to be a way to export those settings from IDEA for use in TeamCity (other than checking my ipr file into my source tree). Is that my only alternative?

Today, we don't check in our IDEA project files. We generate them locally from our Maven pom.xml. Checking in a ipr file that we don't expect anyone to use is a bit confusing.

0

I'm running 3.3.1. What should be at the bottom of the page? Inspection profile path? I see that, but don't know what to give it. The help says:

"Enter the path to the IntelliJ IDEA inspection profile file relative to the root directory (you only need to fill this in if you want to override profile mapping in the .ipr file)."

What is a inspection profile file? Is that referring to a ipr file? Do I need to check an ipr file into our CVS tree?

0

Hehe.. I gave up configuring Inspections Runner like you want to. We commited the ipr and impl files instead - and we experienced that this is actually better than doing the good old mvn idea:idea trick. It is easier to get up and running with a clean workspace now, because we share more of the IDE configuration. You can even share the Code Style definition and Error definition which makes sense (and makes it very easy) if you wanna use the Inspection runner.

Jørund

0

.. by the way. The inspection config file from IDEA should you be able to find somewhere in the IntelliJ config/system folders.

0

Hello,

inspection profiles (IDE) are stored in USER_HOME/IntelliJ IDEA 7.x/config/inspections/your_profile_name.xml

Thank you

0

What about in IntelliJ IDEA 6.0? and, does Teamcity support inspections exported from IDEA 6?

Thanks,
Mark

0

The IDE inspection profile stored in the user directory would be difficult to share between users. With that in mind, I made an ipr file in a sub-directory in CVS (hoping that would keep anyone from thinking it was a legitimate project file). In that project I defined a single project level inspection and set it as default. Then I configured TeamCity to point to that file.

I thought it was working... the TeamCity build log correctly identified the project name. But the results don't match my configuration! I configured it to run a small number of known inspections. It seems to have ran a completely different list of inspections. As far as I can tell, it ran the default inspections.

Maven is not so exotic that it would go unsupported... there must be an elegant solution to this.

0

Mark, for IDEA 6 inspections are stored in USER_HOME/IntelliJ IDE 6.x/config/inspections ;)

You should be able to find result of inspections run in TeamCity in IDEA's editor though inspections view is available for IDEA 7.x and upcoming 8.x

IDEA 6 does not contain all inspections available in TeamCity but it is possible to import

Thank you

0

Bryan,

you can use pom.xml and inspection profile file or you may use .ipr and configured project inspections. Why do you need to run over pom.xml if you already have shared .ipr? Thank you

0

I don't have a valid ipr file checked in. I created a project for the sole purpose of creating and sharing an inspection configuration.

Maybe I haven't made my motivations clear. I work at a very large company that has a corporate-wide policy that we build our files and our project configurations from Maven pom files. We do not check in IDE project files. I think this is a fairly reasonable policy, seeing as how a single point of configuration is one of the main advantages of Maven. Either way, I have no say in the matter.

I want to be able to configure TeamCity inspections, and I would like my coworkers to be able to do the same. I seem to have two options:
1) check in an ipr file
2) copy a config file from my IDE settings

The first option involves breaking corporate policy. I was trying to minimize the effect by checking an empty project into a subdirectory. The project simply stores the TeamCity inspections where everyone can get to them. Clunky, but I thought it would work... it doesn't.

The second option just seems like a hack. How would one of my teammates be expected to tweak an inspection setting? Shutdown IDEA; copy the file from CVS, to their profile; restart IDEA, edit their inspection settings; copy the file back and check it in?!?! At the very least, IDEA should have a UI for importing/exporting this file.

Seeing as how option 1 isn't working for me, I'm going to give option 2 a try. I would be grateful for any other suggestions though.

0

Hi

you should try convince them that commiting the ipr file is still smart. Comitting the ipr file doesnt mean you change from using maven to ipr, cause you setup the IDEA project to import and sync settings from the maven project pom - ergo the maven project is the master. For convience we have created a folder under project root called intelliJ where we have setup the Intellij probjecgt to store its probject files. Sharing specific IDE probject files isnt something bad as long as the IDE is capable to use the maven as the master project definition. By sharing the IDEA probject files you actually make it quite easy for the IDEA users, cause you will be able to share the things like the Inspection profile, Code style and so on.

Good luck!

0

I'm still having problems, but I don't think they are related to the pom file. I created a new idea project in a sub directory based on the pom. I checked it in, and configured TeamCity to reference the project files. No matter how I configure TeamCity, I either get the default inspections, or no inspections at all. When I get no inspections, I don't even see a tab for "Code Inspection". I only have a handful of tests selected (a couple I know will fail).

Is the absence of the "Code Inspection" tab mean that none of my tests failed? Does that mean that the tests I requested are somehow not supported?

0

Bryan,

I am afraid that to help you we will need the full set of details how you configured the runner (screenshots or the content of the Settings tab), what you expected and what was actually produced.

0

Thanks.. I originally thought this would be a common issue would be quickly solved on the forums. I've opened an issue in the tracker and attached a screen shot. I'm only guessing as to what information is needed, so feel free to request more information. Here's the url: http://jetbrains.net/tracker/issue/JT-71

0

I moved it to TeamCity project and now the issue has new URL: http://jetbrains.net/tracker/issue/TW-5668

0

Please sign in to leave a comment.