Skip to content
一、添加官方activiti骨架到idea中
  • 下载Acticiti官方源码

    image-20200627113605136

  • 进入tooling模块下

    shell
    cd Activiti/tooling/archetypes
  • 执行maven安装命令

    shell
    mvn clean install

    image-20200627113811442

  • 配置骨架

    image-20200627114048743

二、添加自定义activiti骨架到idea中
  • 复制原来官方的骨架,更改pom文件

    image-20200627202825112

  • 添加没有src/main/java和srcmain/resources目录

  • 将HelloWord.java拷入src/main/java目录中,更改package,更改为package ${package}; 占位符

  • 将HelloWord的resources目录下的文件拷贝进srcmain/resources

  • 更改META-INF/maven/archetype-metadata.xml

    xml
    <?xml version="1.0" encoding="UTF-8"?>
    <archetype-descriptor name="activiti-archetype-unittest2">
     <fileSets>
       <fileSet filtered="true" packaged="true">
         <directory>src/main/java</directory>
         <includes>
           <include>**/*.java</include>
         </includes>
       </fileSet>
    
       <fileSet filtered="false" packaged="false">
         <directory>src/main/resources</directory>
         <includes>
           <include>activiti.cfg.xml</include>
           <include>logback.xml</include>
           <include>diagrams/second_approve.bpmn20.xml</include>
         </includes>
       </fileSet>
    
       <fileSet filtered="true" packaged="true">
         <directory>src/test/java</directory>
         <includes>
           <include>**/*.java</include>
         </includes>
       </fileSet>
       <fileSet filtered="true" packaged="true">
         <directory>src/test/resources</directory>
         <includes>
           <include>my-process.bpmn20.xml</include>
         </includes>
       </fileSet>
     </fileSets>
    </archetype-descriptor>
    • 注意name的更改
  • 提交maven

    shell
    # 进入activiti-archetype-unittest2
    $ cd activiti-archetype-unittest2
    # 执行安装命令
    $ mvn clear install
  • 根据pom.xml文件配置脚手架

    image-20200627205529279

Released under the MIT License.