Enterprise Architecture & Integration, SOA, ESB, Web Services & Cloud Integration

Enterprise Architecture & Integration, SOA, ESB, Web Services & Cloud Integration

Tuesday 4 July 2017

SSL 3.0 / TLS 1.0 vulnerability issue and solution

Since TLS v1 has vulnerability issues, you are strongly advised to start using TLSv1.1 or TLSv1.2 to secure your corporate applications.

In order to force the application server or standalone application to use TLS v1.2 for example, you can please pass the following JVM argument

-Dhttps.protocols=TLSv1.2

Saturday 1 July 2017

Maven Dependency Management - Reduce the war file size

A complex web application project might be using a large number of third party libraries in addition to your own application libraries. Together all, these jar files would be increasing the war file size which will be creating issues while transferring and deploying the files in the UAT and production servers.

This can be sorted out by following two steps
1. In your Maven pom.xml, you need to change the scope of the artefact to "provided" instead of "compile".

<dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>provided</scope>
        </dependency>

what Maven does is - it will use the libraries for compiling the source code but will not bundle the dependent libraries along with war file. Now, look at the size of the war file - it would be few KBs, not MBs.

2. Run the following command "mvn dependency:copy-dependencies" in your project home where you have pom.xml. The maven will analyse the pom.xml and copy all required dependant libraries under target/dependency folder. You can copy these dependent jar files under designated server lib of your favorite  application serer, and the job is done!

Thursday 29 June 2017

Maven Dependency Management - Listing Dependency Jar files

Here is a small tip if you've started using Maven very recently.

How would you know the list of dependencies used in your Maven project?

D:\work\messaging>mvn dependency:list
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Messaging 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:list (default-cli) @ messaging ---
[INFO]
[INFO] The following files have been resolved:
[INFO]    com.rabbitmq:amqp-client:jar:4.1.1:compile
[INFO]    org.slf4j:slf4j-api:jar:1.7.21:compile

[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.265 s
[INFO] Finished at: 2017-06-29T10:48:58+05:30
[INFO] Final Memory: 12M/114M
[INFO] ------------------------------------------------------------------------