Tuesday, February 28, 2017

Maven 3

Introduction:

Maven 3 is complete rewrite of maven internal architecture and is almost backward compatible. Maven 3 repository format is same as that of Maven 2, unlike the switch from Maven 1 to Maven 2. Reporting is not part of core Maven and is now part of maven site plugin.

Reasons to migrate to Maven3:
  • Latest and Greatest!
  • New development only in Maven 3 - 6 week release cycle
  • Maven 2 - Release cycle is unpredictable
  • Backward compatible (almost)
  • Faster
  • Parallel Builds
  • Eclipse/OSGi friendly
  • Tycho - Helps building Eclipse/OSGi bundles with Maven
  • Strict Validation of POM
  • Improved error reporting - Link to maven page with description, cause and possible fix.
  • Improved Logging

Speed:


Maven documentation says that it could be anywhere from 50% - 400% faster, but it depends on the project though. In one of our simple projects, I could see 25% improvement for both clean install and clean site (no downloading of dependencies involved).

Parallel Builds:

One of the other advantage of Maven3 is parallel builds. Most of us have dual or quad cores these days and so it would be good to take advantage of them. Below are some examples:
  • mvn -T 2 clean install (Build project with 2 threads)
  • mvn -T 2C clean install (Build project with 2 threads per core)
Maven analyzes the projects and executes the plugins accordingly. Also, individual plugins need to declare themselves thread safe (@threadSafe). In one of our small project that I tried with, I could not see big difference with 2 threads, but with big projects, there could be a difference.

Maven Shell:

Maven Shell (mvnsh) seemed to be very promising. The idea is to load JVM, maven and plugins and keep it in memory, thus avoiding start up cost every time maven command is run. But, when I tried it, I kept getting out of memory error (even after increasing my MAVEN_OPTS). At least, this was the cause when I tried it few months back. It could be fixed by now.

Polyglot Maven:

Polyglot maven allows to write POM in other JVM languages - Groovy, Scala, Clojure etc., It is useful for those who don't like the verbose XML POM's. Polyglot maven needs to be downloaded separately though. It comes with translator to convert your current XML POM's. Below are some examples:
  • translate pom.xml pom.scala
  • translate pom.xml pom.groovy

Issues:

  • profiles.xml is no longer supported. It is advised to move that to inside settings.xml.
  • Reporting now goes under reportPlugins in maven-site plugin configuration.
  • mvn dependency:tree may not be correct, since this still uses legacy dependency resolution code.
  • Because of stricter POM validation, you will see more errors. These have to be fixed before proceeding further.

Saturday, February 11, 2017

How car brakes work and tips to prevent brake Squeaking

Understanding how something work is useful for us all.

Machines have an incredible way of functioning. So simple yet so complex if not understood the basic theory of how it works.

Following video shows how car brakes work and how to fix squaking.

https://www.youtube.com/watch?v=ZvtjnxpFRbU

Monday, February 6, 2017

Tips for a better ITP project


Our project : Ewis Management System



Brief Introductin :


The main purpose of our project was to manage the students attendance, marks, details to be stored in  a digital database so that they can be easily accessed and accurately.






Our Contribution as a group was to develop this whole unit as a webbased application and host it so it can be accessed from anywhere.

My part of the project was to handle the administration of the web application.  To create, edit, delete entries and to handle the login and registration for new users.






Implemting Google Drive File Uploader using OAuth

Implementing Google Drive Text File Uploader using OAuth 2.0 Creating Project and Registering your API with Google In this part we wil...