Skip to main content
Windward

Using Maven to Install Windward Java Engine in your Application

Overview 

Windward's Java Engine is updated for each general release with its current code packaged in the Maven repository. This allows you to easily add the Windward Java Engine to your project without the need to coding a build script for the Windward libraries. We know many of you use Maven and the request was heard loud and clear. Follow the instructions below to easily add the Windward Java Engine to your Java application and get started generating your reports in no time!

 

To learn more about Maven a good overview is posted here.

Prerequisites

In order to take advantage of the Maven project management and comprehension tool there are a few things you will need

  • General knowledge of software development.
  • Overview of Java EE development and deployment process.
  • Latest version of Jave SE JDK (the JRE package is not enough) found here or the current direct link to JDK here.
  • Apache Maven

Instructions

Install the latest Java SE JDK

  1. If you have not already done so, download and install the latest Java SE Java Development Kit (JDK) from the prerequisites link above. Keep in mind you need the JDK and not the JRE.
  2. Make sure that you have correctly set your JAVA_HOME environment variable to the root JDK installation directory for your operating system.
    1. You can use the following command to check what the JAVA_HOME environment variable is currently set.
    2. Open a command prompt on your system
    • echo %JAVA_HOME%
  3. For Windows the default should be C:\Program Files\Java\jdkX.X.X_XX. Note if you are using 64 bit Windows and installed the 32 bit JDK, it will appear under C:\Program Files(x86)\Java\jdkX.X.X_XX

Download and Install Apache Maven

  1. Download and install Apache Maven from the link below.
    1. https://maven.apache.org/download.cgi

 

  1. Follow the Maven installation instructions for your operating system from the link below. Use the binary install but if you are compiling Maven then use the source installation.
    1. https://maven.apache.org/install.html

 

  1. Unzip the Maven binaries or source to a directory of your choice.  The default is apache-maven-x.x.x.

 

  1. Add the bin directory under your apache-maven-x.x.x install to your PATH environment variable. This ensures you can run Maven commands from anywhere in the command prompt.  
    1. Note: If you are not familiar with setting system environment variables go here to the bottom of the page and follow the instructions for your operating system

 

  1. Confirm you can run Maven command by opening a command prompt and entering the command below
    • PROMPT>mvn -v
  2.  If you are successful you should see the following output with minor differences for your installed version of Maven.

Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00)
Maven home: C:\Maven\apache-maven-3.3.9\bin\..
Java version: 1.8.0_91, vendor: Oracle Corporation
Java home: C:\Program Files (x86)\Java\jdk1.8.0_91\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "x86", family: "dos"

Configure Maven Properties and Settings

Locate your settings.xml file

  1. This file is typically located in 
    1. Windows: %USERPROFILE%\.m2\settings.xml
    2. Unix: 
      1. ${maven.home}/conf/settings.xml
      2. ${user.home}/.m2/settings.xml
  2. If do not find settings.xml, copy the default settings file from your <MAVEN INSTALL DIRECTORY>\conf to one of the locations above in step a.

Windows Users:  If you do not find the .m2 directory under your username directory then run Maven without parameters from the command prompt to initialize the paths and directories structures.  I.E. PROMPT>mvn

Add the Windward Maven Repository Settings to your settings.xml file.

  1. Open your settings.xml file and add the Windward profile code below between the <profiles> </profiles> section.
   <profile>
      <id>windward-profile</id>
         <repositories>
            <repository>
               <id>windward-maven-repo</id>
               <name>windward-maven-repo-release</name>
               <url>http://maven-repository.windward.net/artifactory/libs-release-local</url>
            </repository>
         </repositories>
    </profile>
  1. Then add the code below for the profile you just created to the active profiles section between <activeProfiles> </activeProfiles> and save settings.xml.
      <activeProfile>windward-profile</activeProfile>

Add the Windward version dependency to your Java project pom.xml file

  1. In your current application locate and open the pom.xml file and add the following Windward dependency.
<dependency>
   <groupId>net.windward</groupId>
   <artifactId>WindwardReports</artifactId>
   <version>VERSION_NUMBER</version>
</dependency>
  1. Replace VERSION_NUMBER with the version of the Windward Java Engine you want to use. (Example: 15.1.11.111)

  • Was this article helpful?