AnsweredAssumed Answered

Create and deploy PAR using Maven only

Question asked by wesley on Aug 11, 2011
Latest reply on Jun 27, 2013 by masroor
The Activiti 5.6 User Guide shows how to deploy PAR into Activiti process engine using Ant. Here is what I have used to do it without a build.xml file using maven plugins:


            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.3</version>
                <executions>
                    <execution>
                        <id>create-par</id>
                        <phase>package</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <tasks>
                                <echo message="Creating bar: ${project.build.directory}/process-definitions-${project.version}.bar"/>
                                <zip destfile="${project.build.directory}/process-definitions-${project.version}.bar">
                                    <fileset dir="src/main/process">
                                        <include name="**/*.bpmn20.xml"/>
                                        <include name="**/*.form"/>
                                    </fileset>
                                </zip>
                            </tasks>
                        </configuration>
                    </execution>
                    <execution>
                        <id>deploy-par</id>
                        <phase>install</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <tasks>
                                <echo message="Deploying bar"/>
                                <taskdef name="deploy-bar" classname="org.activiti.engine.impl.ant.DeployBarTask" classpathref="maven.runtime.classpath"/>
                                <deploy-bar file="${project.build.directory}/process-definitions-${project.version}.bar"/>
                            </tasks>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

Outcomes