Red Hat Bugzilla – Bug 1028904
Classes generated from Data modeler won't compile outside business-central
Last modified: 2014-11-11 10:23:48 EST
Description of problem:
Generated classes can't be used outside business-central because of incomplete pom.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1- create an object using data modeler
2- use git pull to get it in eclipse or whatever IDE
3- compilation will fail because of
@org.kie.workbench.common.services.datamodeller.annotations.Label(value = "XXX")
@org.kie.api.definition.type.Position(value = 0)
Should the project pom declare org.kie dependencies?
As described above, data modeller generated .java files references some annotations that belongs to the kie world.
If you want to compile the generated .java files outside the business central you need to add a dependency to the following maven artifact: kie-api-6.1.0-SNAPSHOT.jar:
note: the version number is orientative. (users that use the GA release in the future, probably should use 6.0.0.Final)
One last comment, in order to have all model annotations in the same package, the Label, and Description annotations were re factored to the package "org.kie.api.definition.type".
So take into account that previous generated testing models should be re factored.
I can confirm that adding the dependency helps but it's also required to add the repository from which it can be downloaded.
Would you mind explaining why isn't the dependency already defined in the pom.xml file? At least we will need to document the steps required to do the compilation.
We discussed adding the dependency automatically into the POM, but we don't know at this point the impact this will cause in deployments inside containers, as well as the risk of causing dependency clashes.
For 6.0.0, our suggestion is to keep as is and document the need of the kie-api dependency (developers will probably have this in their development environment anyway). For 6.1, we will have the proper time to understand the impact of automatically adding this dependency.
So yes, it requires documentation.
I am leaving this as ASSIGNED, to be resolved in future versions.
It is documented how to add the jBPM library in Eclipse to a project you imported from workbench (to add all required dependencies) here:
A similar approach could be used in other IDEs.
I had same issue using GA version.
And what if we use <scope>compile</scope> of this specific dependency into pom.xml ?
It was defined that when a user is about to work with a project that uses references to workbench classes, those dependencies should be set according to the documentation. See comments above.