{"id":34574,"date":"2016-05-21T15:31:41","date_gmt":"2016-05-21T10:01:41","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=34574"},"modified":"2016-05-24T14:24:03","modified_gmt":"2016-05-24T08:54:03","slug":"enabling-spring-with-plugins","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/enabling-spring-with-plugins\/","title":{"rendered":"Enabling Spring With Plugins"},"content":{"rendered":"<p>Writing a code to integrate MQTT functionality in my <a title=\"spring application development\" href=\"http:\/\/www.tothenew.com\/java-development-services\">Spring application development <\/a>made me think, am I not doing this over and over again. Having been involved in different IoT applications and numerous other domains, MQTT became an essential part of almost all the applications that I prepared.<\/p>\n<p>This is just one example of such a case, where we tend to write or maybe sometimes copy the same code again and again from one application to another. Thinking about how many seconds would have I played TT more, if I would have had something for the rescue.<\/p>\n<p>On the same lines, is the Java Enabler Toolkit, that I thought could be a potential solution in the open source community.<\/p>\n<h3><strong>What is the Java Enabler Toolkit??<\/strong><\/h3>\n<p>Coding for hours the same code again, we plugged out the essentials and made them mere configurable stuff for others to use. Java Enabler Toolkit comprises of different components that can be used separately over choice. The entire toolkit is made out of a main Maven Parent, which further contains the different child components. The structure of the toolkit is as follows:<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-34575\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/05\/Screen-Shot-2016-05-21-at-1.31.23-PM.png\" alt=\"Screen Shot 2016-05-21 at 1.31.23 PM\" width=\"319\" height=\"296\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3><strong>Sample Component \u2013 MQTT<\/strong><\/h3>\n<p>Let\u2019s take the example of the pain that I have been going through, MQTT.<br \/>\nThe source code for the toolkit is available for use at the following location:<br \/>\nhttps:\/\/github.com\/ankitarora12\/TTNDJavaToolkit<br \/>\nDownload the source code for the project.<br \/>\nThe structure of the MQTT component looks as follows:<br \/>\n<img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-34576\" src=\"\/blog\/wp-ttn-blog\/uploads\/2016\/05\/Screen-Shot-2016-05-21-at-1.32.53-PM.png\" alt=\"Screen Shot 2016-05-21 at 1.32.53 PM\" width=\"283\" height=\"155\" \/><\/p>\n<p>To build the entire toolkit run \u201cmvn clean install\u201d on the folder: <strong><a href=\"https:\/\/github.com\/ankitarora12\/TTNDJavaToolkit\">TTNDJavaToolkit<\/a><\/strong>\/<strong>toolkit-parent<\/strong>\/<br \/>\nThe jars would be built and be available for use.<\/p>\n<p>To use MQTT jar in your project follow the steps:<\/p>\n<ol>\n<li>Create a directory \u201crepo\u201d under your custom project, where your pom file is located.<\/li>\n<li>Hook onto the folder &lt;customProject&gt;\/repo\/ (cd &lt;customProject&gt;\/repo)<\/li>\n<li>Run the following commands:\n<ol>\n<li><span style=\"color: #0000ff;\">mvn install:install-file -Dfile=&lt;baseDir&gt;\/TTNDJavaToolKit\/toolkit-parent\/pom.xml -DgroupId=com.ttnd.toolkit -DartifactId=toolkit-parent -Dversion=0.0.1-SNAPSHOT -Dpackaging=pom -DlocalRepositoryPath=.<\/span><\/li>\n<li><span style=\"color: #0000ff;\">mvn install:install-file -Dfile=&lt;baseDir&gt;\/TTNDJavaToolkit\/toolkit-parent\/toolkit-mqtt\/target\/toolkit-mqtt-0.1-jar-with-dependencies.jar -DgroupId=com.ttnd.toolkit -DartifactId=toolkit-mqtt -Dversion=0.1 -Dpackaging=jar -DlocalRepositoryPath=.<\/span><\/li>\n<\/ol>\n<\/li>\n<li>Running the above commands prepares your local repository with the mqtt jar.<\/li>\n<li>Add the following lines to your pom file:\n<ol>\n<li>Add the following lines under the &lt;repositories&gt; tag:\n<p style=\"padding-left: 60px;\"><span style=\"color: #0000ff;\">&lt;repository&gt;<\/span><br \/>\n<span style=\"color: #0000ff;\"> &lt;id&gt;repo&lt;\/id&gt;<\/span><br \/>\n<span style=\"color: #0000ff;\"> &lt;url&gt;file:\/\/${project.basedir}\/repo&lt;\/url&gt;<\/span><br \/>\n<span style=\"color: #0000ff;\"> &lt;\/repository&gt;<\/span><\/p>\n<\/li>\n<li>Then add the following lines under &lt;dependencies&gt; tag:\n<p style=\"padding-left: 60px;\"><span style=\"color: #0000ff;\">&lt;dependency&gt;<\/span><br \/>\n<span style=\"color: #0000ff;\"> &lt;groupId&gt;com.ttnd.toolkit&lt;\/groupId&gt;<\/span><br \/>\n<span style=\"color: #0000ff;\"> &lt;artifactId&gt;toolkit-mqtt &lt;\/artifactId&gt;<\/span><br \/>\n<span style=\"color: #0000ff;\"> &lt;version&gt;0.1&lt;\/version&gt;<\/span><br \/>\n<span style=\"color: #0000ff;\"> &lt;\/dependency&gt;<\/span><\/p>\n<\/li>\n<\/ol>\n<\/li>\n<li>Doing this adds the jar to your project.<\/li>\n<\/ol>\n<p>Njoy!!!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Writing a code to integrate MQTT functionality in my Spring application development made me think, am I not doing this over and over again. Having been involved in different IoT applications and numerous other domains, MQTT became an essential part of almost all the applications that I prepared. This is just one example of such [&hellip;]<\/p>\n","protected":false},"author":863,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":2},"categories":[446,1994],"tags":[3350,4844,3351,327,4841],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/34574"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/863"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=34574"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/34574\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=34574"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=34574"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=34574"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}