JEAF Maven Plugin

Introduction

As described before JEAF is optimized to provide very short startup times. This a fundamental non-functional requirement when implementing cloud applications. Only when your application startup is really fast then you can benefit from dynamic scaling as it is provided by all leading cloud solutions.

 

When profiling startup performance of many applications it turned out that initialization of most common frameworks took quite a lot of time. One of the main reasons for that is that many frameworks scan the applications classpath for initialization, dependency injection etc.

 

With JEAF we implemented a different approach. JEAF is also configured using annotations. But in order to improve startup time JEAF Maven Plugin analyzes the class path during build time and generates configuration files that are used to find the classes that hold the configuration values. This way time consuming activities during startup can be avoided.

Current Version

Overview about latest released versions can be found here:

Preconditions

As described in Maven Build Helper Plugin when working with JEAF or JEAF Generator then we need to make use of Maven Build Helper Plugin. So please refer to the mentioned site to ensure that is integrated properly.

How to use JEAF Maven Plugin

The following tables describe all available configuration parameters of JEAF Maven Plugin. As there are any of them they are grouped by topic:

Common Configuration Parameters

Configuration Parameter

Required / Optional / Default

Description

Configuration Parameter

Required / Optional / Default

Description

resourceGenDirectory

At least one of resourceGenDirectory or testResourceGenDirectory has to be set.

Configuration parameter defines the output directory to which the generated JEAF configuration files should be written. The plugin will analyze therefore all dependencies that are not of scope "test".

testResourceGenDirectory

Configuration parameter defines the output directory to which the generated JEAF configuration files for test scope should be written. The plugin will analyze therefore all dependencies including also those of scope "test".

targetDirectory

optional

The plugin also supports writing files to target test directory. There the target directory has to be passed through this configuration parameter.

testTargetDirectory

optional

The plugin also supports writing files to target test directory. There the target directory has to be passed through this configuration parameter.

includes

Either configuration parameter includes or excludes can be used but not both.

Parameter can be used to include classes that match some specific pattern. The pattern matching mechanism is rather simple. Thus only the following variants are supported:

  • com.anaptecs.jeaf.* means that all classes whose name starts with com.anaptecs.jeaf. will be included

    • *.MessageConstant means that all classes whose name ends with .MessageConstant will be included

  • .MessageConstant means that all classes whose name contains .MessageConstant will be included

  • com.anaptecs.jeaf.components.MessageConstants means that class with name com.anaptecs.jeaf.components.MessageConstants will be included

excludes

Parameter can be used to exclude classes that match some specific pattern. The pattern matching mechanism is rather simple. Thus only the following variants are supported:

  • com.anaptecs.jeaf.* means that all classes whose name starts with com.anaptecs.jeaf. will be excluded

  • *.MessageConstant means that all classes whose name ends with .MessageConstant will be excluded

  • *.MessageConstant* means that all classes whose name contains .MessageConstant will be excluded

  • com.anaptecs.jeaf.components.MessageConstants means that class with name com.anaptecs.jeaf.components.MessageConstants will be excluded

cleanMetaInfDirectory

false

If parameter is set to true then META-INF directories for resources and test resources will be cleaned before new configuration files will be generated.

cleanOnly

false

If parameter is set to true then plugin does not generate any configuration files but only runs cleanup.

createVersionInfo

true

If parameter is set to true then a resource file containing version information will be generated.

JEAF X-Fun and Tools Configuration Parameters

Configuration Parameter

Required / Optional / Default

Description

Configuration Parameter

Required / Optional / Default

Description

detectXFunConfig

true

Plugin scans the class path for JEAF X-Fun configuration (@XFunConfig) and generates the corresponding JEAF configuration file.

detectAppInfo

true

Plugin scans the class path for application info (@AppInfo) and generates the corresponding JEAF configuration file.

detectRuntimeInfo

true

Plugin scans the class path for information about the runtime environment (@RuntimeInfo) and generates the corresponding JEAF configuration file.

detectConfigurationProviderConfig

true

Plugin scans the class path for configuration provider config (@ConfigurationProviderConfig) and generates the corresponding JEAF configuration file.

detectTraceConfig

true

Plugin scans the class path for trace configuration (@TraceConfig) and generates the corresponding JEAF configuration file.

detectTraceObjectFormatter

true

Plugin scans the class path for trace object formatters (@TraceObjectFormatter) and generates the corresponding JEAF configuration file.

detectStartupInfoConfig

true

Plugin scans the class path for a startup info configuration (@StartupInfoConfig) and generates the corresponding JEAF configuration file.

detectStartupInfoWriterImpl

true

Plugin scans the class path for startup info writers (@StartupInfoWriterImpl) and generates the corresponding JEAF configuration file.

detectDatatypeConverterImpls

true

Plugin scans the class path for datatype converters (@DatatypeConverterImpl) and generates the corresponding JEAF configuration file.

detectMessageResources

true

Plugin scans the class path for message resources (@MessageResource) and generates the corresponding JEAF configuration file.

detectToolsConfig

true

Plugin scans the class path for JEAF Tools configurations (@ToolsConfig) and generates the corresponding JEAF configuration file.

For further information about JEAF X-Fun and JEAF Tools please refer to:

JEAF Core Configuration Parameters

Configuration Parameter

Required / Optional / Default

Description

Configuration Parameter

Required / Optional / Default

Description

detectLifecycleManagerFactory

true

Plugin scans the class path for life cycle manager factories (@LifecycleManagerFactory) and generates the corresponding JEAF configuration file.

detectCoreFactory

true

Plugin scans the class path for JEAF Core factories (@CoreFactory) and generates the corresponding JEAF configuration file.

detectCoreConfig

true

Plugin scans the class path for JEAF Core configurations (@CoreConfig) and generates the corresponding JEAF configuration file.

detectSchedulingConfig

true

Plugin scans the class path for JEAF scheduling configuration (@SchedulingConfig) and generates the corresponding JEAF configuration file.

detectSecurityConfig

true

Plugin scans the class path for JEAF security configuration (@SecurityConfig) and generates the corresponding JEAF configuration file.

detectSchedulerCredentials

true

Plugin scans the class path for JEAF scheduler credentials (@SchedulerCredentials) and generates the corresponding JEAF configuration file.

detectEJBClientServiceChannelConfig

true

Plugin scans the class path for JEAF EJB Client Service Channel configuration (@EJBClientServiceChannelConfig) and generates the corresponding JEAF configuration file.

detectEJBContainerConfig

true

lugin scans the class path for JEAF EJB Container configuration (@EJBContainerConfig) and generates the corresponding JEAF configuration file.

detectComponentFactories

true

Plugin scans the class path for component factories (@ComponentFactory) and generates the corresponding JEAF configuration file.

detectServiceProviderFactories

true

Plugin scans the class path for service provider factories (@ServiceProviderFactory) and generates the corresponding JEAF configuration file.

detectActivities

true

Plugin scans the class path for activity implementation (@JEAFActivityImpl) and generates the corresponding JEAF configuration file.

For further information about JEAF Core please refer to:

JEAF Persistence Configuration Parameters

Configuration Parameter

Required / Optional / Default

Description

Configuration Parameter

Required / Optional / Default

Description

detectPersistenceConfig

true

Plugin scans the class path for JEAF Persistence configurations (@PersistenceConfig) and generates the corresponding JEAF configuration file.

For further information about JEAF Core please refer to:

JEAF Workload Management Configuration Parameters

Configuration Parameter

Required / Optional / Default

Description

Configuration Parameter

Required / Optional / Default

Description

detectWorkloadManagerConfig

true

Plugin scans the class path for JEAF workload manager configuration (@WorkloadManagementConfig) and generates the corresponding JEAF configuration file.

detectWorkloadMappings

true

Plugin scans the class path for JEAF workload mappings (@StaticWorkloadConfig and @ElasticWorkloadConfig) and generates the corresponding JEAF configuration file.

detectPipelineConfig

true

Plugin scans the class path for JEAF workload pipeline configurations (@PipelineConfig) and generates the corresponding JEAF configuration file.

For further information about JEAF Workload Management please refer to:

JEAF Fast Lane Configuration Parameters

Configuration Parameter

Required / Optional / Default

Description

Configuration Parameter

Required / Optional / Default

Description

detectFastLaneConfig

true

Plugin scans the class path for JEAF FastLane web server configuration (@Path, @WebServlet and @WebFilter) and generates the corresponding JEAF configuration file.

For further information about JEAF Fast Lane please refer to:

Sample Configuration

 

<!-- JEAF Maven Plugin will generate JEAF configuration files. Besides executing the plugin during build no specific configurations are required to use JEAF X-Fun. --> <plugin> <groupId>com.anaptecs.jeaf.maven</groupId> <artifactId>jeaf-maven-plugin</artifactId> <version>${maven.jeaf-plugin.version}</version> <executions> <!-- Cleanup run. All existing generated files will be deleted before they will be generated again. --> <execution> <id>Clean</id> <goals> <goal>GenerateJEAFConfig</goal> </goals> <phase>clean</phase> <configuration> <resourceGenDirectory>${basedir}/src-gen/main/resources</resourceGenDirectory> <cleanMetaInfDirectory>true</cleanMetaInfDirectory> <cleanOnly>true</cleanOnly> </configuration> </execution> <!-- Generate configuration files. --> <execution> <id>GenerateConfigs</id> <goals> <goal>GenerateJEAFConfig</goal> </goals> <configuration> <resourceGenDirectory>${basedir}/src-gen/main/resources</resourceGenDirectory> <targetDirectory>${basedir}/target/classes</targetDirectory> </configuration> </execution> </executions> </plugin>