How to configure findbugs plugin in eclipse? - eclipse

Can anyone help me to configure findbugs plugin in eclipse , so that i can create an xml file and import it and export it as well?? i configured the PMD and CheckStyle plugins by creating a xml file for both and imported it in eclipse but in findbugs there is no such option of importing files or to configure as well. I tried the option filter files in findbugs but it did not work. If anyone have done it before or know anything about it your suggestions are deeply appreciated.
Thanks in advance!

Got the same Problem. Actually its really simple.
In Eclipse:
File -> Export -> General -> Preferences
If you click next you will find several Preferences to export. You will also find Findbugs Preferences.
If you want to import the settings to another Eclipse just use:
File -> Import -> General -> Preferences and select the exported File ;)
Hope that helps!
Sorry cant post any images because im new here...

You can use a 'filter file'. In eclipse, go to:
Window --> Preferences --> Java --> FindBugs --> Filter files (tab) --> In Include filter files select Add..
Then choose your xml configuration file (It may be the one exported from Sonar configuration that Kayser talked about).

In Eclipse go to
Help -> Install New Softare
------>click on Add button
Name- Find Bug
Location- http://findbugs.cs.umd.edu/eclipse
---------click on OK button
Accept the licence key(When u installed u can see licence check box ) and Restart Eclipse

Related

Propagate IntelliJ IDEA project settings

Is there any tool or plugin for intellij that let you propagate project settings (code formatting etc) across your team ?, something like Eclipse Workspace Mechanic for eclipse
Yes, you can select File -> Export Settings... and there you can find all properties you can export.
After that you give that settings.jar to all your team members, and all they need to do is File -> Import settings... and select all properties they want to be imported.
You can find more information here.
If you want it to be done automatically, you can look at Settings repository plugin (Preferences -> Plugins). It's description you can find here.
You don't need to export/import IDE settings for that. Using Settings Repository plug-in is also an overkill for such a simple task.
Instead, configure IntelliJ IDEA to store the code style and inspection profiles inside the project, then share your project files with the team.

Run as Ant build' Missing in my eclipse

I am unable to right click and run my build.xml file by choosing 'Run as Ant' . Whenever I click it says run configuration and that goes into running Java file options .
This works for me.
Go to..
1. Help -> Install New SoftWare
Work With -> "http://download.eclipse.org/releases/juno"
Drop down list "General Purpose Tools"
select "Eclipse Plug-in Development Environment"
After doing this...eclipse started showing option of Ant Build in Run as
In Eclipse Neon, the Ant Build moved to Run > External Tools > External Tools Configurations ... it is not located in the default Run anymore.
An example of a build xml file and how to run it
I hope this helps!
I encountered a configuration where depending on the filename of build.xml file the "Run As" menu did not contain the "Ant Build" and "Ant Build..." commands. The commands "Ant Build" and "Ant Build..." (see the image in ricardoramos's answer) are present if the build file is named build.xml, but absent if the file is named build-something.xml.
I tracked down that the cause of this issue in my configuration was plugin LiClipseText. Uninstalling the plugin resolved the issue. I observed this with LiClipseText version 2.1.2 and with Eclipse versions "2018-09" (4.9), "Photon" (4.8) for Java EE Developers.
The plugin provides its own editor for XML files, and I guess that interferes with the way how Eclipse detects that an XML file is an Ant build file.
It may be that this will be fixed in a future version of LiClipseText.
For a recipe on how to uninstall the plugin - see question 6174725. For a cleanup afterwards - see question 221476.
Another possibility is your build.xml file is not parseable by ant
For example, if you open the Ant Perspective (Open Perspective | Other | ant) and then choose the Add Buildfiles toolbar button, then choose your build.xml file, if it is not a valid build file, you may see an error message "Unable to parse as an ant build file".
Once you fix your build.xml file, the Run As ant RMB command on the build.xml file will appear.
(above was my experience on Eclipse Mars.2)
Follow the below steps.
Go to Windows -> Preferences -> General -> Content Types -> Text -> XML -> Ant BuildFile.
Just click on Add button and add your AntBuild file. click ok.
Restart your Eclipse.
Follow the below steps.
Go to Windows -> Preferences -> General -> Content Types -> Text -> XML -> Ant BuildFile.
Just click on Add button and add your AntBuild file. click ok.
Workaround:
Open the ANT-View, add the build file and start it from there.
(Had the problem in JBDS8 after installing IBM Diagnostics Tools)

how to plugin evosuite.jar in Eclipse

On the evosuite documentation website, they have a unhelpful video.
The video shows that when you right click the text editor in eclipse, there is an evosuite icon after "replace with", but I haven't figured out how I can do that after I tried different answers on website.
I put evosuite.jar in the folder of eclipse plugins and then use plug-in from Existing JAR Archives functions of eclipse to import it.
Am I anywhere close?
Any suggestion will be appreciated. Thanks in advance
It looks like the update site is here: http://www.evosuite.org/update/
Paste this URL into your Eclipse Install manager's work with text box (Help -> Install new software...), select evosuite and next. Follow the instructions to install.
You may have to de-select the option “Group items by category” to see EvoSuite listed if you harness the power of Andrew Eisenberg's answer

How to add hibernate javadocs in Eclipse?

I am using Eclipse for the past two months. I didnt used javadocs in it before.
Today i searched for hibernate javadocs and got hibernate-3.2.2.ga-javadoc.jar.
But i dont know how to add it in eclipse. Any suggestions!!
You can also simply add the URL of the javadoc like http://docs.jboss.org/hibernate/core/3.6/javadocs/ in the properties of the jar !
If you right click on the JAR file under "Referenced Libraries" -> Properties -> Javadoc Location -> Javadoc in archive and then either point it to a jar you've imported into your workspace or on your local machine by using the "archive path" box.
Simple steps to include hibernet in eclipse................
Visit
http://www.jboss.org/tools/download/stable/3_1_GA.html (BROKEN LINK)
Downloaded file name should look like “HibernateTools-3.3.0.v200910281724M-H247-M4.zip”
Extract it with your favor zip tool
Copy the extracted plugin and feature folders to Eclipse’s plugin & feature folders
Restart Eclipse.......!!
It's Done.. :-)
Here is the complete guide lines, that I have followed and it worked for me.
http://milindapro.blogspot.com/2011/10/add-hibernate-javadoc-to-eclipse.html
Edit
I am not promoteing myself. But I hope this will help to someone. Thanks.

How can I add a default header to my source files automatically in Eclipse?

I'm trying to figure out how I can have a comment header automatically added to all new source files in my eclipse java project. I've looked around but I haven't found a simple solution to automate this process. I gave JAutodoc a try, and even though it does allow me to specify a header I still had to tell the plugin manually to inject the header and it didn't seem very fond of my keyword-subsitution.
I'm by the way using the Maven2 plugin for Eclipse for most of my projects if that's any help.
Any tips?
Comments generation is configured in:
Main Menu -> Window -> Preferences -> Java -> Code Style -> Code Templates -> Configure generated code and comments
You can change directly the New Java files template:
Code -> New Java files -> Edit
As of Eclipse 3.6 version, it is already configured that for new Java files ${filecomment} is inserted, so it is probably better to edit it instead:
Comments -> Files -> Edit
If you want to add your comment a the top of the file (to add a copyright header), give a try to Eclipse Copyright Generator. There is a wizard that ask you what you want to include. Therefore you can add every kind of comment header.
After installation you get a new menu: Project > Apply Copyright....
In the include files field enter *.java to reduce the set of files.
see also this answer
As indicated in the comments, there is an other tool provided by the Eclipse Fundation: Eclipse Copyright Tool (as part of their releng tools)