Initial check-in of Activiti JAR module, #410, #415

This commit is contained in:
Martin Bergljung 2016-09-30 12:10:35 +01:00
parent 0b8db99cd8
commit c2ac314930
51 changed files with 1649 additions and 1395 deletions

View File

@ -7,8 +7,9 @@ This project is released under the [Apache License, Version 2.0](http://www.apac
## News ## News
- 2015-10-19: SDK 2.1.1 released to Maven Central. Docs for [Community](http://docs.alfresco.com/community/concepts/alfresco-sdk-intro.html), [Enterprise](http://docs.alfresco.com/5.0/concepts/alfresco-sdk-intro.html), [Release notes](https://artifacts.alfresco.com/nexus/content/repositories/alfresco-docs/alfresco-sdk-aggregator/latest/github-report.html) - 2016-02-20: SDK 2.2.0 released to Maven Central. Docs for [Community](http://docs.alfresco.com/community/concepts/alfresco-sdk-intro.html), [Enterprise](http://docs.alfresco.com/5.1/concepts/alfresco-sdk-intro.html), [Release notes](https://artifacts.alfresco.com/nexus/content/repositories/alfresco-docs/alfresco-sdk-aggregator/latest/github-report.html)
- 2015-05-20: SDK 2.1.0 released to Maven Central. Docs for [Community](http://docs.alfresco.com/community/concepts/alfresco-sdk-intro.html), [Enterprise](http://docs.alfresco.com/5.0/concepts/alfresco-sdk-intro.html), [Release notes](https://artifacts.alfresco.com/nexus/content/repositories/alfresco-docs/alfresco-sdk-aggregator/latest/github-report.html) - 2015-10-19: SDK 2.1.1 released to Maven Central. Docs for [Community](http://docs.alfresco.com/community/concepts/alfresco-sdk-intro.html), [Enterprise](http://docs.alfresco.com/5.0/concepts/alfresco-sdk-intro.html)
- 2015-05-20: SDK 2.1.0 released to Maven Central. Docs for [Community](http://docs.alfresco.com/community/concepts/alfresco-sdk-intro.html), [Enterprise](http://docs.alfresco.com/5.0/concepts/alfresco-sdk-intro.html)
- 2014-12-23: SDK 2.0.0 release to Maven Central. [Docs](http://docs.alfresco.com/sdk2.0/concepts/alfresco-sdk-intro.html), [Release Notes](https://artifacts.alfresco.com/nexus/content/repositories/alfresco-docs/alfresco-sdk-aggregator/archive/2.0.0/github-report.htm) - 2014-12-23: SDK 2.0.0 release to Maven Central. [Docs](http://docs.alfresco.com/sdk2.0/concepts/alfresco-sdk-intro.html), [Release Notes](https://artifacts.alfresco.com/nexus/content/repositories/alfresco-docs/alfresco-sdk-aggregator/archive/2.0.0/github-report.htm)
- 2014-08-22: First SNAPSHOT of SDK 2.0.0 in the [OSS Sonatype Repository](https://oss.sonatype.org/content/repositories/snapshots/org/alfresco/maven/alfresco-sdk-parent/2.0.0-SNAPSHOT/)! - 2014-08-22: First SNAPSHOT of SDK 2.0.0 in the [OSS Sonatype Repository](https://oss.sonatype.org/content/repositories/snapshots/org/alfresco/maven/alfresco-sdk-parent/2.0.0-SNAPSHOT/)!
- 2014-07: Project fully migrated from [Google Code](https://code.google.com/p/maven-alfresco-archetypes). - 2014-07: Project fully migrated from [Google Code](https://code.google.com/p/maven-alfresco-archetypes).
@ -16,20 +17,23 @@ This project is released under the [Apache License, Version 2.0](http://www.apac
## User Getting Started ## User Getting Started
### Latest Documentation ### Latest Documentation
To get started with Alfresco SDK 2.1.1 (latest) visit the offical Alfresco Documentation for: To get started with Alfresco SDK 2.2.0 (latest) visit the offical Alfresco Documentation for:
- [Alfresco Community 5.0.d and above](http://docs.alfresco.com/community/concepts/alfresco-sdk-intro.html) - [Alfresco Community 5.1 and above](http://docs.alfresco.com/community/concepts/alfresco-sdk-intro.html)
- [Alfresco Enterprise 5.0.1 and above](http://docs.alfresco.com/5.0/concepts/alfresco-sdk-intro.html) - [Alfresco Enterprise 5.1 and above](http://docs.alfresco.com/5.1/concepts/alfresco-sdk-intro.html)
#### Previous versions Documentation #### Previous versions Documentation
- Documentation for [Alfresco SDK 2.0](http://docs.alfresco.com/sdk2.0/concepts/alfresco-sdk-intro.html) (compatible with Alfresco 5.0.d Community and 5.0.0 Enterprise) - Documentation for [Alfresco SDK 2.1](http://docs.alfresco.com/sdk2.1/concepts/alfresco-sdk-intro.html) (compatible with Alfresco 5.0.d Community and 5.0.1 Enterprise)
- Documentation for [Alfresco SDK 2.0](http://docs.alfresco.com/sdk2.0/concepts/alfresco-sdk-intro.html) (compatible with Alfresco 5.0.c Community and 5.0.0 Enterprise)
- Documentation for [Alfresco SDK 1.1.1](http://docs.alfresco.com/4.2/concepts/dev-extensions-maven-sdk-intro.html) (compatible with Alfresco 4.2) - Documentation for [Alfresco SDK 1.1.1](http://docs.alfresco.com/4.2/concepts/dev-extensions-maven-sdk-intro.html) (compatible with Alfresco 4.2)
### Samples ### Samples
Sample extension projects that use the SDK, maintained by @ohej in the [Alfresco SDK Samples project](https://github.com/Alfresco/alfresco-sdk-samples/). Sample extension projects that use the SDK:
- [Alfresco SDK Samples for 5.1 (JARs)](https://github.com/Alfresco/alfresco-sdk-samples/tree/alfresco-51/all-in-one).
- [Alfresco SDK Samples for 5.0 (AMPs)](https://github.com/Alfresco/alfresco-sdk-samples/tree/alfresco-50/all-in-one).
### Command reference ### Command reference
A list of supported features and commands, explanation of Maven profiles and commands is kept in the [Alfresco Official Docs](http://docs.alfresco.com/5.0/concepts/alfresco-sdk-cmd-reference.html). A list of supported features and commands is kept in the [Alfresco Official Docs](http://docs.alfresco.com/5.1/concepts/alfresco-sdk-cmd-reference.html).
### Want to get up to speed quickly in Eclipse? Check out this video! ### Want to get up to speed quickly in Eclipse? Check out this video!

View File

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.alfresco.maven.archetype</groupId>
<artifactId>activiti-jar-archetype</artifactId>
<packaging>maven-archetype</packaging>
<name>Alfresco SDK - Activiti JAR Archetype</name>
<description>Sample project with full support for lifecycle and rapid development of Activiti JARs</description>
<parent>
<groupId>org.alfresco.maven</groupId>
<artifactId>alfresco-sdk-aggregator</artifactId>
<version>3.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>archetype-resources/pom.xml</include>
<include>archetype-resources/run.sh</include>
<include>archetype-resources/run.bat</include>
<include>archetype-resources/debug.sh</include>
<include>archetype-resources/debug.bat</include>
<include>META-INF/maven/archetype-metadata.xml</include>
</includes>
<filtering>true</filtering>
</resource>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>archetype-resources/pom.xml</exclude>
<exclude>archetype-resources/run.sh</exclude>
<exclude>archetype-resources/run.bat</exclude>
<exclude>archetype-resources/debug.sh</exclude>
<exclude>archetype-resources/debug.bat</exclude>
<exclude>META-INF/maven/archetype-metadata.xml</exclude>
</excludes>
<filtering>false</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven.resource.version}</version>
<configuration>
<useDefaultDelimiters>false</useDefaultDelimiters>
<delimiters>
<delimiter>@@</delimiter>
</delimiters>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="UTF-8"?>
<archetype-descriptor
xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd"
name="Activiti JAR Archetype"
xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<requiredProperties>
<requiredProperty key="version">
<defaultValue>1.0-SNAPSHOT</defaultValue>
</requiredProperty>
</requiredProperties>
<fileSets>
<fileSet filtered="true" packaged="true" encoding="UTF-8">
<directory>src/main/java</directory>
<includes>
<include>**/*.java</include>
</includes>
</fileSet>
<fileSet filtered="true" packaged="true" encoding="UTF-8">
<directory>src/test/java</directory>
<includes>
<include>**/*.java</include>
</includes>
</fileSet>
<fileSet encoding="UTF-8" filtered="true">
<directory>src/main/resources</directory>
<includes>
<include>**/bpmn-models/**</include>
</includes>
</fileSet>
<fileSet encoding="UTF-8" filtered="false">
<directory>src/main/resources</directory>
<excludes>
<exclude>**/bpmn-models/**</exclude>
</excludes>
</fileSet>
<fileSet encoding="UTF-8" filtered="true">
<directory>src/test/resources</directory>
<includes>
<include>log4j-dev.properties</include>
</includes>
</fileSet>
<fileSet encoding="UTF-8" filtered="false">
<directory>src/test/resources</directory>
<excludes>
<exclude>log4j-dev.properties</exclude>
</excludes>
</fileSet>
<fileSet encoding="UTF-8" filtered="false">
<directory>src/test/license</directory>
<includes>
<include>**</include>
</includes>
</fileSet>
<fileSet encoding="UTF-8">
<directory></directory>
<includes>
<include>debug.sh</include>
<include>debug.bat</include>
<include>run.sh</include>
<include>run.bat</include>
<include>README.md</include>
</includes>
</fileSet>
</fileSets>
</archetype-descriptor>
R

View File

@ -0,0 +1,21 @@
# Alfresco Activiti JAR Module - SDK 3
To run use `mvn clean install alfresco:run` or `./run.sh` and verify that it
* Runs the embedded Tomcat + H2 DB
* Runs Activiti Explorer
* Optionally runs Activiti REST
* Packages both a JAR with customization
# Few things to notice
* No parent pom
* WAR assembly is handled by the Alfresco Maven Plugin configuration
* Standard JAR packaging and layout
* Works seamlessly with Eclipse and IntelliJ IDEA
* JRebel for hot reloading, JRebel maven plugin for generating rebel.xml, agent usage: `MAVEN_OPTS=-Xms256m -Xmx1G -agentpath:/home/martin/apps/jrebel/lib/libjrebel64.so`
* [Configurable Run mojo](https://github.com/Alfresco/alfresco-sdk/blob/sdk-3.0/plugins/alfresco-maven-plugin/src/main/java/org/alfresco/maven/plugin/RunMojo.java) in the `alfresco-maven-plugin`
* No unit testing/functional tests just yet

View File

@ -0,0 +1,9 @@
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Dev environment startup script for Alfresco Community ::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@echo off
set MAVEN_OPTS=-Xms1G -Xmx2G
mvnDebug clean install alfresco:run

View File

@ -0,0 +1,3 @@
#!/bin/bash
MAVEN_OPTS="-Xms1G -Xmx2G" mvnDebug clean install alfresco:run

View File

@ -0,0 +1,295 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>${groupId}</groupId>
<artifactId>${artifactId}</artifactId>
<version>${version}</version>
<name>${artifactId} Activiti Jar Module - SDK 3</name>
<description>Activiti JAR Module that produces a JAR file with Java extensions such as service task delegates. It also produces an application ZIP with workflow definition, forms etc that can be deployed via /activiti-app - SDK 3</description>
<packaging>jar</packaging>
<properties>
<!-- Alfresco Maven Plugin version to use -->
<alfresco.sdk.version>@@alfresco.sdk.parent.version@@</alfresco.sdk.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- Base directory for all RDBMS data and Content data -->
<activiti.datadir>${project.basedir}/activiti_data_dev</activiti.datadir>
<!-- Properties used in dependency declarations, you don't usually need to change these -->
<activiti.groupId>com.activiti</activiti.groupId>
<activiti.app.war.artifactId>activiti-app</activiti.app.war.artifactId> <!--This contains the Alfresco Activiti webapp, including the workflow engine. This webapp is also the user interface for people involved in the task and processes running in the Activiti engine. You also use this webapp to create and manage process definitions, and to display and define analytics reports on users' tasks and processes. -->
<activiti.admin.war.artifactId>activiti-admin</activiti.admin.war.artifactId> <!-- This contains the Alfresco Activiti Administrator webapp. You use this to administer and monitor your Alfresco Activiti engines.-->
<!-- The version of the Alfresco Activiti Enterprise Workflow Engine that the customization will run in -->
<activiti.version>1.5.1</activiti.version>
<!-- JRebel Hot reloading of classpath stuff and web resource stuff -->
<jrebel.version>1.1.6</jrebel.version>
<!-- Compile with Java 7, default is 5 -->
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<dependencies>
<!-- The main Activiti Enterprise application dependency that brings in all
needed classes to compile your customizations -->
<dependency>
<groupId>${activiti.groupId}</groupId>
<artifactId>activiti-app-logic</artifactId>
<version>${activiti.version}</version>
<exclusions>
<!-- Exclude the SLF4J JAR so we don't get multiple binding warnings when running -->
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Testing -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<!-- Logging, maybe needed for testing....
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.5</version>
</dependency>
-->
</dependencies>
<build>
<plugins>
<!-- Create the BAR with project process definitions, forms etc -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<id>create-app-zip</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
<zip destfile="${project.build.directory}/${project.artifactId}-app-${project.version}.zip">
<fileset dir="src/main/resources/apps/helloworld">
<include name="**"/>
</fileset>
</zip>
</tasks>
</configuration>
</execution>
</executions>
</plugin>
<!--
The Alfresco Maven Plugin contains all the logic to run the extension
in an embedded Tomcat with the H2 database.
-->
<plugin>
<groupId>org.alfresco.maven.plugin</groupId>
<artifactId>alfresco-maven-plugin</artifactId>
<version>${alfresco.sdk.version}</version>
<configuration>
<!-- We need the flat file H2 database to run Activiti -->
<enableH2>true</enableH2>
<!-- Bring in the Activiti Workflow Engine and Management webapp (i.e. activiti-app.war) -->
<enableActivitiApp>true</enableActivitiApp>
<!-- Optionally bring in the Activiti Admin App (i.e. activiti-admin.war) -->
<enableActivitiAdmin>false</enableActivitiAdmin>
<!-- Disable all Alfresco ECM apps by default -->
<alfrescoEdition>community</alfrescoEdition>
<enablePlatform>false</enablePlatform>
<enableSolr>false</enableSolr>
<enableShare>false</enableShare>
<!--
JARs that should be overlayed/applied to the Activiti App WAR
(i.e. activiti-app.war)
-->
<activitiModules>
<!-- Bring in this JAR project, need to be included here, otherwise resources from META-INF
will not be loaded, such as the test.html page
-->
<moduleDependency>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>${project.version}</version>
</moduleDependency>
</activitiModules>
</configuration>
</plugin>
<!-- Hot reloading with JRebel -->
<plugin>
<groupId>org.zeroturnaround</groupId>
<artifactId>jrebel-maven-plugin</artifactId>
<version>${jrebel.version}</version>
<executions>
<execution>
<id>generate-rebel-xml</id>
<phase>process-resources</phase>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<!-- For more information about how to configure JRebel plugin see:
http://manuals.zeroturnaround.com/jrebel/standalone/maven.html#maven-rebel-xml -->
<classpath>
<fallback>all</fallback>
<resources>
<resource>
<!--
Empty resource element marks default configuration. By
default it is placed first in generated configuration.
-->
</resource>
</resources>
</classpath>
<!--
alwaysGenerate - default is false
If 'false' - rebel.xml is generated if timestamps of pom.xml and the current rebel.xml file are not equal.
If 'true' - rebel.xml will always be generated
-->
<alwaysGenerate>true</alwaysGenerate>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.1</version>
<configuration>
<encoding>UTF-8</encoding>
<nonFilteredFileExtensions> <!-- jpg, jpeg, gif, bmp and png are added automatically -->
<nonFilteredFileExtension>ftl</nonFilteredFileExtension>
<nonFilteredFileExtension>acp</nonFilteredFileExtension>
<nonFilteredFileExtension>svg</nonFilteredFileExtension>
<nonFilteredFileExtension>pdf</nonFilteredFileExtension>
<nonFilteredFileExtension>doc</nonFilteredFileExtension>
<nonFilteredFileExtension>docx</nonFilteredFileExtension>
<nonFilteredFileExtension>xls</nonFilteredFileExtension>
<nonFilteredFileExtension>xlsx</nonFilteredFileExtension>
<nonFilteredFileExtension>ppt</nonFilteredFileExtension>
<nonFilteredFileExtension>pptx</nonFilteredFileExtension>
<nonFilteredFileExtension>bin</nonFilteredFileExtension>
<nonFilteredFileExtension>lic</nonFilteredFileExtension>
<nonFilteredFileExtension>swf</nonFilteredFileExtension>
<nonFilteredFileExtension>zip</nonFilteredFileExtension>
<nonFilteredFileExtension>msg</nonFilteredFileExtension>
<nonFilteredFileExtension>jar</nonFilteredFileExtension>
<nonFilteredFileExtension>ttf</nonFilteredFileExtension>
<nonFilteredFileExtension>eot</nonFilteredFileExtension>
<nonFilteredFileExtension>woff</nonFilteredFileExtension>
<nonFilteredFileExtension>woff2</nonFilteredFileExtension>
<nonFilteredFileExtension>css</nonFilteredFileExtension>
<nonFilteredFileExtension>ico</nonFilteredFileExtension>
<nonFilteredFileExtension>psd</nonFilteredFileExtension>
<nonFilteredFileExtension>js</nonFilteredFileExtension>
</nonFilteredFileExtensions>
</configuration>
</plugin>
</plugins>
<resources>
<!-- Filter the resource files in this project and do property substitutions -->
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<!-- The Project JAR Should not contain any process definition stuff,
it cannot be deployed via JAR in Activiti Enterprise -->
<excludes>
<exclude>apps/**</exclude>
</excludes>
</resource>
</resources>
<testResources>
<!-- Filter the test resource files in this project and do property substitutions -->
<testResource>
<directory>src/test/resources</directory>
<filtering>true</filtering>
</testResource>
<!-- Copy over the Activiti license to the classpath -->
<testResource>
<directory>src/test/license</directory>
<filtering>false</filtering>
</testResource>
</testResources>
</build>
<!--
Alfresco Maven Repositories
-->
<repositories>
<!-- Alfresco ECM -->
<repository>
<id>alfresco-public</id>
<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
</repository>
<repository>
<id>alfresco-public-snapshots</id>
<url>https://artifacts.alfresco.com/nexus/content/groups/public-snapshots</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</snapshots>
</repository>
<!-- Alfresco Enterprise Edition Artifacts, put username/pwd for server in settings.xml -->
<repository>
<id>alfresco-private-repository</id>
<url>https://artifacts.alfresco.com/nexus/content/groups/private</url>
</repository>
<!-- Activiti BPM -->
<repository>
<id>activiti-public</id>
<url>https://artifacts.alfresco.com/nexus/content/repositories/activiti-releases/</url>
</repository>
<repository>
<id>activiti-public-snapshots</id>
<url>https://artifacts.alfresco.com/nexus/content/groups/public-snapshots</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</snapshots>
</repository>
<!-- Activiti Enterprise Edition Artifacts, put username/pwd for server in settings.xml -->
<repository>
<id>activiti-private-repository</id>
<url>https://artifacts.alfresco.com/nexus/content/repositories/activiti-enterprise-releases</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>alfresco-plugin-public</id>
<url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
</pluginRepository>
<pluginRepository>
<id>alfresco-plugin-public-snapshots</id>
<url>https://artifacts.alfresco.com/nexus/content/groups/public-snapshots</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
</snapshots>
</pluginRepository>
</pluginRepositories>
</project>

View File

@ -0,0 +1,8 @@
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Dev environment startup script for Alfresco Community ::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
@echo off
set MAVEN_OPTS=-Xms1G -Xmx2G
mvn clean install alfresco:run

View File

@ -0,0 +1,3 @@
#!/bin/bash
MAVEN_OPTS="-Xms1G -Xmx2G" mvn clean install alfresco:run

View File

@ -0,0 +1,38 @@
#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
/*
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package ${package}.tasks.service;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.JavaDelegate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* A sample service task Java implementation
*
* @author martin.bergljung@alfresco.com
*/
public class HelloWorldServiceTask implements JavaDelegate {
private static Logger logger = LoggerFactory.getLogger(HelloWorldServiceTask.class);
public void execute(DelegateExecution execution) throws Exception {
logger.debug("Hello World from the Java Service Task!");
}
}

View File

@ -0,0 +1,20 @@
{
"models": [
{
"id": 2005,
"name": "Hello World",
"version": 1,
"modelType": 0,
"description": "The Hello World business process that is part of the Alfresco SDK 3.0 Activiti JAR Module Maven archetype",
"stencilSetId": 0,
"createdByFullName": " Administrator",
"createdBy": 1,
"lastUpdatedByFullName": " Administrator",
"lastUpdatedBy": 1,
"lastUpdated": "2016-09-29T12:38:13.716+0000"
}
],
"theme": "theme-1",
"icon": "glyphicon-cog",
"publishIdentityInfo": []
}

View File

@ -0,0 +1,141 @@
#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
<?xml version='1.0' encoding='UTF-8'?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:activiti="http://activiti.org/bpmn"
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI"
typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath"
targetNamespace="http://www.activiti.org/processdef" xmlns:modeler="http://activiti.com/modeler"
modeler:version="1.0en" modeler:exportDateTime="20160930093425488" modeler:modelId="2005"
modeler:modelVersion="11" modeler:modelLastUpdated="1475224420676">
<process id="HelloWorld" name="Hello World" isExecutable="true">
<documentation>The Hello World business process that is part of the Alfresco SDK 3.0 Activiti JAR Module Maven
archetype
</documentation>
<startEvent id="startHelloWorld" activiti:formKey="2006">
<extensionElements>
<modeler:form-reference-id><![CDATA[2006]]></modeler:form-reference-id>
<modeler:form-reference-name><![CDATA[Hello World Start]]></modeler:form-reference-name>
<modeler:editor-resource-id><![CDATA[startEvent1]]></modeler:editor-resource-id>
</extensionElements>
</startEvent>
<sequenceFlow id="sid-4A014247-BF0C-436D-B3CE-EA297F2A18FA" sourceRef="startHelloWorld"
targetRef="decideGreeting">
<extensionElements>
<modeler:editor-resource-id>
<![CDATA[sid-4A014247-BF0C-436D-B3CE-EA297F2A18FA]]></modeler:editor-resource-id>
</extensionElements>
</sequenceFlow>
<serviceTask id="decideGreeting" name="Decide greeting"
activiti:delegateExpression="${activiti_executeDecisionDelegate}">
<extensionElements>
<activiti:field name="decisionTableReferenceKey">
<activiti:string><![CDATA[DecideWhatGreeting]]></activiti:string>
</activiti:field>
<modeler:decisiontable-reference modeler:decisiontablereferenceid="2007"
modeler:decisiontablereferencename="Decide What Greeting"/>
<modeler:editor-resource-id>
<![CDATA[sid-B4E2D526-60B7-47B9-856C-FC824DA15708]]></modeler:editor-resource-id>
</extensionElements>
</serviceTask>
<sequenceFlow id="sid-E8B736FE-874D-4EDF-85A6-8B602F1503FD" sourceRef="decideGreeting"
targetRef="printGreetingFromJava">
<extensionElements>
<modeler:editor-resource-id>
<![CDATA[sid-E8B736FE-874D-4EDF-85A6-8B602F1503FD]]></modeler:editor-resource-id>
</extensionElements>
</sequenceFlow>
<serviceTask id="printGreetingFromJava" name="Print Greeting From Java"
activiti:class="${package}.tasks.service.HelloWorldServiceTask">
<extensionElements>
<modeler:editor-resource-id>
<![CDATA[sid-61E86F19-FC5F-4814-B9AB-2394B03171D6]]></modeler:editor-resource-id>
</extensionElements>
</serviceTask>
<sequenceFlow id="sid-AD10A830-F8B1-4DBA-9C48-DFD5136E3810" sourceRef="printGreetingFromJava"
targetRef="sid-68AE120D-AB55-4ED2-AFD5-845139236AD3">
<extensionElements>
<modeler:editor-resource-id>
<![CDATA[sid-AD10A830-F8B1-4DBA-9C48-DFD5136E3810]]></modeler:editor-resource-id>
</extensionElements>
</sequenceFlow>
<scriptTask id="sid-68AE120D-AB55-4ED2-AFD5-845139236AD3" name="Print Greeting from JS"
scriptFormat="JavaScript" activiti:autoStoreVariables="false">
<extensionElements>
<modeler:editor-resource-id>
<![CDATA[sid-68AE120D-AB55-4ED2-AFD5-845139236AD3]]></modeler:editor-resource-id>
</extensionElements>
<script><![CDATA[print("Hello World from JavaScript task:");
var userId = initiator;
print(dayGreeting + " " + userInfoBean.getUser(userId).getFullName());
print("You entered '" + greeting + "' as a greeting text.");
]]></script>
</scriptTask>
<sequenceFlow id="sid-6105A21B-6A76-41EC-B88E-78B3BE4A826F" sourceRef="sid-68AE120D-AB55-4ED2-AFD5-845139236AD3"
targetRef="endHelloWorld">
<extensionElements>
<modeler:editor-resource-id>
<![CDATA[sid-6105A21B-6A76-41EC-B88E-78B3BE4A826F]]></modeler:editor-resource-id>
</extensionElements>
</sequenceFlow>
<endEvent id="endHelloWorld">
<extensionElements>
<modeler:editor-resource-id>
<![CDATA[sid-9F0B5A13-7D1F-4ADF-8A08-7B9F0D851DA6]]></modeler:editor-resource-id>
</extensionElements>
<terminateEventDefinition/>
</endEvent>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_HelloWorld">
<bpmndi:BPMNPlane bpmnElement="HelloWorld" id="BPMNPlane_HelloWorld">
<bpmndi:BPMNShape bpmnElement="startHelloWorld" id="BPMNShape_startHelloWorld">
<omgdc:Bounds height="30.0" width="30.0" x="90.0" y="190.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="decideGreeting" id="BPMNShape_decideGreeting">
<omgdc:Bounds height="80.0" width="100.0" x="210.0" y="165.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sid-68AE120D-AB55-4ED2-AFD5-845139236AD3"
id="BPMNShape_sid-68AE120D-AB55-4ED2-AFD5-845139236AD3">
<omgdc:Bounds height="80.0" width="100.0" x="675.0" y="165.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="endHelloWorld" id="BPMNShape_endHelloWorld">
<omgdc:Bounds height="28.0" width="28.0" x="915.0" y="191.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="printGreetingFromJava" id="BPMNShape_printGreetingFromJava">
<omgdc:Bounds height="80.0" width="100.0" x="443.0" y="165.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="sid-AD10A830-F8B1-4DBA-9C48-DFD5136E3810"
id="BPMNEdge_sid-AD10A830-F8B1-4DBA-9C48-DFD5136E3810">
<omgdi:waypoint x="543.0" y="205.0"/>
<omgdi:waypoint x="675.0" y="205.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-4A014247-BF0C-436D-B3CE-EA297F2A18FA"
id="BPMNEdge_sid-4A014247-BF0C-436D-B3CE-EA297F2A18FA">
<omgdi:waypoint x="120.0" y="205.0"/>
<omgdi:waypoint x="210.0" y="205.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-E8B736FE-874D-4EDF-85A6-8B602F1503FD"
id="BPMNEdge_sid-E8B736FE-874D-4EDF-85A6-8B602F1503FD">
<omgdi:waypoint x="310.0" y="205.0"/>
<omgdi:waypoint x="443.0" y="205.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="sid-6105A21B-6A76-41EC-B88E-78B3BE4A826F"
id="BPMNEdge_sid-6105A21B-6A76-41EC-B88E-78B3BE4A826F">
<omgdi:waypoint x="775.0" y="205.0"/>
<omgdi:waypoint x="915.0" y="205.0"/>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>

View File

@ -0,0 +1,403 @@
#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
{
"resourceId": 2005,
"properties": {
"process_id": "HelloWorld",
"name": "Hello World",
"documentation": "The Hello World business process that is part of the Alfresco SDK 3.0 Activiti JAR Module Maven archetype",
"process_author": "",
"process_version": "",
"process_namespace": "http://www.activiti.org/processdef",
"executionlisteners": "",
"eventlisteners": "",
"signaldefinitions": "",
"messagedefinitions": "",
"executionvariables": "",
"metadata": ""
},
"stencil": {
"id": "BPMNDiagram"
},
"childShapes": [
{
"resourceId": "startEvent1",
"properties": {
"overrideid": "startHelloWorld",
"name": "",
"documentation": "",
"executionlisteners": "",
"initiator": "",
"formkeydefinition": "",
"formreference": {
"id": 2006,
"name": "Hello World Start",
"referenceId": 2005,
"variablesmapping": []
},
"fieldstovariables": "",
"formproperties": ""
},
"stencil": {
"id": "StartNoneEvent"
},
"childShapes": [],
"outgoing": [
{
"resourceId": "sid-4A014247-BF0C-436D-B3CE-EA297F2A18FA"
}
],
"bounds": {
"lowerRight": {
"x": 120,
"y": 220
},
"upperLeft": {
"x": 90,
"y": 190
}
},
"dockers": []
},
{
"resourceId": "sid-B4E2D526-60B7-47B9-856C-FC824DA15708",
"properties": {
"overrideid": "decideGreeting",
"name": "Decide greeting",
"documentation": "",
"asynchronousdefinition": "false",
"exclusivedefinition": "false",
"executionlisteners": "",
"multiinstance_type": "None",
"multiinstance_cardinality": "",
"multiinstance_collection": "",
"multiinstance_variable": "",
"multiinstance_condition": "",
"isforcompensation": "false",
"decisiontaskdecisiontablereference": {
"id": 2007,
"name": "Decide What Greeting",
"referenceId": 2005,
"variablesmapping": []
}
},
"stencil": {
"id": "DecisionTask"
},
"childShapes": [],
"outgoing": [
{
"resourceId": "sid-E8B736FE-874D-4EDF-85A6-8B602F1503FD"
}
],
"bounds": {
"lowerRight": {
"x": 310,
"y": 245
},
"upperLeft": {
"x": 210,
"y": 165
}
},
"dockers": []
},
{
"resourceId": "sid-4A014247-BF0C-436D-B3CE-EA297F2A18FA",
"properties": {
"overrideid": "",
"name": "",
"documentation": "",
"conditionsequenceflow": "",
"executionlisteners": "",
"defaultflow": "false"
},
"stencil": {
"id": "SequenceFlow"
},
"childShapes": [],
"outgoing": [
{
"resourceId": "sid-B4E2D526-60B7-47B9-856C-FC824DA15708"
}
],
"bounds": {
"lowerRight": {
"x": 209.3515625,
"y": 205
},
"upperLeft": {
"x": 120.53125,
"y": 205
}
},
"dockers": [
{
"x": 15,
"y": 15
},
{
"x": 50,
"y": 40
}
],
"target": {
"resourceId": "sid-B4E2D526-60B7-47B9-856C-FC824DA15708"
}
},
{
"resourceId": "sid-68AE120D-AB55-4ED2-AFD5-845139236AD3",
"properties": {
"scriptformat": "JavaScript",
"scripttext": "print(\"Hello World from JavaScript task:\");\nvar userId = initiator;\nprint(dayGreeting + \" \" + userInfoBean.getUser(userId).getFullName());\nprint(\"You entered '\" + greeting + \"' as a greeting text.\");\n",
"executionvariables": "",
"overrideid": "",
"name": "Print Greeting from JS",
"documentation": "",
"asynchronousdefinition": "false",
"exclusivedefinition": "false",
"executionlisteners": "",
"multiinstance_type": "None",
"multiinstance_cardinality": "",
"multiinstance_collection": "",
"multiinstance_variable": "",
"multiinstance_condition": "",
"isforcompensation": "false"
},
"stencil": {
"id": "ScriptTask"
},
"childShapes": [],
"outgoing": [
{
"resourceId": "sid-6105A21B-6A76-41EC-B88E-78B3BE4A826F"
}
],
"bounds": {
"lowerRight": {
"x": 775,
"y": 245
},
"upperLeft": {
"x": 675,
"y": 165
}
},
"dockers": []
},
{
"resourceId": "sid-9F0B5A13-7D1F-4ADF-8A08-7B9F0D851DA6",
"properties": {
"overrideid": "endHelloWorld",
"name": "",
"documentation": "",
"executionlisteners": ""
},
"stencil": {
"id": "EndTerminateEvent"
},
"childShapes": [],
"outgoing": [],
"bounds": {
"lowerRight": {
"x": 943,
"y": 219
},
"upperLeft": {
"x": 915,
"y": 191
}
},
"dockers": []
},
{
"resourceId": "sid-6105A21B-6A76-41EC-B88E-78B3BE4A826F",
"properties": {
"overrideid": "",
"name": "",
"documentation": "",
"conditionsequenceflow": "",
"executionlisteners": "",
"defaultflow": "false"
},
"stencil": {
"id": "SequenceFlow"
},
"childShapes": [],
"outgoing": [
{
"resourceId": "sid-9F0B5A13-7D1F-4ADF-8A08-7B9F0D851DA6"
}
],
"bounds": {
"lowerRight": {
"x": 914.453125,
"y": 205
},
"upperLeft": {
"x": 775.40625,
"y": 205
}
},
"dockers": [
{
"x": 50,
"y": 40
},
{
"x": 14,
"y": 14
}
],
"target": {
"resourceId": "sid-9F0B5A13-7D1F-4ADF-8A08-7B9F0D851DA6"
}
},
{
"resourceId": "sid-61E86F19-FC5F-4814-B9AB-2394B03171D6",
"properties": {
"overrideid": "printGreetingFromJava",
"name": "Print Greeting From Java",
"documentation": "",
"asynchronousdefinition": "false",
"exclusivedefinition": "false",
"executionlisteners": "",
"multiinstance_type": "None",
"multiinstance_cardinality": "",
"multiinstance_collection": "",
"multiinstance_variable": "",
"multiinstance_condition": "",
"isforcompensation": "false",
"servicetaskclass": "${package}.tasks.service.HelloWorldServiceTask",
"servicetaskexpression": "",
"servicetaskdelegateexpression": "",
"servicetaskfields": "",
"servicetaskresultvariable": "",
"executionvariables": ""
},
"stencil": {
"id": "ServiceTask"
},
"childShapes": [],
"outgoing": [
{
"resourceId": "sid-AD10A830-F8B1-4DBA-9C48-DFD5136E3810"
}
],
"bounds": {
"lowerRight": {
"x": 543,
"y": 245
},
"upperLeft": {
"x": 443,
"y": 165
}
},
"dockers": []
},
{
"resourceId": "sid-AD10A830-F8B1-4DBA-9C48-DFD5136E3810",
"properties": {
"overrideid": "",
"name": "",
"documentation": "",
"conditionsequenceflow": "",
"executionlisteners": "",
"defaultflow": "false"
},
"stencil": {
"id": "SequenceFlow"
},
"childShapes": [],
"outgoing": [
{
"resourceId": "sid-68AE120D-AB55-4ED2-AFD5-845139236AD3"
}
],
"bounds": {
"lowerRight": {
"x": 674.15625,
"y": 205
},
"upperLeft": {
"x": 543.84375,
"y": 205
}
},
"dockers": [
{
"x": 50,
"y": 40
},
{
"x": 50,
"y": 40
}
],
"target": {
"resourceId": "sid-68AE120D-AB55-4ED2-AFD5-845139236AD3"
}
},
{
"resourceId": "sid-E8B736FE-874D-4EDF-85A6-8B602F1503FD",
"properties": {
"overrideid": "",
"name": "",
"documentation": "",
"conditionsequenceflow": "",
"executionlisteners": "",
"defaultflow": "false",
"showdiamondmarker": false
},
"stencil": {
"id": "SequenceFlow"
},
"childShapes": [],
"outgoing": [
{
"resourceId": "sid-61E86F19-FC5F-4814-B9AB-2394B03171D6"
}
],
"bounds": {
"lowerRight": {
"x": 443,
"y": 205
},
"upperLeft": {
"x": 310.59375,
"y": 205
}
},
"dockers": [
{
"x": 50,
"y": 40
},
{
"x": 1,
"y": 40
}
],
"target": {
"resourceId": "sid-61E86F19-FC5F-4814-B9AB-2394B03171D6"
}
}
],
"bounds": {
"lowerRight": {
"x": 1200,
"y": 1050
},
"upperLeft": {
"x": 0,
"y": 0
}
},
"stencilset": {
"url": "stencilsets/bpmn2.0/bpmn2.0.json",
"namespace": "http://b3mn.org/stencilset/bpmn2.0#"
},
"ssextensions": []
}

View File

@ -0,0 +1,53 @@
{
"referenceId": 2005,
"name": "Decide What Greeting",
"description": "Decide, depending on time of day, what greeting to display.",
"editorJson": {
"id": 2007,
"name": "Decide What Greeting",
"key": "DecideWhatGreeting",
"description": "Decide, depending on time of day, what greeting to display.",
"hitIndicator": "FIRST",
"inputExpressions": [
{
"id": "3",
"variableId": "timeofday",
"variableType": "formfield",
"type": "string",
"label": "Time of day",
"entries": null,
"newVariable": false
}
],
"outputExpressions": [
{
"id": "4",
"variableId": "dayGreeting",
"variableType": "variable",
"type": "string",
"label": "DayGreeting",
"entries": null,
"newVariable": true
}
],
"rules": [
{
"3": "== \"time_of_day_morning\"",
"4": "\"Good Morning!\""
},
{
"3": "== \"time_of_day_lunch\"",
"4": "\"Good Day!\""
},
{
"3": "== \"time_of_day_dinner\"",
"4": "\"Good Evening!\""
},
{
"3": "== \"time_of_day_night\"",
"4": "\"Good Night!\""
}
],
"executionVariables": []
}
}

View File

@ -0,0 +1,201 @@
{
"referenceId": 2005,
"name": "Hello World Start",
"description": "The form for the Start task in the Hello World business process.",
"editorJson": {
"tabs": [],
"fields": [
{
"fieldType": "ContainerRepresentation",
"id": "1475149613209",
"name": "Label",
"type": "container",
"value": null,
"required": false,
"readOnly": false,
"overrideId": false,
"colspan": 1,
"placeholder": null,
"minLength": 0,
"maxLength": 0,
"minValue": null,
"maxValue": null,
"regexPattern": null,
"optionType": null,
"hasEmptyValue": null,
"options": null,
"restUrl": null,
"restResponsePath": null,
"restIdProperty": null,
"restLabelProperty": null,
"tab": null,
"className": null,
"dateDisplayFormat": null,
"layout": null,
"sizeX": 2,
"sizeY": 1,
"row": -1,
"col": -1,
"visibilityCondition": null,
"numberOfColumns": 2,
"fields": {
"1": [
{
"fieldType": "FormFieldRepresentation",
"id": "greeting",
"name": "Greeting",
"type": "text",
"value": null,
"required": true,
"readOnly": false,
"overrideId": false,
"colspan": 1,
"placeholder": null,
"minLength": 0,
"maxLength": 0,
"minValue": null,
"maxValue": null,
"regexPattern": null,
"optionType": null,
"hasEmptyValue": null,
"options": null,
"restUrl": null,
"restResponsePath": null,
"restIdProperty": null,
"restLabelProperty": null,
"tab": null,
"className": null,
"params": {
"existingColspan": 1,
"maxColspan": 2
},
"dateDisplayFormat": null,
"layout": {
"row": -1,
"column": -1,
"colspan": 1
},
"sizeX": 1,
"sizeY": 1,
"row": -1,
"col": -1,
"visibilityCondition": null
}
],
"2": []
}
},
{
"fieldType": "ContainerRepresentation",
"id": "1475149862241",
"name": "Label",
"type": "container",
"value": null,
"required": false,
"readOnly": false,
"overrideId": false,
"colspan": 1,
"placeholder": null,
"minLength": 0,
"maxLength": 0,
"minValue": null,
"maxValue": null,
"regexPattern": null,
"optionType": null,
"hasEmptyValue": null,
"options": null,
"restUrl": null,
"restResponsePath": null,
"restIdProperty": null,
"restLabelProperty": null,
"tab": null,
"className": null,
"dateDisplayFormat": null,
"layout": null,
"sizeX": 2,
"sizeY": 1,
"row": -1,
"col": -1,
"visibilityCondition": null,
"numberOfColumns": 2,
"fields": {
"1": [
{
"fieldType": "RestFieldRepresentation",
"id": "timeofday",
"name": "Time of Day",
"type": "dropdown",
"value": "Choose one...",
"required": false,
"readOnly": false,
"overrideId": false,
"colspan": 1,
"placeholder": null,
"minLength": 0,
"maxLength": 0,
"minValue": null,
"maxValue": null,
"regexPattern": null,
"optionType": null,
"hasEmptyValue": true,
"options": [
{
"id": "empty",
"name": "Choose one..."
},
{
"id": "time_of_day_morning",
"name": "Morning"
},
{
"id": "time_of_day_lunch",
"name": "Lunch"
},
{
"id": "time_of_day_dinner",
"name": "Dinner"
},
{
"id": "time_of_day_night",
"name": "Night"
}
],
"restUrl": null,
"restResponsePath": null,
"restIdProperty": null,
"restLabelProperty": null,
"tab": null,
"className": null,
"params": {
"existingColspan": 1,
"maxColspan": 2
},
"dateDisplayFormat": null,
"layout": {
"row": -1,
"column": -1,
"colspan": 1
},
"sizeX": 1,
"sizeY": 1,
"row": -1,
"col": -1,
"visibilityCondition": null,
"endpoint": null,
"requestHeaders": null
}
],
"2": []
}
}
],
"outcomes": [],
"javascriptEvents": [],
"className": "",
"style": "",
"customFieldTemplates": {},
"metadata": {},
"variables": [],
"gridsterForm": false
}
}

View File

@ -0,0 +1,9 @@
# Enterprise License location
Put the Activiti Enterprise license file (activiti.lic) in this directory.
It will then be copied into the WAR..............
And then not be part of any other classpaths.

View File

@ -0,0 +1,35 @@
server.onpremise=true
server.stencil.custom.allowed=true
server.contextroot=/activiti-app
# Database connection
datasource.driver=org.h2.Driver
datasource.url=jdbc:h2:${activiti.datadir}/h2/activiti;AUTO_SERVER=TRUE;DB_CLOSE_ON_EXIT=FALSE;LOCK_TIMEOUT=10000;MVCC=FALSE;LOCK_MODE=0
datasource.username=alfresco
datasource.password=alfresco
hibernate.dialect=org.hibernate.dialect.H2Dialect
# Elastic Search server config for historical process data
elastic-search.server.type=none
elastic-search.cluster.name=activiti-elastic-search-cluster-dev
elastic-search.enable.http=true
elastic-search.data.path=${activiti.datadir}/es
event.generation.enabled=true
event.processing.enabled=true
# Administrator login username = email
admin.email=admin@app.activiti.com
# koala
admin.passwordHash=4efe081594ce25ee4efd9f7067f7f678a347bccf2de201f3adf2a3eb544850b465b4e51cdc3fcdde
admin.lastname=Administrator
admin.group=Superusers
# Where to store any uploaded files
contentstorage.fs.rootFolder=${activiti.datadir}/contentstore
contentstorage.fs.createRoot=true
contentstorage.fs.depth=4
contentstorage.fs.blockSize=1024
# Disable Cross-Site-Request-Forgery (CSRF) protection, so we can access from other client app via REST
security.csrf.disabled=true

View File

@ -0,0 +1,3 @@
ldap.authentication.enabled=false
ldap.synchronization.full.enabled=false
ldap.synchronization.differential.enabled=false

View File

@ -0,0 +1,40 @@
#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
# This file is copied (with RunMojo) into target/activitiApp-war/WEB-INF/classes dir before webapp deployment
#
log4j.rootLogger=INFO, CA, File
# ConsoleAppender
log4j.appender.CA=org.apache.log4j.ConsoleAppender
log4j.appender.CA.layout=org.apache.log4j.PatternLayout
log4j.appender.CA.layout.ConversionPattern= %d{hh:mm:ss,SSS} [%t] %-5p %c %x - %m%n
# File Appender
log4j.appender.File=org.apache.log4j.RollingFileAppender
log4j.appender.File.File=${project.build.directory}/activiti.log
log4j.appender.File.threshold=INFO
log4j.appender.File.layout=org.apache.log4j.PatternLayout
log4j.appender.File.layout.ConversionPattern=%d{ISO8601} %-5p [%c] %m%n
log4j.appender.File.MaxFileSize=100MB
log4j.appender.File.MaxBackupIndex=1
# Custom tweaks
log4j.logger.org.apache.ibatis.level=INFO
log4j.logger.javax.activation.level=INFO
log4j.logger.com.codahale.metrics=WARN
log4j.logger.com.ryantenney=WARN
log4j.logger.com.zaxxer=WARN
log4j.logger.org.apache=WARN
log4j.logger.org.hibernate=WARN
log4j.logger.org.hibernate.engine.internal=WARN
log4j.logger.org.hibernate.validator=WARN
log4j.logger.org.springframework=WARN
log4j.logger.org.springframework.web=WARN
log4j.logger.org.springframework.security=WARN
# Custom classes logging
log4j.logger.${package}.tasks.service=DEBUG

View File

@ -0,0 +1,6 @@
log4j.rootLogger=WARN, CA
# ConsoleAppender
log4j.appender.CA=org.apache.log4j.ConsoleAppender
log4j.appender.CA.layout=org.apache.log4j.PatternLayout
log4j.appender.CA.layout.ConversionPattern= %d{hh:mm:ss,SSS} [%t] %-5p %c %x - %m%n

View File

@ -1,4 +1,5 @@
version=0.1-SNAPSHOT version=0.1-SNAPSHOT
groupId=archetype.it groupId=archetype.it
artifactId=repoAmpTestRunEnterprise artifactId=activitiJARTest
package=it.pkg package=it.pkg

View File

@ -0,0 +1,4 @@
version=0.1-SNAPSHOT
groupId=archetype.it
artifactId=activitiJARTestRun
package=it.pkg

View File

@ -0,0 +1 @@
verify alfresco:run -Dmaven.tomcat.fork=true

View File

@ -5,8 +5,8 @@
<groupId>org.alfresco.maven.archetype</groupId> <groupId>org.alfresco.maven.archetype</groupId>
<artifactId>alfresco-allinone-archetype</artifactId> <artifactId>alfresco-allinone-archetype</artifactId>
<packaging>maven-archetype</packaging> <packaging>maven-archetype</packaging>
<name>Maven Alfresco SDK - All-in-One Archetype</name> <name>Alfresco SDK - All-in-One Archetype</name>
<description>Sample multi-module project for All-in-One development on the Alfresco plaftorm. Includes modules for: Repository WAR overlay, Repository AMP, Share WAR overlay, Solr configuration, and embedded Tomcat runner</description> <description>Sample multi-module project for All-in-One development on the Alfresco plaftorm. Includes modules for Platform/Repository JAR and Share JAR</description>
<parent> <parent>
<groupId>org.alfresco.maven</groupId> <groupId>org.alfresco.maven</groupId>
@ -23,7 +23,8 @@
<include>archetype-resources/pom.xml</include> <include>archetype-resources/pom.xml</include>
<include>archetype-resources/run.sh</include> <include>archetype-resources/run.sh</include>
<include>archetype-resources/run.bat</include> <include>archetype-resources/run.bat</include>
<include>archetype-resources/runner/src/main/webapp/index.html</include> <include>archetype-resources/debug.sh</include>
<include>archetype-resources/debug.bat</include>
<include>META-INF/maven/archetype-metadata.xml</include> <include>META-INF/maven/archetype-metadata.xml</include>
</includes> </includes>
<filtering>true</filtering> <filtering>true</filtering>
@ -34,7 +35,8 @@
<exclude>archetype-resources/pom.xml</exclude> <exclude>archetype-resources/pom.xml</exclude>
<exclude>archetype-resources/run.sh</exclude> <exclude>archetype-resources/run.sh</exclude>
<exclude>archetype-resources/run.bat</exclude> <exclude>archetype-resources/run.bat</exclude>
<exclude>archetype-resources/runner/src/main/webapp/index.html</exclude> <exclude>archetype-resources/debug.sh</exclude>
<exclude>archetype-resources/debug.bat</exclude>
<exclude>META-INF/maven/archetype-metadata.xml</exclude> <exclude>META-INF/maven/archetype-metadata.xml</exclude>
</excludes> </excludes>
<filtering>false</filtering> <filtering>false</filtering>
@ -43,8 +45,9 @@
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId> <artifactId>maven-resources-plugin</artifactId>
<version>2.7</version> <version>${maven.resource.version}</version>
<configuration> <configuration>
<useDefaultDelimiters>false</useDefaultDelimiters> <useDefaultDelimiters>false</useDefaultDelimiters>
<delimiters> <delimiters>

View File

@ -1,5 +0,0 @@
version=0.1-SNAPSHOT
groupId=archetype.it
artifactId=allInOneTestRunEnterprise
package=it.pkg

View File

@ -1 +0,0 @@
verify -Prun -Penterprise -Dmaven.tomcat.fork=true

View File

@ -1 +1 @@
verify -Prun -Dmaven.tomcat.fork=true install alfresco:run -Dmaven.tomcat.fork=true

View File

@ -3,11 +3,11 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.alfresco.maven.archetype</groupId> <groupId>org.alfresco.maven.archetype</groupId>
<artifactId>alfresco-amp-archetype</artifactId> <artifactId>alfresco-platform-jar-archetype</artifactId>
<packaging>maven-archetype</packaging> <packaging>maven-archetype</packaging>
<name>Maven Alfresco SDK - Repository AMP Archetype</name> <name>Alfresco SDK - Platform JAR Archetype</name>
<description>Sample project with full support for lifecycle and rapid development of Repository AMPs (Alfresco Module Packages)</description> <description>Sample project with full support for lifecycle and rapid development of Platform/Repository JARs and AMPs (Alfresco Module Packages)</description>
<parent> <parent>
<groupId>org.alfresco.maven</groupId> <groupId>org.alfresco.maven</groupId>
@ -24,6 +24,8 @@
<include>archetype-resources/pom.xml</include> <include>archetype-resources/pom.xml</include>
<include>archetype-resources/run.sh</include> <include>archetype-resources/run.sh</include>
<include>archetype-resources/run.bat</include> <include>archetype-resources/run.bat</include>
<include>archetype-resources/debug.sh</include>
<include>archetype-resources/debug.bat</include>
<include>META-INF/maven/archetype-metadata.xml</include> <include>META-INF/maven/archetype-metadata.xml</include>
</includes> </includes>
<filtering>true</filtering> <filtering>true</filtering>
@ -34,15 +36,19 @@
<exclude>archetype-resources/pom.xml</exclude> <exclude>archetype-resources/pom.xml</exclude>
<exclude>archetype-resources/run.sh</exclude> <exclude>archetype-resources/run.sh</exclude>
<exclude>archetype-resources/run.bat</exclude> <exclude>archetype-resources/run.bat</exclude>
<exclude>archetype-resources/debug.sh</exclude>
<exclude>archetype-resources/debug.bat</exclude>
<exclude>META-INF/maven/archetype-metadata.xml</exclude> <exclude>META-INF/maven/archetype-metadata.xml</exclude>
</excludes> </excludes>
<filtering>false</filtering> <filtering>false</filtering>
</resource> </resource>
</resources> </resources>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId> <artifactId>maven-resources-plugin</artifactId>
<version>2.7</version> <version>${maven.resource.version}</version>
<configuration> <configuration>
<useDefaultDelimiters>false</useDefaultDelimiters> <useDefaultDelimiters>false</useDefaultDelimiters>
<delimiters> <delimiters>

View File

@ -1,5 +1,5 @@
version=0.1-SNAPSHOT version=0.1-SNAPSHOT
groupId=archetype.it groupId=archetype.it
artifactId=repoAmpTest artifactId=repoJarTest
package=it.pkg package=it.pkg

View File

@ -1,4 +1,4 @@
version=0.1-SNAPSHOT version=0.1-SNAPSHOT
groupId=archetype.it groupId=archetype.it
artifactId=repoAmpTestRun artifactId=repoJarTestRun
package=it.pkg package=it.pkg

View File

@ -1 +1 @@
verify -Pamp-to-war -Dmaven.tomcat.fork=true verify alfresco:run -Dmaven.tomcat.fork=true

View File

@ -1 +0,0 @@
verify -Pamp-to-war -Penterprise -Dmaven.tomcat.fork=true

View File

@ -3,11 +3,11 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.alfresco.maven.archetype</groupId> <groupId>org.alfresco.maven.archetype</groupId>
<artifactId>share-amp-archetype</artifactId> <artifactId>alfresco-share-jar-archetype</artifactId>
<packaging>maven-archetype</packaging> <packaging>maven-archetype</packaging>
<name>Maven Alfresco SDK - Share AMP Archetype</name> <name>Alfresco SDK - Share JAR Archetype</name>
<description>Share project with full support for lifecycle and rapid development of AMPs (Alfresco Module <description>Share project with full support for lifecycle and rapid development of JARs and AMPs (Alfresco Module
Packages) Packages)
</description> </description>
@ -26,6 +26,8 @@
<include>archetype-resources/pom.xml</include> <include>archetype-resources/pom.xml</include>
<include>archetype-resources/run.sh</include> <include>archetype-resources/run.sh</include>
<include>archetype-resources/run.bat</include> <include>archetype-resources/run.bat</include>
<include>archetype-resources/debug.sh</include>
<include>archetype-resources/debug.bat</include>
<include>META-INF/maven/archetype-metadata.xml</include> <include>META-INF/maven/archetype-metadata.xml</include>
</includes> </includes>
<filtering>true</filtering> <filtering>true</filtering>
@ -36,6 +38,8 @@
<exclude>archetype-resources/pom.xml</exclude> <exclude>archetype-resources/pom.xml</exclude>
<exclude>archetype-resources/run.sh</exclude> <exclude>archetype-resources/run.sh</exclude>
<exclude>archetype-resources/run.bat</exclude> <exclude>archetype-resources/run.bat</exclude>
<exclude>archetype-resources/debug.sh</exclude>
<exclude>archetype-resources/debug.bat</exclude>
<exclude>META-INF/maven/archetype-metadata.xml</exclude> <exclude>META-INF/maven/archetype-metadata.xml</exclude>
</excludes> </excludes>
<filtering>false</filtering> <filtering>false</filtering>
@ -44,8 +48,9 @@
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId> <artifactId>maven-resources-plugin</artifactId>
<version>2.7</version> <version>${maven.resource.version}</version>
<configuration> <configuration>
<useDefaultDelimiters>false</useDefaultDelimiters> <useDefaultDelimiters>false</useDefaultDelimiters>
<delimiters> <delimiters>

View File

@ -1,4 +1,4 @@
version=0.1-SNAPSHOT version=0.1-SNAPSHOT
groupId=archetype.it groupId=archetype.it
artifactId=shareAmpTest artifactId=shareJarTest
package=it.pkg package=it.pkg

View File

@ -1,4 +1,4 @@
version=0.1-SNAPSHOT version=0.1-SNAPSHOT
groupId=archetype.it groupId=archetype.it
artifactId=shareAmpTestRun artifactId=shareJarTestRun
package=it.pkg package=it.pkg

View File

@ -1 +1 @@
verify -Pamp-to-war -Dmaven.tomcat.fork=true verify alfresco:run -Dmaven.tomcat.fork=true

View File

@ -1,4 +0,0 @@
version=0.1-SNAPSHOT
groupId=archetype.it
artifactId=shareAmpTestRunEnterprise
package=it.pkg

View File

@ -1 +0,0 @@
verify -Pamp-to-war -Penterprise -Dmaven.tomcat.fork=true

View File

@ -139,7 +139,6 @@
<groupId>org.zeroturnaround</groupId> <groupId>org.zeroturnaround</groupId>
<artifactId>zt-zip</artifactId> <artifactId>zt-zip</artifactId>
<version>1.9</version> <version>1.9</version>
<type>jar</type>
</dependency> </dependency>
</dependencies> </dependencies>

View File

@ -34,7 +34,7 @@ import org.apache.maven.plugins.annotations.ResolutionScope;
import org.apache.maven.project.MavenProject; import org.apache.maven.project.MavenProject;
import org.zeroturnaround.zip.ZipUtil; import org.zeroturnaround.zip.ZipUtil;
import java.io.File; import java.io.*;
import java.util.*; import java.util.*;
import static org.twdata.maven.mojoexecutor.MojoExecutor.*; import static org.twdata.maven.mojoexecutor.MojoExecutor.*;
@ -61,6 +61,7 @@ public class RunMojo extends AbstractMojo {
public static final String PLATFORM_WAR_PREFIX_NAME = "platform"; public static final String PLATFORM_WAR_PREFIX_NAME = "platform";
public static final String SHARE_WAR_PREFIX_NAME = "share"; public static final String SHARE_WAR_PREFIX_NAME = "share";
public static final String ACTIVITI_APP_WAR_PREFIX_NAME = "activitiApp";
public static final String ALFRESCO_ENTERPRISE_EDITION = "enterprise"; public static final String ALFRESCO_ENTERPRISE_EDITION = "enterprise";
public static final String ALFRESCO_COMMUNITY_EDITION = "community"; public static final String ALFRESCO_COMMUNITY_EDITION = "community";
@ -153,6 +154,26 @@ public class RunMojo extends AbstractMojo {
@Parameter(property = "maven.alfresco.enableApiExplorer", defaultValue = "false") @Parameter(property = "maven.alfresco.enableApiExplorer", defaultValue = "false")
protected boolean enableApiExplorer; protected boolean enableApiExplorer;
/**
* Switch to enable/disable Alfresco Activiti Workflow Engine (activiti-app.war) when running embedded Tomcat.
* This contains the Alfresco Activiti webapp, including the workflow engine.
* This webapp is also the user interface for people involved in the task and processes
* running in the Activiti engine.
* You also use this webapp to create and manage process definitions, and to display and define analytics
* reports on users' tasks and processes.
*/
@Parameter(property = "maven.alfresco.enableActivitiApp", defaultValue = "false")
protected boolean enableActivitiApp;
/**
* Switch to enable/disable Alfresco Activiti Admin (activiti-admin.war) when running embedded Tomcat.
* This contains the Alfresco Activiti Administrator webapp. You use this to administer and monitor your
* Alfresco Activiti engines.
*
*/
@Parameter(property = "maven.alfresco.enableActivitiAdmin", defaultValue = "false")
protected boolean enableActivitiAdmin;
/** /**
* Switch to enable/disable test properties when running embedded Tomcat. * Switch to enable/disable test properties when running embedded Tomcat.
*/ */
@ -189,6 +210,12 @@ public class RunMojo extends AbstractMojo {
@Parameter(property = "maven.alfresco.share.modules", defaultValue = "") @Parameter(property = "maven.alfresco.share.modules", defaultValue = "")
protected List<ModuleDependency> shareModules; protected List<ModuleDependency> shareModules;
/**
* JARs that should be overlayed/applied to the Activiti App WAR (i.e. activiti-app.war)
*/
@Parameter(property = "maven.activiti.modules", defaultValue = "")
protected List<ModuleDependency> activitiModules;
/** /**
* Community Edition or Enterprise Edition? (i.e community or enterprise) * Community Edition or Enterprise Edition? (i.e community or enterprise)
*/ */
@ -209,6 +236,9 @@ public class RunMojo extends AbstractMojo {
@Parameter(property = "alfresco.groupId", defaultValue = "org.alfresco") @Parameter(property = "alfresco.groupId", defaultValue = "org.alfresco")
protected String alfrescoGroupId; protected String alfrescoGroupId;
@Parameter(property = "activiti.groupId", defaultValue = "com.activiti")
protected String activitiGroupId;
@Parameter(property = "alfresco.platform.war.artifactId", defaultValue = "alfresco-platform") @Parameter(property = "alfresco.platform.war.artifactId", defaultValue = "alfresco-platform")
protected String alfrescoPlatformWarArtifactId; protected String alfrescoPlatformWarArtifactId;
@ -221,6 +251,12 @@ public class RunMojo extends AbstractMojo {
@Parameter(property = "alfresco.api.explorer.artifactId", defaultValue = "api-explorer") @Parameter(property = "alfresco.api.explorer.artifactId", defaultValue = "api-explorer")
protected String alfrescoApiExplorerArtifactId; protected String alfrescoApiExplorerArtifactId;
@Parameter(property = "activiti.app.war.artifactId", defaultValue = "activiti-app")
protected String activitiAppWarArtifactId;
@Parameter(property = "activiti.admin.war.artifactId", defaultValue = "activiti-admin")
protected String activitiAdminWarArtifactId;
@Parameter(property = "alfresco.platform.version", defaultValue = "5.2.a-EA") @Parameter(property = "alfresco.platform.version", defaultValue = "5.2.a-EA")
protected String alfrescoPlatformVersion; protected String alfrescoPlatformVersion;
@ -230,6 +266,9 @@ public class RunMojo extends AbstractMojo {
@Parameter(property = "alfresco.api.explorer.version", defaultValue = "1.2") @Parameter(property = "alfresco.api.explorer.version", defaultValue = "1.2")
protected String alfrescoApiExplorerVersion; protected String alfrescoApiExplorerVersion;
@Parameter(property = "activiti.version", defaultValue = "1.5.1")
protected String activitiVersion;
/** /**
* Directory that contains the Alfresco Solr 4 configuration * Directory that contains the Alfresco Solr 4 configuration
*/ */
@ -237,7 +276,7 @@ public class RunMojo extends AbstractMojo {
protected String solrHome; protected String solrHome;
/** /**
* Maven GAV properties for customized alfresco.war and share.war * Maven GAV properties for customized alfresco.war, share.war, activiti-app.war
* Used by the Maven Tomcat 7 Plugin * Used by the Maven Tomcat 7 Plugin
*/ */
private String runnerAlfrescoGroupId; private String runnerAlfrescoGroupId;
@ -245,6 +284,9 @@ public class RunMojo extends AbstractMojo {
private String runnerAlfrescoShareWarArtifactId; private String runnerAlfrescoShareWarArtifactId;
private String runnerAlfrescoPlatformVersion; private String runnerAlfrescoPlatformVersion;
private String runnerAlfrescoShareVersion; private String runnerAlfrescoShareVersion;
private String runnerActivitiAppGroupId;
private String runnerActivitiAppWarArtifactId;
private String runnerActivitiAppVersion;
/** /**
* The Maven environment that this mojo is executed in * The Maven environment that this mojo is executed in
@ -265,7 +307,7 @@ public class RunMojo extends AbstractMojo {
installSolr10InLocalRepo(); installSolr10InLocalRepo();
} }
if (enableTestProperties) { if (enableTestProperties && enablePlatform) {
copyAlfrescoGlobalProperties(); copyAlfrescoGlobalProperties();
renameAlfrescoGlobalProperties(); renameAlfrescoGlobalProperties();
} }
@ -278,6 +320,10 @@ public class RunMojo extends AbstractMojo {
buildShareWar(); buildShareWar();
} }
if (enableActivitiApp) {
buildActivitiAppWar();
}
if (startTomcat) { if (startTomcat) {
checkDatabaseConfig(); checkDatabaseConfig();
startTomcat(); startTomcat();
@ -562,6 +608,40 @@ public class RunMojo extends AbstractMojo {
); );
} }
/**
* Copy the Activiti Log4J Dev config into the activiti-app/WEB-INF/classes dir.
*
* @throws MojoExecutionException
*/
protected void copyActivitiLog4JDevConfig() throws MojoExecutionException {
final String warOutputDir = getWarOutputDir(ACTIVITI_APP_WAR_PREFIX_NAME);
final String logConfDestDir = warOutputDir + "/WEB-INF/classes";
getLog().info("Copying Activiti log4j-dev.properties to: " + logConfDestDir);
executeMojo(
plugin(
groupId("org.apache.maven.plugins"),
artifactId("maven-resources-plugin"),
version(MAVEN_RESOURCE_PLUGIN_VERSION)
),
goal("copy-resources"),
configuration(
element(name("outputDirectory"), logConfDestDir),
element(name("resources"),
element(name("resource"),
element(name("directory"), "src/test/resources"),
element(name("includes"),
element(name("include"), "log4j-dev.properties")
),
element(name("filtering"), "true")
)
)
),
execEnv
);
}
/** /**
* Build the customized Platform webapp (i.e. the Repository, alfresco.war) * Build the customized Platform webapp (i.e. the Repository, alfresco.war)
* that should be deployed by Tomcat by applying all AMPs and JARs from * that should be deployed by Tomcat by applying all AMPs and JARs from
@ -569,7 +649,7 @@ public class RunMojo extends AbstractMojo {
*/ */
protected void buildPlatformWar() throws MojoExecutionException { protected void buildPlatformWar() throws MojoExecutionException {
buildCustomWarInDir(PLATFORM_WAR_PREFIX_NAME, platformModules, buildCustomWarInDir(PLATFORM_WAR_PREFIX_NAME, platformModules,
getPlatformWarArtifactId(), alfrescoPlatformVersion); alfrescoGroupId, getPlatformWarArtifactId(), alfrescoPlatformVersion);
commentOutSecureCommsInPlatformWebXml(); commentOutSecureCommsInPlatformWebXml();
copyAlfrescoLicense(); copyAlfrescoLicense();
@ -588,7 +668,8 @@ public class RunMojo extends AbstractMojo {
* the {@code <shareModules> } configuration. * the {@code <shareModules> } configuration.
*/ */
protected void buildShareWar() throws MojoExecutionException { protected void buildShareWar() throws MojoExecutionException {
buildCustomWarInDir(SHARE_WAR_PREFIX_NAME, shareModules, alfrescoShareWarArtifactId, alfrescoShareVersion); buildCustomWarInDir(SHARE_WAR_PREFIX_NAME, shareModules,
alfrescoGroupId, alfrescoShareWarArtifactId, alfrescoShareVersion);
String shareWarArtifactId = packageAndInstallCustomWar(SHARE_WAR_PREFIX_NAME); String shareWarArtifactId = packageAndInstallCustomWar(SHARE_WAR_PREFIX_NAME);
@ -598,18 +679,39 @@ public class RunMojo extends AbstractMojo {
runnerAlfrescoShareVersion = "${project.version}"; runnerAlfrescoShareVersion = "${project.version}";
} }
/**
* Build the customized Activiti App webapp (i.e. the activiti-app.war)
* that should be deployed by Tomcat by applying all JARs from
* the {@code <activitiModules> } configuration.
*/
protected void buildActivitiAppWar() throws MojoExecutionException {
buildCustomWarInDir(ACTIVITI_APP_WAR_PREFIX_NAME, activitiModules,
activitiGroupId, activitiAppWarArtifactId, activitiVersion);
copyActivitiLog4JDevConfig();
String activitiAppWarArtifactId = packageAndInstallCustomWar(ACTIVITI_APP_WAR_PREFIX_NAME);
// Set up the custom share war to be run by Tomcat plugin
runnerActivitiAppGroupId = "${project.groupId}";
runnerActivitiAppWarArtifactId = activitiAppWarArtifactId;
runnerActivitiAppVersion = "${project.version}";
}
/** /**
* Build a customized webapp in a directory, * Build a customized webapp in a directory,
* applying a number of AMPs and JARs from alfresco maven plugin configuration. * applying a number of AMPs and/or JARs from alfresco maven plugin configuration.
* *
* @param warName the name of the custom war * @param warName the name of the custom war
* @param modules the modules that should be applied to the custom war * @param modules the modules that should be applied to the custom war
* @param originalWarArtifactId the artifactId for the original war file that should be customized * @param originalWarGroupId the Maven groupId for the original war file that should be customized
* @param originalWarVersion the version for the original war file that should be customized * @param originalWarArtifactId the Maven artifactId for the original war file that should be customized
* @param originalWarVersion the Maven version for the original war file that should be customized
* @throws MojoExecutionException * @throws MojoExecutionException
*/ */
protected void buildCustomWarInDir(String warName, protected void buildCustomWarInDir(String warName,
List<ModuleDependency> modules, List<ModuleDependency> modules,
String originalWarGroupId,
String originalWarArtifactId, String originalWarArtifactId,
String originalWarVersion) throws MojoExecutionException { String originalWarVersion) throws MojoExecutionException {
final String warOutputDir = getWarOutputDir(warName); final String warOutputDir = getWarOutputDir(warName);
@ -666,7 +768,7 @@ public class RunMojo extends AbstractMojo {
element(name("outputDirectory"), warOutputDir), element(name("outputDirectory"), warOutputDir),
element(name("artifactItems"), element(name("artifactItems"),
element(name("artifactItem"), element(name("artifactItem"),
element(name("groupId"), alfrescoGroupId), element(name("groupId"), originalWarGroupId),
element(name("artifactId"), originalWarArtifactId), element(name("artifactId"), originalWarArtifactId),
element(name("version"), originalWarVersion), element(name("version"), originalWarVersion),
element(name("type"), "war") element(name("type"), "war")
@ -767,23 +869,26 @@ public class RunMojo extends AbstractMojo {
* Check that a database configuration has been supplied correctly * Check that a database configuration has been supplied correctly
*/ */
private void checkDatabaseConfig() throws MojoExecutionException { private void checkDatabaseConfig() throws MojoExecutionException {
if (enableH2 && !enableMySQL && !enablePostgreSQL) { // Only do this check if we are running alfresco.war or activiti-app.war that needs a database.
// Run with the H2 database if (enablePlatform || enableActivitiApp) {
return; if (enableH2 && !enableMySQL && !enablePostgreSQL) {
} else if (!enableH2 && enableMySQL && !enablePostgreSQL) { // Run with the H2 database
// Run with the MySQL database return;
return; } else if (!enableH2 && enableMySQL && !enablePostgreSQL) {
} else if (!enableH2 && !enableMySQL && enablePostgreSQL) { // Run with the MySQL database
// Run with the PostgreSQL database return;
return; } else if (!enableH2 && !enableMySQL && enablePostgreSQL) {
} else if (!enableH2 && !enableMySQL && !enablePostgreSQL) { // Run with the PostgreSQL database
// Run with a database configured via Tomcat Dependencies return;
return; } else if (!enableH2 && !enableMySQL && !enablePostgreSQL) {
} else { // Run with a database configured via Tomcat Dependencies
throw new MojoExecutionException( return;
"Invalid database configuration, " + } else {
"should be enableH2 or enableMySQL or enablePostgreSQL " + throw new MojoExecutionException(
"or none (i.e. config via Tomcat Dependencies)"); "Invalid database configuration, " +
"should be enableH2 or enableMySQL or enablePostgreSQL " +
"or none (i.e. config via Tomcat Dependencies)");
}
} }
} }
@ -823,8 +928,10 @@ public class RunMojo extends AbstractMojo {
// Bring in the flat file H2 database // Bring in the flat file H2 database
dependency("com.h2database", "h2", "1.4.190")); dependency("com.h2database", "h2", "1.4.190"));
// Copy the h2 scripts if (enablePlatform) {
copyH2Dialect(); // Copy the h2 scripts for the Alfresco Repository database
copyH2Dialect();
}
} else if (enableMySQL) { } else if (enableMySQL) {
tomcatPluginDependencies.add( tomcatPluginDependencies.add(
// Bring in the MySQL JDBC Driver // Bring in the MySQL JDBC Driver
@ -852,15 +959,42 @@ public class RunMojo extends AbstractMojo {
} }
if (enableApiExplorer) { if (enableApiExplorer) {
webapps2Deploy.add(createWebAppElement(alfrescoGroupId, alfrescoApiExplorerArtifactId, alfrescoApiExplorerVersion, webapps2Deploy.add(createWebAppElement(
alfrescoGroupId, alfrescoApiExplorerArtifactId, alfrescoApiExplorerVersion,
"/api-explorer", null)); "/api-explorer", null));
} }
if (enableActivitiApp) {
webapps2Deploy.add(createWebAppElement(
runnerActivitiAppGroupId, runnerActivitiAppWarArtifactId, runnerActivitiAppVersion,
"/activiti-app", null));
}
if (enableActivitiAdmin) {
webapps2Deploy.add(createWebAppElement(
activitiGroupId, activitiAdminWarArtifactId, activitiVersion, "/activiti-admin", null));
}
// This might be ugly, the MojoExecuter will only accept Element[] and we need this list to be dynamic // This might be ugly, the MojoExecuter will only accept Element[] and we need this list to be dynamic
// to avoid NPEs. If there's a better way to do this, then feel free to change it! // to avoid NPEs. If there's a better way to do this, then feel free to change it!
Element[] webapps = new Element[webapps2Deploy.size()]; Element[] webapps = new Element[webapps2Deploy.size()];
webapps2Deploy.toArray(webapps); webapps2Deploy.toArray(webapps);
// Set up the system properties that should be set for Tomcat
ArrayList systemProps = new ArrayList<Element>();
systemProps.add(element(name("java.io.tmpdir"), "${project.build.directory}"));
if (enableSolr) {
systemProps.add(element(name("solr.solr.home"), solrHome));
}
if (enableActivitiApp) {
// Should be in activiti-jar/src/test/resources
systemProps.add(element(name("log4j.configuration"), "log4j-dev.properties"));
}
// This might be ugly, the MojoExecuter will only accept Element[] and we need this list to be dynamic
// to avoid NPEs. If there's a better way to do this, then feel free to change it!
Element[] systemPropArray = new Element[systemProps.size()];
systemProps.toArray(systemPropArray);
executeMojo( executeMojo(
plugin( plugin(
groupId("org.apache.tomcat.maven"), groupId("org.apache.tomcat.maven"),
@ -896,10 +1030,7 @@ public class RunMojo extends AbstractMojo {
/** /**
* Set up where Solr Home directory is * Set up where Solr Home directory is
*/ */
element(name("systemProperties"), element(name("systemProperties"), systemPropArray),
element(name("java.io.tmpdir"), "${project.build.directory}"),
element(name("solr.solr.home"), solrHome)
),
/* Should this class loader delegate to the parent class loader before searching its /* Should this class loader delegate to the parent class loader before searching its
own repositories (i.e. the usual Java2 delegation model). own repositories (i.e. the usual Java2 delegation model).

19
pom.xml
View File

@ -121,25 +121,25 @@
<module>modules/alfresco-rad</module> <module>modules/alfresco-rad</module>
<!-- Plugins --> <!-- Plugins -->
<module>plugins/alfresco-maven-plugin</module> <module>plugins/alfresco-maven-plugin</module>
<!-- POM files -->
<module>poms/alfresco-sdk-parent</module>
<!-- Archetypes --> <!-- Archetypes -->
<module>archetypes/alfresco-platform-jar-archetype</module> <module>archetypes/alfresco-platform-jar-archetype</module>
<module>archetypes/alfresco-share-jar-archetype</module> <module>archetypes/alfresco-share-jar-archetype</module>
<module>archetypes/alfresco-allinone-archetype</module> <module>archetypes/alfresco-allinone-archetype</module>
<module>archetypes/activiti-jar-archetype</module>
</modules> </modules>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source> <maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target> <maven.compiler.target>1.7</maven.compiler.target>
<maven.archetype.version>2.2</maven.archetype.version> <maven.resource.version>3.0.1</maven.resource.version>
<maven.archetype.version>2.4</maven.archetype.version>
<alfresco.sdk.parent.version>${project.version}</alfresco.sdk.parent.version> <alfresco.sdk.parent.version>${project.version}</alfresco.sdk.parent.version>
<alfresco.sdk.tests.exclude>*/*-enterprise/*</alfresco.sdk.tests.exclude> <alfresco.sdk.tests.exclude>*/*-enterprise/*</alfresco.sdk.tests.exclude>
<alfresco.community.default.version>5.0.d</alfresco.community.default.version>
<alfresco.enterprise.default.version>5.0.1</alfresco.enterprise.default.version> <!-- The following version is needed to grab the alfresco-mmt -->
<alfresco.rm.version>2.3</alfresco.rm.version> <alfresco.community.default.version>5.1.g</alfresco.community.default.version>
<springloaded.version>1.2.3.RELEASE</springloaded.version>
<scm.url.base>https://github.com/Alfresco/alfresco-sdk</scm.url.base> <scm.url.base>https://github.com/Alfresco/alfresco-sdk</scm.url.base>
</properties> </properties>
@ -184,6 +184,11 @@
<enabled>true</enabled> <enabled>true</enabled>
</snapshots> </snapshots>
</repository> </repository>
<!-- Activiti Enterprise Edition Artifacts, put username/pwd for server in settings.xml -->
<repository>
<id>activiti-private-repository</id>
<url>https://artifacts.alfresco.com/nexus/content/repositories/activiti-enterprise-releases</url>
</repository>
</repositories> </repositories>
<distributionManagement> <distributionManagement>

File diff suppressed because it is too large Load Diff

View File

@ -1,41 +0,0 @@
------
Introduction
------
Gabriele Columbro
------
Nov 2012
------
Introduction
The Alfresco SDK Parent POM ${project.version} is the <<<single entry point>>> for all Alfresco SDK\x99 features.
It aggregates plugin configurations and dependencies to provide a set of profiles and properties to manage the full Alfresco projects Lifecycle on Maven.
The current version of the POM in use in the Alfresco SDK\x99 ${project.version} is available {{{https://oss.sonatype.org/index.html#nexus-search;gav~org.alfresco.maven~alfresco-sdk-parent~${project.version}~pom~}on Maven Central}}.
Usage
You can reference Alfresco SDK POM in your POM adding the following snippet:
+---+
<project>
...
<parent>
<groupId>org.alfresco.maven</groupId>
<artifactId>alfresco-sdk-parent</artifactId>
<version>${project.version}</version>
</parent>
...
</project>
+---+
This will reference the Alfresco SDK project as <<<parent>>> project, allowing you to inherit all SDK features.
Full dependency information for other build systems can be found in the {{{./dependency-info.html} Dependency Info page}}.
Features are provided in terms of {{{./sdk-profiles.html} Maven profiles}}, and high configurability is provided with
{{{./sdk-properties.html}POM properties}} avaialble to sibling projects.
* Examples / archetypes
To kickstart your SDK experience and to provide examples on how to use it, archetypes are available already using this POM.
Check the menu item <SDK Components> for more samples.

View File

@ -1,50 +0,0 @@
------
Alfresco SDK\x99 Profiles
------
Gabriele Columbro
------
Aug 2014
------
SDK Available Profiles
The Alfresco SDK\x99 defines common features required by different Alfresco projects.
While the <<<recommended>>> way is to use full working examples of usage of these profiles (e.g. the
{{{../../archetypes/alfresco-amp-archetype/index.html}Repo AMP}}, {{{../../archetypes/share-amp-archetype/index.html}Share AMP} and {{{../../archetypes/alfresco-allinone-archetype/index.html}All-in-One}} archetypes),
you can also directly use this POM as a parent in your custom project.
Here goes the list of common used profiles (with their activation conditions):
*-----------+--------------+-------------+-------------+-------------+
|| Archetypes || Profile || Description || Activation || Phase |
*-----------+--------------+-------------+-------------+-------------+
| amp, share-amp | amp-to-war | Allows AMP projects to be run embedded on a WAR and in rapid dev mode | Manual: <<<-Pamp-to-war>>> | pre-integration-test |
*-----------*--------------*-------------*-------------*-------------+
| all-in-one | run | Runs embedded Alfresco + Share + Solr in rapid dev mode | Manual: <<<-Prun>>> | pre-integration-test |
*-----------*--------------*-------------*-------------*-------------+
| any | purge | Cleans all alf_data and logs from Alfresco runs | Manual: <<<-Ppurge>>> | clean |
*-----------*--------------*-------------*-------------*-------------+
| any | enterprise |Configures your build to use Alfresco Enterprise. Obtain your credentials with {{{https://support.alfresco.com}Alfresco Support}}| Manual: <<<-Penterprise>>> | N/A |
*-----------+--------------+-------------+-------------+-------------+
| any | setup | Sets up the sdk, e.g. grabs springloaded. | Manual: <<<-Psetup>>> (automated in the run.sh) | initialize |
*-----------+--------------+-------------+-------------+-------------+
| all-in-one | rm | Adds Records Management runtime and compile time dependencies | Manual: <<<-Prm>>> | package |
*-----------+--------------+-------------+-------------+-------------+
| all-in-one | regression | (Experimental) Invokes the Alfresco {{{https://github.com/AlfrescoLabs/technical-validation/}Share PO}} Webdrone / Selenium based regression tests| Manual: <<<-Pregression>>> | integration-test |
*-----------+--------------+-------------+-------------+-------------+
| amp, share-amp | atv | (Experimental) Invokes the {{{https://github.com/AlfrescoLabs/technical-validation/}Alfresco Technical Validation tool}} | Manual: <<<-Patv>>> | validate |
*-----------+--------------+-------------+-------------+-------------+
The full list of available profiles (with their activation conditions) can be instead found in the <<<profiles>>> section of the
{{{https://artifacts.alfresco.com/nexus/index.html#nexus-search;gav~org.alfresco.maven~alfresco-sdk-parent~${project.version}~pom~}Alfresco SDK POM}}.
Full SDK properties reference
The full reference of properties defined in the SDK can be obtained by looking
at the <<<properties>>> section of the current version of the <<<alfresco-sdk-parent>>> in use.
Check the {{{https://artifacts.alfresco.com/nexus/index.html#nexus-search;gav~org.alfresco.maven~alfresco-sdk-parent~${project.version}~pom~}current POM version}} for this.
While in certain cases it might be useful to override defaults, make sure you know what you're doing,
as you might be <<breaking>> SDK conventions and therefore <<your build>>

View File

@ -1,61 +0,0 @@
------
Alfresco SDK Properties
------
Gabriele Columbro
------
Nov 2012
------
Common SDK properties
Useful properties that can be fully controlled directly in the POM are:
+---+
<project>
...
<!--
| SDK properties have sensible defaults in the SDK parent,
| but you can override the properties below to use another version.
| For more available properties see the alfresco-sdk-parent POM.
-->
<properties>
<alfresco.groupId>org.alfresco</alfresco.groupId>
<alfresco.version>5.0.c</alfresco.version>
<!-- Defines root logger log level for testing and embedded run -->
<app.log.root.level>WARN</app.log.root.level>
<!-- Logging dir. Note the trailing slash is required -->
<app.log.dir>${project.build.directory}/</app.log.dir>
<!-- The alf_data folder -->
<alfresco.data.location>${project.basedir}/alf_data_dev</alfresco.data.location>
<!-- This controls which properties will be picked in src/test/properties for embedded run -->
<env>local</env>
</properties>
...
</project>
+---+
Full SDK properties reference
The full reference of properties defined in the SDK can be obtained by looking
at the <<<properties>>> section of the current version of the <<<alfresco-sdk-parent>>> in use.
Check the {{{https://artifacts.alfresco.com/nexus/index.html#nexus-search;gav~org.alfresco.maven~alfresco-sdk-parent~${project.version}~pom~}current POM version}} for this.
While in certain cases it might be useful to override defaults, make sure you know what you're doing,
as you might be <<breaking>> SDK conventions and therefore <<your build>>>
Example - Configuring custom DB
In order to configure a given JDBC database connection, you need to define some POM properties.
+---+
<properties>
...
<alfresco.db.name>alfresco</alfresco.db.name>
<alfresco.db.username>alfresco</alfresco.db.username>
<alfresco.db.password>alfresco</alfresco.db.password>
<alfresco.db.params></alfresco.db.params>
<alfresco.db.url>jdbc:mysql://${db.host}:${db.port}/${db.name}</alfresco.db.url>
<alfresco.db.datasource.class>org.gjt.mm.mysql.Driver</alfresco.db.datasource.class>
</properties>
+---+

View File

@ -1,83 +0,0 @@
<project>
<skin>
<groupId>org.apache.maven.skins</groupId>
<artifactId>maven-fluido-skin</artifactId>
<version>1.3.1</version>
</skin>
<custom>
<fluidoSkin>
<topBarIcon>
<name>Alfresco Software</name>
<alt>Alfresco Software</alt>
<src>http://people.apache.org/~gabriele/Alfresco-logo-transparent-thin.png</src>
<href>http://www.alfresco.com</href>
</topBarIcon>
<topBarEnabled>true</topBarEnabled>
<navBarStyle>navbar-inverse</navBarStyle>
<sideBarEnabled>false</sideBarEnabled>
<facebookLike />
<googlePlusOne />
<googleSearch>
<sitesearch/>
</googleSearch>
<sourceLineNumbersEnabled>true</sourceLineNumbersEnabled>
</fluidoSkin>
</custom>
<poweredBy>
<logo name="Maven" href="http://maven.apache.org" img="http://maven.apache.org/images/logos/maven-feather.png" />
</poweredBy>
<publishDate position="navigation-bottom" format="MM-dd-yy" />
<body>
<head>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '${gaTrackingId}']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<!--<menu ref="modules" inherit="bottom"/>-->
<!--<menu ref="parent" inherit="bottom"/>-->
<menu name="SDK Parent POM">
<item name="Introduction" href="./index.html" />
<item name="Maven Alfresco SDK Properties" href="./sdk-properties.html" />
<item name="Maven Alfresco SDK Profiles" href="./sdk-profiles.html" />
</menu>
<menu name="SDK components">
<item name="Maven Alfresco SDK" href="../../index.html" />
<item name="Alfresco AMP Archetype" href="../../archetypes/alfresco-amp-archetype/index.html" />
<item name="Share AMP Archetype" href="../../archetypes/share-amp-archetype/index.html" />
<item name="Alfresco All-in-One Archetype" href="../../archetypes/alfresco-allinone-archetype/index.html" />
<item name="Maven Alfresco SDK Parent POM" href="./index.html" />
<item name="Alfresco Platform Distribution POM" href="https://artifacts.alfresco.com/nexus/content/repositories/alfresco-docs/alfresco-platform-distribution/latest/index.html" />
<item name="Maven Alfresco Plugin" href="../../plugins/alfresco-maven-plugin/index.html" />
</menu>
<menu name="Alfresco Community">
<item name="Official Maven Alfresco SDK docs" href="http://docs.alfresco.com/community/concepts/alfresco-sdk-intro.html" />
<item name="Maven Alfresco Wiki Documentation" href="http://wiki.alfresco.com/wiki/Maven_Alfresco_SDK" />
<item name="Alfresco with Maven for Dummies" href="https://wiki.alfresco.com/wiki/Maven_For_Dummies" />
<item name="Developer Access (Google Code)" href="http://code.google.com/p/maven-alfresco-archetypes/" />
<item name="Gabriele Columbro's blog" href="http://www.mindthegab.com/" />
<item name="Maurizio Pillitu's blog" href="http://www.session.it/" />
<item name="Carlo Sciolla's blog" href="http://skuro.tk/" />
<item name="Enterprise adoption" href="http://www.slideshare.net/guest67a9ba/maven-application-lifecycle-management-for-alfresco" />
</menu>
<menu ref="reports" />
</body>
</project>