Drools5 Integration Helper 1.3.0 user guide


Add to my manuals
61 Pages

advertisement

Drools5 Integration Helper 1.3.0 user guide | Manualzz

Chapter 4. Maven Archetype - Drools5

Integration Helper Archetype

Introduction

It is possible to automatically generated a basic Maven project that integrate all the Drools5-Integration-

Helper features. To do so, a Maven archetype is provided. This archetype provides the following stuff:

• Maven 2 project, with references to the required libraries and plugin.

• Example of Annotated interfaces.

• Example of Annotated classes.

• Using Field oriented annotations.

• Using PreCondition oriented annotations.

• Example of JUnit for the two previous entries.

Presentation of what is an archetype is out of the scope of this document. Please refer to Maven Archetype plugin [http://maven.apache.org/plugins/maven-archetype-plugin/] for more information on the archetype plugin.

Usage

The creation of the Maven 2 project is based on the maven-archetype-plugin. It is possible to use the following call, from a terminal: mvn \

archetype:generate \

-DarchetypeGroupId=org.boretti.drools.integration \

-DarchetypeArtifactId=drools5-integration-helper-archetype \

-DarchetypeVersion=1.3.0

The system will then ask you several questions (like package name for example). You must reply to the various questions and then a default Maven project, based on the archetype, will be created. This archetype is directly usable.

Example of usage

For example, it is possible to use the previous command:

[INFO] Scanning for projects...

[INFO] Searching repository for plugin with prefix: 'archetype'.

[INFO] ------------------------------------------------------------------------

[INFO] Building Maven Default Project

[INFO] task-segment: [archetype:generate] (aggregator-style)

[INFO] ------------------------------------------------------------------------

[INFO] Preparing archetype:generate

[INFO] No goals needed for project - skipping

40

Maven Archetype - Drools5

Integration Helper Archetype

[INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.

[INFO] Setting property: velocimacro.messages.on => 'false'.

[INFO] Setting property: resource.loader => 'classpath'.

[INFO] Setting property: resource.manager.logwhenfound => 'false'.

[INFO] [archetype:generate]

[INFO] Generating project in Interactive mode

[WARNING] No archetype repository found. Falling back to central repository (http://repo1.maven.org/maven2).

[WARNING] Use -DarchetypeRepository=<your repository> if archetype's repository is elsewhere.

Define value for groupId: :

Here input grpid

Define value for artifactId: :

Here input artifactid

Define value for version: 1.0-SNAPSHOT: :

Here input 1.0-SNAPSHOT

Define value for package: grpid: :

Here input package

Confirm properties configuration: groupId: grpid artifactId: artifactid version: 1.0-SNAPSHOT package: package

Y: :

Finally confirm the data you input

[INFO] ------------------------------------------------------------------------

[INFO] BUILD SUCCESSFUL

[INFO] ------------------------------------------------------------------------

[INFO] Total time: 25 seconds

[INFO] Finished at: Sun Nov 15 12:46:56 CET 2009

[INFO] Final Memory: 8M/15M

[INFO] ------------------------------------------------------------------------

The resulting folder will be named artifactid. It will contains a single pom.xml file. A src folder will be created. It will contains the main and test folder. You will then have a drools folder for the drools file, a java folder for the java source.

41

advertisement

Was this manual useful for you? Yes No
Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Related manuals

advertisement

Table of contents