Tuesday, July 07, 2015

Eclipse Console Support for Frontend builds

If you use Eclipse of frontend development and use any of the front end tools such as ESLint or JSHint to do static analysis of your Java Script code, then Frontend Maven Plugin Console Support is the plugin for you.

This plugin parses the messages in Eclipse consoles (Process Console or Maven Console) and converts them to hyperlinks. It also adds warnings and error markers as applicable.

Install it using Help > Install New Software in your Eclipse IDE and specifying this update site:


I will soon add this to Eclipse Marketplace.


Sunday, July 05, 2015

A simple Maven Event Spy

In the context of this blog entry I developed a simple Maven Event Spy. However it works by itself too.

Simply drop mavenbuildspy.jar into your Maven installation's lib/ext folder and run your Maven build and you will see something like:

Alternatively download it somewhere and invoke it on-demand in your Maven build with:

mvn -Dmaven.ext.class.path=path-to/mavenbuildspy.jar ....

Feedback welcome!

Tuesday, June 09, 2015

Selectively run Maven phases and goals from Eclipse IDE

CALL FOR ACTION: If you like this feature please vote up on 470138.

1129 installs from Eclipse Marketplace so far.

This kinda answers this SO question.

Recent updates:
  • Save named configurations
  • The dialog is now mode less, thus allowing multiple invocations. If there is are multiple Maven projects in the workspace, a selector to invoke Phases and Goals on selected other project is shown.
  • Run goals in selection order instead of build agenda order. Using this mode you can run goals in any order. An astute reader may note that you can also type goals in text area before running them. This allows you to even run goals not associated with any phase.
  • Selecting a phase selects the associated goals
  • Expand all Phases
  • Expand all/Collapse all
  • If there is only one Maven project in the workspace, that is always selected.
  • Added a simple Maven Build Spy. It shows the success or failure of the goals, the timing and the exception message as a tooltip for failed goals.

You can even use the spy in your maven builds by:
  • Downloading the Maven Build Spy jar.
  • And then passing the following parameter to your mvn build like so:
> mvn -Dmaven.ext.class.path=path-to/mavenbuildspy.jar ....

When you run a phase, Maven runs all the preceding phases as per the lifecycle definition. However, sometimes I only want to run a selective subset of phases. The only way to do that is to actually run the goals associated with those phases explicitly. However how to get that list of goals? One would think that running:

> mvn help:describe -Dcmd=deploy

would do the trick. But alas it does not. It only lists the statically associated goals as per the static lifecycle definition - and not the actual goals you may configured in the pom's plugin configuration section. IMO this is simply - unimplemented yet useful functionality of Maven.

In this blog entry I talked about listing phases and actual associated goals of a maven lifecycle of a maven pom. In it I talked about an Eclipse plugin based on m2e code. I have improved it further. Now you can show the phases and goals in a checked tree dialog using the Project > Phases and Goals command.

You can run the selected phases or goals using the Launch selected goals command. When a phase is selected all goals associated with that phase are run. In Single Selection Mode the goals simply get added to the set in the order in which they were selected. This allows execution of orders in any order you want.

Maven 3.3.1 or greater is required to run the goals.

NOTE: If you install external Maven 3.3.1+ and try to use it as the installed Maven using Window > Preferences > Maven > Installations you may see an error during the build:

-Dmaven.multiModuleProjectDirectory system property is not set...

To fix that configure the property in your JDK/JRE installation using Window > Preferences > Java > Installed JREs > select default JDK/JRE > edit.

- See more at: http://marketplace.eclipse.org/content/phases-and-goals

You can print the listing to the Maven Console using the Log All command.

To use
  • Make sure you have m2e plugins installed into your Eclipse.
  • Then install the fragement from this update site URL:

or use:

Drag to your running Eclipse workspace to install Phases and GOals


Current standing see: Eclipse Marketplace

  • Restart Eclipse
  • Select a maven project node and invoke Project > Show Phases and Goals command. You will see the output like above in the Maven Console. If a resource from Maven Project is not selected you are prompted to select on.


BTW This is implemented as a fragment for https://github.com/eclipse/m2e-core/tree/master/org.eclipse.m2e.core.ui


Sunday, June 07, 2015

List Maven POMs phases and goals bounds to the phases

For longest time I have wanted to be able to show the actual goals associated with the phases of maven lifecycles. There is the following maven command:

> mvn -B help:describe -Dcmd=deploy

but alas it only lists the static set of goals associated with the phases as specified in the original lifecycle. And then it struck me that m2e add the Lifecycles section to the Maven project's properties page.

So I git cloned the m2e repo  https://git.eclipse.org/r/m2e/m2e-core , looked through the code and
the wrote a small Eclipse plugin fragment to add a command to list the phase and goals into the console. Here is the result.

To use
  • Make sure you have m2e plugins installed into your Eclipse.
  • Then install the fragement from this update site URL:
  • Restart Eclipse
  • Select a maven project node and invoke Project > Show Phases and Goals command. You will see the output like above in the Maven Console.

Now displays likely lifecycle and execution ids.

  • Show the output in a tree view.
  • Allow the user to launch mvn build with the goals associated with a phase.


Sunday, May 24, 2015

Tinckering with 3D Printing

Here are some videos of the printing in progress. I finally picked up the 3D print over the weekend.

This was my first 3D print design. The material is very hard and the pieces move nicely, after I applied some plumber's grease. As you can see the arcs completing the circles of Yin and Yang broke while handling the movement. Lesson to be learned I guess.

This printer is going to print the model

Monday, April 20, 2015

Question on KQED forum - Philosopher John Searle on 'Seeing Things As They Are'

I sent this question on KQED forum today - Philosopher John Searle on 'Seeing Things As They Are'.

Can John comment on the separation of subject and object of perception and the truth about respective things. I always find that people confuse between the two and think of truth of the subject is same as the truth of the object. For example:

  • When a person reports a spiritual experience there are two parts - the perception in their brain (subject) which in IMO is different from the object - the thing they experience i.e. spirit (say!). I think no one will/can deny that the truth of the persons inner experience but that does not mean the spirit is true.
  • Or when a person perceives the red pigment... (perception of) the color is really the property of brain of the person experiencing the red color. The emission or reflection of a particular frequency of light is the property of the pigment. So IMO when people like Dan Dennett claim that the Colors are real (in "what is real?" debates etc)...what they really mean is that the distinct perception of a particular frequency which the person has learned to call red is real. Not the color red itself.
It is easy to see how the exact same perception (for scenarios above) inside brains can be induced using other mechanism and it happens all the time...drugs or pressing on the eyeball - sometime you see red color.

Part of the question was read by Michael Krasny but unfortunately not the whole question. Granted that the question is long. But then John changed it to his own notions of "subjective visual perception" describing "objective visual perception" and so on and did not comment on my central point about separation of subject and object component of an experience.

I sent this email to Michael Krasny:

Kudos on great program. As always :)

Thanks for asking my question during the program. But it came across as opposite of what I was saying/asking because John answered it by saying something like (paraphrasing) "...when one describes the subjective visual field, one ends up describing objective visual field..." (or some such). However I was suggesting something exactly opposite. In certain cases the description is really the description of subjective perception and is different from the objective reality out there.

This is my pet objection to reports like this http://www.newsweek.com/proof-heaven-doctors-experience-afterlife-65327 in the Newsweek. Just because the doctor had a Afterlife experience (perception in his brain) does not mean Afterlife exists. It most likely was caused by traumatic state of his brain.And of course the fact that a doctor had that experience does not mean it is somehow MORE true. Sometimes this strategy is used to imply truth of something just because some person of good repute - say Einstein said it - well some times even Einstein has been wrong.

Awaiting his response.

The above has been my pet objection to articles like this.

You can hear the question followed by answer directly by matching the thumb with this red one: