Bug 1263358 - KieBuilder does not read pom.xml from KieFileSystem if setPomModel() is used before buildAll()
KieBuilder does not read pom.xml from KieFileSystem if setPomModel() is used ...
Product: JBoss BPMS Platform 6
Classification: JBoss
Component: Business Central (Show other bugs)
Unspecified Unspecified
medium Severity unspecified
: ER4
: 6.2.0
Assigned To: manstis
Tomas David
Depends On:
  Show dependency treegraph
Reported: 2015-09-15 11:57 EDT by Jeremy Lindop
Modified: 2015-10-23 08:45 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jeremy Lindop 2015-09-15 11:57:32 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

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 03:53:11 EDT
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 08:41:33 EDT
Verified on BRMS 6.2.0.ER4.

Note You need to log in before you can comment on or make changes to this bug.