Showing posts with label eclipse. Show all posts
Showing posts with label eclipse. Show all posts

Tuesday, January 10, 2017

Tutorial : Converting a java project to Maven project


Why Maven : You would find lot of articles on usage and power of Maven but in my experience biggest advantage is that you do not have to include/maintain those huge jar files in your code repository server. Very often real code or core of project runs into few mb's but if you include all the dependencies the size can become extremely bloated. With Maven in place developers (and consumers) can happily do quick rebase/clone commands, leaving the time consuming job of including dependencies to Maven. Best still if you have downloaded jars for other project, you do not have to download them again, and maven plugins in IDE (like Eclipse) handles the class paths transparently enough for you.

         


Imagine a scenario where you started off developing a java project and now would want to share it with developers/customers/testers etc. by leveraging Maven.There were a lot of hardships in converting your existing java projects into Maven earlier, but IDE plugins have have made developers life easier these days.

                                   


If you are using new releases of Eclipse, you already have a plugin installed m2e, if not you can download it from here : M2E Plugin

Steps to Convert

1. Right click on your existing project in eclipse and choose Configure -> Convert to Maven Project


                



2. Now you can open newly generated pom file in your project and add dependencies, and you can remove references from build path if you had added them manually.

3. If you want to get details on dependencies on jar files, try searching them on maven central. Once you click on the listed jar, you can get information like groupid, artifactid and version you want to use.


4. Once you have added all dependencies, right click on project and choose run as Maven clean, this should trigger download of all dependencies in your maven home directory. This also automatically adds dependencies to referenced libraries of your project, so you do not have to do it manually.

Thursday, August 27, 2015

Getting started with IBM Liberty in your Eclipse in 10 minutes.

A strictly developer’s steps to get started with Liberty and Eclipse development environment. Removing the long documentation, below are the steps that should get you started under 10 minutes.



1. Get the latest eclipse ( Kepler, I used SR2 release )

2. Install Liberty in eclipse
    2.1 Open this url in browser : https://www.ibmdw.net/wasdev/downloads/liberty-profile-using-eclipse/
    2.2 Drag and drop Install icon on this page on your eclipse, that should automatically trigger the install

3. Once this is done and eclipse has been restarted you would need to create a server instance
    3.1 Go to server view and select new server
    3.2 From the options select WebSphere Liberty and then select  install liberty runtime
    3.3 Choose the folder where runtime would be downloaded
    3.4 That should be it wrt liberty.

4. Click on server and select add/remove your web in workspace should show up.

A Nifty little search trick in IBM RAD/Eclipse


If you have worked development team of a large project as IBM RAD or Eclipse as the development, you would know how long it takes to search through tens of projects.

Suppose you are trying to figure out the view or action classes having a specific string that you saw on UI. Now this string could be coming in from a json, xml, java, jsp and the list goes on and on. What increases the duration of this search is the fact that it would search in underlying dependencies as well ( jars and wars ).
What you can do to restrict the searches to loaded projects and not to underlying jar and wars ?





You can use the famous not operator ( ! ) in search box of RAD or eclipse. For example if you want search not to include underlying jars and wars enter this in File name patterns box of search dialog
!*.jar, !*.war

Merging and Splitting PDF files

We all use and rely on PDF's. There are occasions though when you want to edit certain portions of a pdf and merge the edited version ba...