Introduction
This post is a solution for the error of: "package org.kie.api.definition.type does not exist".
If you google the error, you will get this page: https://access.redhat.com/solutions/892893. I could not find the direct solution. Thus I post the solution here
What Is The Issue?
If you work on the JBoss BPM Suite 6.1, you will see that all the source code is in git server, which in build in the JBoss BPM Suite. You can clone the GIT repository by the following commands: [Suppose you have created a git repository of "demo"
1 2 | git init git clone git clone git: //localhost:9418/demo |
After you check out the code from the git repositroy [In my case, I have cloned the code to : ary2013@Guojiangs-MacBook-Pro:~/jBPMS/mygit/. And I have a project, named "Insurance". Now do the following:
1 2 | /Users/Gary2013/jBPMS/mygit/demo/Insurance mvn clean install |
You will see errors complaining something like:
1 | [ERROR] /Users/Gary2013/jBPMS/mygit/demo/Insurance/src/main/java/com/ggl/insurance/InsuredObject.java:[7,29] package org.kie.api.definition.type does not exist |
Fix The Error
To fix the error, you will need to add the following code to the pom.xml file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | <!--xml version= "1.0" encoding= "UTF-8" ?--> <project xsi:schemalocation= "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns= "http://maven.apache.org/POM/4.0.0" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" > <modelversion>4.0.0</modelversion> <groupid>com.ggl.insurance</groupid> <artifactid>Insurance</artifactid> <version>1.0</version> <packaging>kjar</packaging> <name>Insurance</name> <repositories> <repository> <id>guvnor-m2-repo</id> <name>Guvnor M2 Repo</name> <url>http: //localhost:8080/business-central/maven2/</url> </repository> </repositories> <build> <plugins> <plugin> <groupid>org.kie</groupid> <artifactid>kie-maven-plugin</artifactid> <version>6.0.3-redhat-4</version> <extensions> true </extensions> </plugin> </plugins> </build> <dependencies> <dependency> <groupid>org.kie</groupid> <artifactid>kie-api</artifactid> <version>6.1.0.Final</version> </dependency> </dependencies> </project> |
The section of dependencies are added. Now if you build the project, it will be successful!