eclipse创建activiti6 项目demo
1 新建maven 项目
2 修改 pom 文件,完整内容如下
<?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.</modelVersion> <groupId>com.huitong</groupId>
<artifactId>actdemo1</artifactId>
<version>0.0.-SNAPSHOT</version> <name>actdemo1</name>
<!-- FIXME change it to the project's website -->
<url>http://www.example.com</url> <properties>
<project.build.sourceEncoding>UTF-</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<activiti.version>6.0.</activiti.version>
</properties> <dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency> <dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-engine</artifactId>
<version>${activiti.version}</version>
</dependency> <dependency>
<groupId>org.activiti</groupId>
<artifactId>activiti-spring</artifactId>
<version>${activiti.version}</version>
</dependency> <dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.</version>
</dependency> <!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.</version>
</dependency> <!-- https://mvnrepository.com/artifact/joda-time/joda-time -->
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.8.</version>
</dependency> </dependencies> <build>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.0.</version>
</plugin>
<!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20.</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
3 在resources 文件夹下添加配置文件 activiti.cfg.xml,主要配置一个 processEngineConfiguration
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"> <bean id="processEngineConfiguration" class="org.activiti.engine.impl.cfg.StandaloneProcessEngineConfiguration">
<property name="jdbcDriver" value="com.mysql.jdbc.Driver"/>
<property name="jdbcUrl" value="jdbc:mysql://localhost:3306/activiti?characterEncoding=utf8"/>
<property name="jdbcUsername" value="root"/>
<property name="jdbcPassword" value="root123"/>
<property name="databaseSchemaUpdate" value="true"/>
</bean>
</beans>
4 配置log4j的配置文件 log4j.properties
log4j.rootLogger=DEBUG, ACT log4j.appender.ACT=org.apache.log4j.ConsoleAppender
log4j.appender.ACT.layout=org.apache.log4j.PatternLayout
log4j.appender.ACT.layout.ConversionPattern= %d{hh:mm:ss,SSS} [%t] %-5p %c %x - %m%n
5 添加一个类,App.java
package com.huitong.actdemo1; import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngines;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService; /**
* Hello world!
*
*/
public class App
{
public static void main( String[] args )
{
ProcessEngine pengine = ProcessEngines.getDefaultProcessEngine(); RepositoryService repService = pengine.getRepositoryService(); RuntimeService runService = pengine.getRuntimeService(); TaskService taskService = pengine.getTaskService(); pengine.close();
System.out.println("結束了"); }
}
6 运行后会发现数据库 activiti 中多了很多表,总共28张
eclipse创建activiti6 项目demo的更多相关文章
- (八)Eclipse创建Maven项目运行mvn命令
1.Eclipse创建Maven项目 使用Eclipse创建一个Maven项目非常的简单,选择菜单项File>New>Other(也可以在项目结构空白处右击鼠标键),在弹出的对话框中选择M ...
- eclipse 创建maven 项目 动态web工程报错
Eclipse 创建maven 项目 动态web工程 注:Eclipse版本为(Version: Mars.1 Release (4.5.1))maven版本为(apache-maven-3.3.9) ...
- Eclipse 创建 Maven 项目、Maven JavaWeb 项目
Eclipse 创建 Maven 项目 新建一个maven项目 (默认)(如果不行第一个Create a simple ... 也选中) 默认 Jav ...
- eclipse 创建maven 项目 动态web工程完整示例
需求表均同springmvc案例 此处只是使用maven 注意,以下所有需要建立在你的eclipse等已经集成配置好了maven了,说白了就是新建项目的时候已经可以找到maven了 没有的话需要安装m ...
- eclipse 创建maven 项目 动态web工程完整示例 maven 整合springmvc整合mybatis
接上一篇: eclipse 创建maven 项目 动态web工程完整示例 eclipse maven工程自动添加依赖设置 maven工程可以在线搜索依赖的jar包,还是非常方便的 但是有的时候可能还需 ...
- eclipse 创建springboot项目
eclipse创建springboot项目的三种方法: 引自:https://blog.csdn.net/mousede/article/details/81285693
- Android开发中遇到的问题(三)——eclipse创建android项目无法正常预览布局文件
一.问题描述 今天使用SDK Manager将Android SDK的版本更新到了Android 5.1的版本,eclipse创建android项目时,预览activity_main.xml文件时提示 ...
- eclipse创建web项目web.xml配置文件笔记
1.使用eclipse创建web项目时,如果直接finish的话就没有默认生成web.xml配置文件,此时在你的项目下是看不到web.xml配置文件的,如果要查看的话可以如下操作: 右键你的项目,然后 ...
- Eclipse创建Maven-Web项目及解决 jre版本和web.xml版本问题
eclipse maven-web有个蛋疼的问题,就是web版本很低. 且看别人是如何解决的:Eclipse创建Maven-Web项目及解决 jre版本和web.xml版本问题
随机推荐
- Oracle 定时任务使用
1:首先创建存储过程 create or replace procedure pro_rqsl_hmd is rsCursor sys_refcursor; rqslid ); nsrsbh ); h ...
- window批处理杀死指定端口进程
@echo off setlocal enabledelayedexpansion set /p port=请输入端口号: for /f "tokens=1-5" %%a in ( ...
- XML的四种解析方法
转载请注明原文地址:http://www.cnblogs.com/ygj0930/p/6646572.html XML文档以层级标签的形式来组织数据,多用于配置文件.存储静态数据.交换数据. ...
- Resources.class.getResourceAsStream 获取配置的方法
转载:https://blog.csdn.net/dwl764457208/article/details/78593005 有空可以看这个: 类加载器与 Class.getResourceAsStr ...
- sevlet的url-pattern设置
url-pattern的值,表示访问对应servlet的地址: 默认servlet的访问路径:http://localhost:8080/项目名称/Sevlet名称 如果不使用这种方式的话,可以使用自 ...
- linux rpm 安装后 mysql 默认安装目录等信息
MySQL安装完成后不象SQL Server默认安装在一个目录,它的数据库文件.配置文件和命令文件分别在不同的目录,了解这些目录非常重要,尤其对于Linux的初学者,因为 Linux本身的目录结构就比 ...
- Receiver not registered.
1. 在MessageListActivity中出现异常:Receiver not registered. 07-16 11:15:47.881: E/AndroidRuntime(32361): F ...
- 远程阿里云window服务器报错身份验证错误
整理文章,很久之前遇到的一个问题,一直呆在草稿箱,特发布出来,帮助可能遇到该问题的人 mstsc连接时报错如下 解决方法: 修改本地安全组策略[安全组 gpedit.msc]
- ios中uitableview上拉刷新和下拉刷新(1)
在一个项目开发过程中为了更好的体验经常会用到下拉刷新更新数据,当然也伴随一些上拉加载更多数据的情况:当前比较火的EGOTableViewPullRefresh只实现了下拉功能,而没有上拉的功能.这里介 ...
- 在centos 5.5 i386 上安装 oracle 10g xe
1.安装rpm包 nano /v.sh 将下面内容复制进去 #!/bin/bash rpm -Uvh compat-db-4.2.52-5.1.i386.rpm rpm -Uvh compat-lib ...