Bug 1263358

Summary: KieBuilder does not read pom.xml from KieFileSystem if setPomModel() is used before buildAll()
Product: [Retired] JBoss BPMS Platform 6 Reporter: Jeremy Lindop <jlindop>
Component: Business CentralAssignee: manstis
Status: CLOSED EOL QA Contact: Tomas David <tdavid>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 6.2.0CC: kverlaen, manstis
Target Milestone: ER4   
Target Release: 6.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-27 19:05:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jeremy Lindop 2015-09-15 15:57:32 UTC
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

How reproducible:

1. Add <distributionManagement> to a project pom
3. Build and deploy

Actual results:
No artifacts are deployed to <distributionManagement> repositories

Expected results:
Artifacts should be deployed to <distributionManagement> repositories

Additional info:
See also https://bugzilla.redhat.com/show_bug.cgi?id=1121179

Comment 2 manstis 2015-09-16 07:53:11 UTC
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.

See https://github.com/droolsjbpm/drools/commit/575b48a63e55b5216bf78ecf48621ac8f9f80729

Comment 5 Tomas David 2015-10-23 12:41:33 UTC
Verified on BRMS 6.2.0.ER4.