Getting Started with Aspectran

Aspectran requires Java 8 or higher, and is built and deployed using Maven.

Requirements

Java version required for Aspectran-based application development is as follows.

  • JDK 1.8 or higher

Maven is recommended as a build tool and dependency manager.

  • Maven 3.4 or higher

Aspectran-based applications require several Aspectran JAR files in the execution environment, and these JAR files are published in the Maven repository.

Maven

Maven central

The latest released version can be downloaded directly from here, and you can find all Aspectran Maven artifacts at the following URL:
https://repo1.maven.org/maven2/com/aspectran/

Adding dependencies

Basically, to use Aspectran, the following definition including all dependencies can be added to pom.xml. However, it is recommended to add only the dependency definition suitable for the execution environment of the Aspectran-based application to be built.

<!-- You can easily include all dependencies, but it is not recommended. -->
<dependency>
  <groupId>com.aspectran</groupId>
  <artifactId>aspectran-all</artifactId>
  <version>6.9.5</version>
</dependency>

The dependency definition according to the execution environment of Aspectran-based application is as follows. In general, only one definition that fits the execution environment needs to be added.

To build a daemon application running in the background

<dependency>
  <groupId>com.aspectran</groupId>
  <artifactId>aspectran-daemon</artifactId>
  <version>6.9.5</version>
</dependency>

To build a command line application

<dependency>
  <groupId>com.aspectran</groupId>
  <artifactId>aspectran-shell</artifactId>
  <version>6.9.5</version>
</dependency>

To build a command line application that uses a feature-rich JLine

<dependency>
  <groupId>com.aspectran</groupId>
  <artifactId>aspectran-shell-jline</artifactId>
  <version>6.9.5</version>
</dependency>

To build a servlet-based web application

<dependency>
  <groupId>com.aspectran</groupId>
  <artifactId>aspectran-web</artifactId>
  <version>6.9.5</version>
</dependency>

To embed Aspectran in a Java application that is not based on Aspectran

<dependency>
  <groupId>com.aspectran</groupId>
  <artifactId>aspectran-embed</artifactId>
  <version>6.9.5</version>
</dependency>

In addition to defining dependencies according to the execution environment as above, the dependencies that can be additionally defined are as follows.

To integrate embedded Jetty to build a standalone web application

<dependency>
  <groupId>com.aspectran</groupId>
  <artifactId>aspectran-with-jetty</artifactId>
  <version>6.9.5</version>
</dependency>

To integrate Undertow to build a standalone web application

<dependency>
  <groupId>com.aspectran</groupId>
  <artifactId>aspectran-with-undertow</artifactId>
  <version>6.9.5</version>
</dependency>

To integrate MyBatis with easy access to relational databases

<dependency>
  <groupId>com.aspectran</groupId>
  <artifactId>aspectran-with-mybatis</artifactId>
  <version>6.9.5</version>
</dependency>

To integrate the text template engine FreeMarker

<dependency>
  <groupId>com.aspectran</groupId>
  <artifactId>aspectran-with-freemarker</artifactId>
  <version>6.9.5</version>
</dependency>

To integrate the text template engine Pebble

<dependency>
  <groupId>com.aspectran</groupId>
  <artifactId>aspectran-with-freemarker</artifactId>
  <version>6.9.5</version>
</dependency>

To use Redis Session Store with Lettuce or support session clustering

<dependency>
  <groupId>com.aspectran</groupId>
  <artifactId>aspectran-rss-lettuce</artifactId>
  <version>6.9.5</version>
</dependency>

Latest source code

Build Status Coverage Status Sonatype Nexus (Snapshots)

Aspectran’s latest source code is maintained on GitHub.

Aspectran releases on GitHub

API Reference