Red Hat Bugzilla – Bug 1263358
KieBuilder does not read pom.xml from KieFileSystem if setPomModel() is used before buildAll()
Last modified: 2015-10-23 08:45:07 EDT
Description of problem:
If you add a <distributionManagement> section to a pom.xml in a project, when you build and deploy the project the project is not deployed to the repositories specified in the <distributionManagement> section.
It looks as though the problem is that the jar built by the builder does not contain the pom.xml file in the project. Instead, it contains a bare pom.xml file containing just the GAV for the project.
Version-Release number of selected component (if applicable):
Community Build 6.3.0.CR2
This worked in bpmsuite-6.1.0.GA
1. Add <distributionManagement> to a project pom
3. Build and deploy
No artifacts are deployed to <distributionManagement> repositories
Artifacts should be deployed to <distributionManagement> repositories
See also https://bugzilla.redhat.com/show_bug.cgi?id=1121179
This issue is caused by the introduction of LRUPomModelCache in Builder.
Builder's use of LRUPomModelCache makes a call to KieBuilderImpl.setPomModel() before a call to KieBuilderImpl.getPomModel(). The latter sets an instance variable, pomXml, in KieBuilderImpl to the pom.xml written to KieBuilder's "source" KieFileSystem.
When a call to KieBuilder.buildAll() is made it checks if pomXml is not null and writes the pom.xml (and pom.properties) to the KieModule's "target" FileSystem (that forms the KieModule/KJAR). In this scenario pomXml remains null.
Verified on BRMS 6.2.0.ER4.