Run intellij IDEA plugin from Main method - java

I want to force developers to run findbugs plugin for their business class before commit them . now want solution to run findbugs plugin from code but I cannot find any solution to access intellij idea plugin from code.
Can any body help me?

It's not possible to run the findbugs IntelliJ IDEA plugin from your main() method, because IntelliJ IDEA plugins can only run in an IntelliJ IDEA instance.
However, findbugs is also available as a standalone tool, which you can very easily run from the command line, as described in the documentation.

Related

How to use Lombok plugin in IntelliJ 2021.2.2?

I am new to Java from c++ and I have been trying to familiarise myself with the language.
I am trying to use the lombok plugin from IntelliJ IDEA but it does not seem to work for me at all:
This is a screenshot of my IDEA failing to recognise the "#value" annotation
The lombok is already installed on my IDEA and I have tried restore the default settings of my ide a bunch of times but I still get the same error:
This is a screenshot of the lombok plugin install on my ide
I am using the IntelliJ IDEA 2021.2.2 (Ultimate Edition).
Does anyone know what's the problem?
I have never used the Lombok plugin through the IDE. The way I do know how to use it is as follows:
Make sure that when you create a new project through your IDE that you're selecting either a maven project or a gradle project, these are project types that help you manage your dependencies in an intuitive way(I'll use maven for this example).
Go to either https://projectlombok.org/setup/maven or https://projectlombok.org/setup/gradle depending on the project type you've chosen you'll have to copy and paste the text block from these respective url's into either your pom.xml file(for maven) or your build.gradle file(for gradle)
For Maven:
For Gradle:
Paste the text block into your pom.xml or build.gradle like so(don't forget to click the M that shows up that's hovered over by the cursor, this updates your project with the new dependency so you can use actually use lombok):
Now you should be able to use Lombok and make use of all it's boilerplate goodness :)
I've been run into this issue, it was caused by Lombok version conflict, using the latest version works for me, you can use maven helper idea plugin to see if it's the same case for you.
I came across the same issue and found an intellij IDEA plugin called Delombok. It seems this plugin is part of the projectlombok. Anyone facing the same issue can try it out! By the way I am using IntelliJ IDEA 2022.1.4 (Ultimate Edition).

Test Runner tab in IntelliJ 2018.3 CE not showing

I'm using IntelliJ 2018.3 CE. I have a java maven project (developed using springboot) in which the JUnit tests have already been written. However, when I try to run the tests, the output is always shown in the default run window, and NOT in the Test Runner Tab. In fact, I cannot make this window pop-up after a running a test.
I have Junit 4.12 in the external libraries of my project (as Maven: junit:junit:4.12). The test folders have been appropriately flagged as test resources.
I presume it has to deal with settings in IntelliJ but even with all the effort in the world, I wasn't able to find what is causing this.
Is someone experiencing the same issue? Or does someone know how to resolve this?
Any help would be very much appreciated.

Can IntelliJ Idea work with maven-failsafe-plugin tests?

According to the maven-failsafe-plugin's convention. integration tests need to be placed under src/it. This is all fine and dandy, but IntelliJ Idea doesn't:
Treat the code in src/it as test code
Let you run these tests through the UI
I have 2017.1.3 and I have also installed the Maven Test Support Plugin. Doesn't Idea support this kind of separation?

Cucumber is not recognizing defined steps "Undefined Steps"

I can't execute a simple test with cucumber for a project. I am on Intellij 13 Community, with cucumber plugin.
I wrote my feature file in my features directory, I have also implemented my steps creating them with the help of the plugin. My steps in the feature files are recognized by intellij, which can navigate and go to the step implementation.
When I try to run my scenario, if fails stating "Undefined step". Any help will be greatly appreciated.
Here is how i organized my project :
It sounds as if you are trying to run the feature from Idea. It also sounds as if you have some issue with the wiring of your project.
My approach would be to start with something that works and then modify it to suit your needs. A project that works is the Java skeleton provided by the Cucymber team. Download or clone it from GitHub: https://github.com/cucumber/cucumber-java-skeleton
You should be able to build this project using Maven, Ant, or Gradle. It will also be possible to open it using IntelliJ IDEA and modify it to suit your needs.

How to properly setup a maven project in Eclipse/IntelliJ

I'm struggling a bit, trying to properly setup my maven projects in an IDE.
I don't particularly care between Eclipse and IntelliJ, but it seems that IntelliJ handles much better when it comes to import my projects, so I think I will stick with this one.
I'm having other problems now when trying to run the install goal through IntelliJ.
The first error :
The svn command failed. Command output: 'svn' is not recognized as
an internal or external command, operable
program or batch file.
How do I configure IntelliJ in order to let him see svn ? This error sounds weird to me, as I have installed Subversion as my Version Control System in IntelliJ.
Also, and this is related, I have a setenv.cmd that I usually run from the commandLine before calling mvn install. It only sets some variable like :
PROJECT_HOME=d:\Project\xxx\xxx\Trunk
PROJECT_VERSION=0.4.3-SNAPSHOT
M2_HOME=d:\Java\apache-maven-2.0.11
JAVA_HOME=d:\Java\jdk1.5.0_11
PYTHON_HOME=d:\Python26
XOOOF_HOME=d:\Project\xxx\xxx\XOOOF-BIN-1.0.3
XOOOF_URL=file:///d:/Project/xxx/xxx/XOOOF-BIN-1.0.3
SVNCLIENT_HOME=d:\Java\svn-win32-1.6.3
CATALINA_HOME=d:\Java\apache-tomcat
PATH=C:\WINDOWS;C:\WINDOWS\system32
How could I improve this step, and find a way to make it work from my IDE ?
Thanks !
If you want to do maven builds in eclipse I would strongly suggest installing m2eclipse by Sonatype.
It has an excellent reference on how to use it -> http://www.sonatype.com/books/m2eclipse-book/reference/
Regarding the first error it seems to be not Idea fault. AFAIK Idea doesn't need/use external SVN binaries. What happens when you click "9: Changes" tab at the bottom in Idea? If you make your project/module as managed by SVN there should be Repository subtab.
You run Maven from Idea to perform install goal and that error seems to come from it. Do you use SCM/SVN plugin in pom.xml? If yes or you would like to have an ability to run SVN from command line add directory with svn.exe (d:\Java\svn-win32-1.6.3? d:\Java\svn-win32-1.6.3\bin?) to PATH (not only to SVNCLIENT_HOME). After that operation svn command from new "run window" should be recognized.

Categories