netbeans find usages does not seem to scan xml files - java

Can anyone confirm this, or do I miss a check in a checkbox somewhere?
Example: When I go to a Java class and do a "Find Usages", it does not find a referance to the class, though it exists in a spring related xml-context file.

Can confirm this for Netbeans 7.2. And that's why some prefer Java spring config.

Try with this plugin: JohnBaker FindUsages, Spring Support for Find usages. Stock "find usages" from Netbeans doesn't support Spring.
There is also a generic Netbeans-Spring plugin.
Personally I use Eclipse with STS.

Related

Problems compiling AutoValue library example project

I just discovered google's AutoValue library, which seems great.
I'm trying to compile the example project which I downloaded from here
But the project doesn't compile.
The compiler complains about the AutoValue_ constructor symbol not being recognized.
Can someone explain what I am doing wrong?
I am using auto-value-1.3.jar
Thanks
IntelliJ does not enable annotation processors by default.
You can follow the official guide. You need to go to the Annotation Processors page and click + to create a new profile. Then you have to associate your module with this profile. In the end you only need to enable annotation processing for this profile and everything should work.
The IntelliJ editor might not find the generated class files though and still display the name red. But it should not affect the build.

Create custom rule java with for sonar analyse

i always used xpath to create custom rule in sonar, but now xpath is removed from plugin java, i need help for my first custom rule in java :
If there is a #Stateless or #Stateful annotation on a class, there should be a #Interceptors annotation. If it's not the case, it should be a Critical issue.
i followed this step :
Create a standard SonarQube plugin.
Put a dependency on the jar of the language plugin for which you are writing custom rules.
Create as many custom rules as required
Generate the SonarQube plugin (jar file).
Place this jar file in the SONARQUBE_HOME/extensions/plugins directory.
Restart the SonarQube server.
and i'm able to follow all the steps but to create custom rule i need to know what i can put on the java class to define my rule before generate the sonarqube plugin.
can anyone help me, thanks in advance!
Regards,
Youssef
As far as I understand, you need to get the annotations of a class. We've done this for #VisibleForTesting in a custom plugin.
Look in https://github.com/arxes-tolina/sonar-plugins/tree/master/src/main/java/de/tolina/sonar/plugins/vft/checks package, especially HasVisibleForTesting.java and IsVisibleForTesting.java.

Intellij IDEA Plugin for RAML

I have just started using RAML in my Java project. I am using Intellij IDEA and there my RAML file is displayed as raw text, without any text highlighting. It seems that it doesn't recognize this type of file at all.
Is there any plugin for RAML in Intellij IDEA?
Mostly I tried to google it and also checked in the list of plugins. If plugin doesn't exist, what would you suggest? It seems that then I would need to use some other tool to modify properly this file.
RESTful API Modeling Language (RAML) is a YAML-based language for describing RESTful APIs.
Intellij has a plugin for YAML syntax so you can use that for RAML.
Just go to settings -> Editor -> File Types.
Then under Recognized File Types just scroll down to YAML and select it.
Now just add *.raml and *.rml to the Registered Patterns section and you will get syntax highlighting.
There is a plugin Raml Intellij Plugin . It is still in beta but you can use it. You can download directly from the Intellij Repositories
The RAML Workbench for Atom is a good way to get started. It provides a lot of guidance to writing RAML.
The Raml plugin that I used to mantain is no longer under dev. To replace that I've added raml completion to the DataWeave Plugin. So if you install the Plugin It will also add Raml and Oas support. Saddly I needed to do this change. All these plugins are being mantain on my spare time

Info about version dependancies of enterprise java libraries

I am new to enterprise application developement and trying to create a REST server with Spring REST, JPA taking to mySQL database and Javascript on the client side. As I see loads of opensource libraries doing specific task, I started off with using 'maven project' with different 'arch type' (which is nothing but predefined POM with relevent libraries as I understand) provided by Eclipse. But I often run into version mismatch issues, in many cases found specific solution to that perticular libraries in StackOverflow or other sites.
Hence I started looking for a information these version dependancies such as, this version of JPA works with that version of Hibernate library and so on. I checked maven repository of major libraries, I did not find such information so far.
My queries are:
Where can I find these information about the versions dependancies?
Are these pre defined POM in eclipse reliable? Who owns them, where can I get last modified dates on these maven 'arch types'? (I find the ones I choose having fairly old version of libraries).
If I have to start off on my own creating a Maven dependacies, where will I get information about what are the dependent libraries, for example, if I need spring MVC, for sure it needs java servlet library. I am worried becuase the maven 'spring-mvc-jap' arch type whooping 50 libaries as dependancies.(Coming from embeded domain, I find to too hard to digest :D). So not sure if it is the right way.
Please correct if I am missing anything in my understanding.
You can find this information, if you are using maven and some IDE you can go to the dependancy and make click un > and this will show the librarys used for this dependancy or if you want to use the console you have http://maven.apache.org/plugins/maven-dependency-plugin/examples/resolving-conflicts-using-the-dependency-tree.html this will show the same that the IDE.
After normally in the documentation of the library used, you can find some doc about the dependancy about this.
Other solution is get the .jar and use 7zip to see the POM and know the dependancy used.
And for finish my answer if the IDE tell you that you dont have x dependancy normally you have to add this because any of the other dependancy used have it (they used only for the compiling task), but sometime somes projet change a lots of code between the version .a to .b so you will have some problem using the version .b, at this moment i didnt find one good and easy way to fix this, only using the way that i told you (only if i found some problem in the compilation)
3> I am not sure how it works in eclipse but in IntelliJ IDEA when you start using some class without proper dependency IDEA suggest you to add proper dependency automatically. The same approach should be in eclipse.

What do I need to do to use Guice?

I want to learn Guice. I use eclipse.
What to download? What to install? What to do in eclipse to use guice?
Thanks.
You could start by following the installation guide for GuicePlugin (although that project doesn't seem very active sine April 2009):
peaberry is more up-to-date, and comes with a "Guide for using the peaberry bundle with OSGi".
If you don't need a special integration with Eclipse, all you need is the Guice2.0 release, referenced in the libraries of your project to get started.
alt text http://img682.imageshack.us/img682/2853/eclipseguice.png
Just download guice-2.0.zip from here and add guice-2.0.jar and aopalliance.jar to a project's classpath. Don't need anything special to use Guice.
I think you could have a look to peaberry
http://code.google.com/p/peaberry/

Categories

Resources