Configure the author in Eclipse javadoc

tipAuthorJavaDoc

Is very important when we are refactoring or fixing bugs or doing some improvement to know who is the guy that created thi class.
Eclipse has a javadoc auto generator and it put the author automatically. The questions is that some times we want to update this author (normally Eclipse put it from current user machine). Here is the tip to get it according like we want.
We have two solutions (i recommend the second one):

1.- We can overwrite it passing the correct author in Eclipse shorcut as bellow.

eclipse.exe -vmargs -Duser.name=”Christian Oscar Tejada Pacheco”
2.- Se second way is editing the eclipse.ini and adding in the footer of the file the new line bellow.

-Duser.name=Christian Oscar Tejada Pacheco

In all of cases when eclipse will user the author, the name in user.name will be used.

Advertisements

Quick tips for Assembly and build spring MVC projects after long time

After some months without creating new Eclipse project not using maven I had two problems and here I’m documenting that with the objective to do not more see this problem in front of me and trying to help someone with the same problem.

The first is when you build the project and the assembly doesn’t work fine, your deploy structure is not understood for the eclipse and as least one dependency is not found in runtime. You can try to resolve as follow:

Right click in project —> properties —> Deployment Assembly —> Add —> Java Build Path Entries —> Next —> select jar or library —> next —> finish.

The second is when you build a Spring MVC project in eclipse and and run it onto Servlet/jsp container and for some reason it doesn’t works. Maybe you need to check your spring configuration file and see if the follow ViewResolver are ok.

<bean id=”viewResolver”
class=”org.springframework.web.servlet.view.InternalResourceViewResolver”>
<property name=”prefix”>
<value>/WEB-INF/[your jsp directory or just WEB-INF]</value>
</property>
<property name=”suffix”>
<value>.jsp</value>
</property>
</bean>

This piece of xml set the viewresolver, it means, where and wich one extensions your view tier (jsp) will understand.

 

 

Basic Spring configuration without maven or gradle in eclipse Luna and Mar.

If you wanna build a Java Eclipse Project with Spring configured, here is how you can do that.
It was done with Eclipse Mar and Luna using Spring 4.1.6. After JDK configuration done you must to download all Spring artifacts dependencies manually here, then choose which version you will use, in this case is 4.1.6. download it.
Create a new Java Project in eclipse (right click in Project Explorer -> new -> Project) choose Java -> Java Project, input the Project name and click in finish.

Now we will configure a build Path, it mean, we will make the Spring libraries visibles and usables to the project.
right click in created project -> Build Path – > Configure Build Path. Now you will see this:

SpringPure1

Click in Next.

SpringPure2

Click in User Libraries and then in New

SpringPure3

Enter the User Library Name: SpringLib Spring4.1.6 for example, click in Ok and then select the new User library Spring4.1.6 and click in Add external JAR. Select the directory where you downloaded the Spring artifacts  (for example c:\apis\spring-framework-3.2.0.RELEASE\libs) done in the first step for this tutorial.

SpringPure4

Click in Open (‘Abrir’ in the print). Now you will have this. The SpringFramework works together this the dependences api Commons logging like a Spring4.1.6. You need to do the same steps building the User library Commons-logging. download the jar in commons-logging (commons-logging-1.2-bin.zip).

SpringPure5

Finally we can see a example in the eclipse with two classes Person and SpringTest1, with the beans.xml blue print for Spring. Build your project like this print and run main method for SpringTest1 class.

SpringPure6

Complementing this tutorial is very helpful if you install through Eclipse Marketplace the plugin Eclipse WTP/XML Search after install and restart Eclipse you will be able to, for example, to use autocomplete in xml blueprint Spring configuration xml.

Go to Help -> Eclipse Marketplace. in Find input write ‘wtp xml’, find them. click in install and then reboot Eclipse. done!

SpringPure7

Here is the example core.

Good luck!

How to change styles colors in eclipse

After use for many times the Eclipse IDE, maybe you can feel so tired with the same layout and the same colors. Can can change de global layout or Eclipse, also you can change the color of specific type of class element (name class, methods name, attribute, annotations).

Here is an easy step by step how to change the Eclipse style.

1.- If you you to the Window -> Preferences -> and then type Appearance you’ll see a window like this.

eclipseTheme1

eclipseTheme2
In the Window you will see the list of all Themes available with your Eclipse distribution. Choice one and cli in apply and check if you like one of them

Now your Eclipse is looking like this:

eclipseTheme3

2.- Now your Eclipse is in the dark side. You can change only the code style into the class installing the follow plugin like this.

Here choice in Help -> Install New Software
Here choice in Help -> Install New Software

Then you will see the windows for install a new plugin in your Eclipse like this:

eclipseTheme5
Here you link put into the work with input the link as bellow: http://eclipse-color-theme.github.io/update/ Click in Add and ok. Then will appear an option Eclipse Color Theme, click in checkbox and install. Then finish. Reboot your Eclipse and you will see this options.

After Eclipse reboot go to Windows -> Preferences, In the window bellow go to the General -> Appearance -> Color theme. In this point you can see all color themes available for you. Choice one, apply, click in ok and done.

After you choose one color theme you need to wait a few seconds to refresh the preview.

Done.

.

eclipseTheme6