Tag Archives: JAR

Publishing or Uploading a jar to Maven Central


I am assuming your project is already on Github. If not on Github, I would highly recommend moving to Github. Initial Setup Sonatype open source software repository hosting (OSSRH) provides repository hosting services to open source projects. The initial setup requires some carefully choreographed steps. The subsequent iterations then become fairly trivial. Create a login […]

https://eveningsamurai.wordpress.com/2015/08/26/publishing-or-uploading-a-jar-to-maven-central/

Forcing Tomcat to log through SLF4J/Logback


via Forcing Tomcat to log through SLF4J/Logback | NoBlogDefFound.

So you have your executable web application in JAR with bundled Tomcat (make sure to read that one first). However there are these annoying Tomcat logs at the beginning, independent from our application logs and not customizable:

Packaging a GWT library jar


For creating a reusable jar from a gwt project, that can be used in other gwt projects, can be done using the following steps. I have used the gwt-maven-plugin for this process. Before getting started we need to mavenize the project. For that we need to create the directory structure like src/main/java (the place where […]

https://nailthecode.wordpress.com/2014/10/11/packaging-a-gwt-library-jar/

Gradle SourceSets Example


via Gradle SourceSets Example | Examples Java Code Geeks.

Gradle SourceSets are a key concept for the Gradle Java Plugin which define the structure of Java Source Files. In this example will see how to use this concept, customize them through gradle properties, create a new sourceset, get documentation and assembling them in a JAR.

Maven SLF4J integration example


via Maven SLF4J integration example.

In this example, we shall show you how to integrate Apache Maven with SLF4J. Apache Maven is a software project management and comprehension tool. It provides powerful features like superior dependency management including automatic updating and transitive dependencies.

It follows the principle of convention over configuration, due to which one can start with a minimal configuration and sensible defaults will be provided for all the missing configuration.

Maven uses central repositories where various artifacts like JAR files can be hosted. It comes with a mechanism that resolves all project dependencies from these central repositories. So effectively you are resolved from keeping and providing JAR files on your project’s classpath.

Maven only needs a file called ‘pom.xml’ where one can define dependencies as we will be seeing in the example below. Once you choose to build the project, these dependencies will be automatically fetched from central repository and put on your application’s classpath.

SLF4J is a simple facade over various logging frameworks. It gives abstraction and therefore makes it easier to change logging implementations later on in a software project.It is a very stable library and is actively used by various open source software like Apache Camel, ActiveMQ, Solr and EhCache etc. For this example we will be using Apache Maven 3.2.5 and SLF4J 1.7.5. The example is compilable on Java 5 and above.

Lembos a Java-based library that provides an ecosystem allowing you to write your MapReduce jobs using NodeJS


via apigee/lembos · GitHub.

Lembos a Java-based library that provides an ecosystem allowing you to write your MapReduce jobs using Node.js and have them run natively within Hadoop as if written using Java. The project is packaged as a JAR file that is intended to be run via hadoop jar just as you would have you written your MapReduce job in Java.

(Note: There is an option to build a standalone executable JAR but that would require you to package up the JAR with the necessary Hadoop JARs in a shaded JAR. Since the build would be Hadoop version specific, we’re not building those right now. For more details on how to do this, read the *Getting Started (Developer)** documentation below.)*

Maven Jetty Plugin Example


via Maven Jetty Plugin Example | Examples Java Code Geeks.

In this example, we shall show you how to integrate Apache Maven with Jetty. Apache Maven is a software project management and comprehension tool. It provides powerful features like superior dependency management including automatic updating and transitive dependencies.

It follows the principle of convention over configuration, due to which one can start with a minimal configuration and sensible defaults will be provided for all the missing configuration. Maven uses central repositories where various artifacts like JAR files can be hosted. It comes with a mechanism that resolves all project dependencies from these central repositories. So effectively you are resolved from keeping and providing JAR files on your project’s classpath.

Maven needs a file called ‘pom.xml’ where one can define dependencies as we will be seeing in the example below. Once you choose to build the project, these dependencies will be automatically fetched from central repository and put on your application’s classpath. Jetty is a web server and a servlet container. It also provides support for SPDY, WebSocket, OSGi, JMX, JNDI, JAAS etc. So it is quite similar to the likes of other application containers. However if differs from them by providing a really tiny memory footprint and being Embeddable.

This means we do not need to install Jetty and then deploy our application. We just need to start our application from command line and Jetty will be started as an embedded container inside our application.This makes Jetty quite handy for tasks like Micro Services implementation and integration tests writing.

For this example we will be using Apache Maven 3.2.5 and Jetty Version 9.2.6. The example is compilable on Java 5 and above.