I am new to IntelliJ. I want to use sonar Qube and sonar lint in combination with IntelliJ IDE. How to configure sonar Qube and sonar lint plugin in IntelliJ?
I went through some sites which are suggesting me File -> Settings -> Other Settings -> Sonar but in my IntelliJ, there is nothing like Other Settings after opening Settings. I am using IntelliJ Ultimate version 2018.2
You first need to install the plugin via File -> Settings -> Plugins -> Search in Repositories.
After the plugin was installed successfully, you will find the described "Other Settings" section:
Related
I just started to use Maven and IntelliJ IDEA.
I imported a project into IntelliJ IDEA which requires Maven. I didn't install Maven to my computer but I have 2 plugins in IntelliJ IDEA named as "Maven" and "Maven Extension". And the code I have is running without any dependency problem.
In that case, do I still need to install Maven from the web or just the plugins in the IntellJ are enough for projects with Maven?
Can we say that for every project? If someone can explain the logic behind I would be very happy.
Thanks a lot!
Intellij comes with a bundled version of Maven (see File -> Settings -> Build, Execution, Deployment -> Build Tools -> Maven; the property 'Maven home directory' on that screen by defaults points to 'Bundled (Maven 3)').
You don't have to, but you can still install your own version of Maven, and point that property to it. It has the advantage of being able to run maven from the command-line, which is a better guarantee of build-stability (i.e. building the same project in different environments with the same result) than building directly inside of your IDE. And often is way more helpful in investigating build problems.
I'm using Intellij IDE for Spring projects. Whenever I add a dependency in pom file, it's not downloading it. In the case of Eclipse IDE, it automatically downloads the dependency whenever a dependency is added in pom.xml file.
I added the highlighted dependencies in the pom.file but it's not downloading. How to configure the IDE for auto-download dependencies whenever the pom.xml is updated?
You can tick the checkbox "Import Maven Projects automatically"
under "settings" -> "Build, Execution, Deployment "
-> "Build Tools" -> "Maven" -> "Import Maven projects automatically"
Usually, if do some modification in pom.xml, the Intellij will give always suggest you to enable Auto Import in a small pop-up(). I think it might have suggested you already. Anyways, you can do the above.
In Eclipse project build automatically it that option is enabled as build automatically
but idea we can not load maven dependency just by adding it in pom.xml but we can build the project by
IntelliJ Idea - Preferences
Select “Build, Execution, Deployment -> Compiler” -- build Project automatically
Above will build the project but it will not download the dependency
We have to click reload all maven project icon under maven tool window which can be activated by view - Tools Windows - maven
I have one project open in IntelliJ. In that I am able to see maven tab in its left sidebar:
Also, I am able to see Maven in View > Tool Windows > Maven:
I tried to open another project in another IntelliJ window, but it does not have both of the above:
It may be not required to have that maven tool window for the project that you have opened in the second Idea instance.
If the opened project is a maven project (at least if you have a pom.xml associated with that project) you will have this option available in View -> Tool Windows -> maven
If it's a maven project, try importing the project as a maven project as well
I try to open the Maven project in IntellijIdea. This project uses spark and scala. When I run:
mvn clean install -DskipTests
then it gives the error:
[ERROR] Failed to execute goal
org.scalastyle:scalastyle-maven-plugin:0.7.0:check (default) on
project spark-mllib_2.10: Failed during scalastyle execution: You have
50 Scalastyle violation(s)
I think that the problem is in the version of Maven. Indeed in IntellijIdea Settings I have the version Bundled (Maven 3) 3.0.5, while pom.xml defines <maven.version>3.3.3</maven.version>
If I run mvn -version in terminal, it points Maven 3.3.3
So, how can I update the version of Maven used by IntellijIdea?
Install the new version of maven (If not already installed)
Go to File -> Settings and use the search bar to find maven settings
Edit the Maven home directory setting so it points to the installation folder of the desired version
It may sometimes happen that after configuring maven in Intellij and changing as following it does not work by command build, so build it by Intellij maven tool.
Setting > Maven > Importer - select the JDK
Setting > Maven > Runner - select the JRE
After that, try to build by Intellij maven tool instead of Intellij console.
Using SonarQube Eclipse plugin, I run remote analysis [Sonar > Mode > Remote] (localhost:9000 and ip_on_my_lan:9000) and I see Sonar Issues tab with some elements (everything is OK).
But if I run local analysis I don't have any issue on Sonar Issues tab and Eclipse deletes all issues marks from source code.
It seems sonar-runner local analysis was OK: INFO - ANALYSIS SUCCESSFUL
What I'm doing wrong?
I tried with:
Eclipse Kepler, Sonar 3.7, SonarQube Plugin 3.0 and 3.2
Eclipse Juno, Sonar 3.7, SonarQube Plugin 3.0 and 3.2
Thanks for your time.
I found the problem!!!!
I have my sources on src/test/java instead of src/main/java (test framework)
If I run my analysis with "sonar-runner.bat" everything is ok, but when I run a local analysis from eclipse it seems eclipse doesn't found any source, but it doesn't say anything...
Eclipse put the binary code on /target/test-classes/ and I think Sonar plugin can't found it.
So I have two options: Move my source to src/main/java (checked) or create new local analysis properties (sonar.binaries)
Thanks for your time!