Source:
public void prepare() { configureServices(); logger.debug("Preparing kjar"); KieServices ks = KieServices.Factory.get(); ReleaseId releaseId = ks.newReleaseId(GROUP_ID, ARTIFACT_ID, VERSION); List<String> processes = new ArrayList<String>(); processes.add("repo/processes/general/entityprocessvar-process.bpmn2"); DeploymentDescriptorImpl customDescriptor = new DeploymentDescriptorImpl("org.jbpm.domain"); customDescriptor.setAuditMode(AuditMode.JPA); customDescriptor.setEnvironmentEntries(null); List<String> remotableClasses = java.util.Arrays.asList("example.CaseDetail", "org.drools.persistence.jpa.marshaller.MappedVariable"); customDescriptor.setClasses(remotableClasses); List<ObjectModel> marshallingStrategies = new ArrayList<ObjectModel>(); marshallingStrategies.add(new ObjectModel("mvel", "new org.drools.persistence.jpa.marshaller.JPAPlaceholderResolverStrategy(\"org.jbpm.domain\", classLoader)")); customDescriptor.setMarshallingStrategies(marshallingStrategies); Map<String, String> extraResources = new HashMap<>(); extraResources.put(CASEDETAIL_JAVA, getCaseDetailEntitySource()); extraResources.put("src/main/resources/" + DeploymentDescriptor.META_INF_LOCATION, customDescriptor.toXml()); extraResources.put("src/main/resources/META-INF/persistence.xml", getPersistenceXml()); InternalKieModule kJar1 = createKieJar(ks, releaseId, processes, extraResources); File pom = new File("target/kmodule", "pom.xml"); pom.getParentFile().mkdir(); try { FileOutputStream fs = new FileOutputStream(pom); fs.write(getPom(releaseId).getBytes()); fs.close(); } catch (Exception e) { } KieMavenRepository repository = getKieMavenRepository(); repository.deployArtifact(releaseId, kJar1, pom); }

Target:
public void prepare() { configureServices(); logger.debug("Preparing kjar"); KieServices ks = KieServices.Factory.get(); ReleaseId releaseId = ks.newReleaseId(GROUP_ID, ARTIFACT_ID, VERSION); List<String> processes = new ArrayList<String>(); processes.add("repo/processes/general/entityprocessvar-process.bpmn2"); DeploymentDescriptorImpl customDescriptor = new DeploymentDescriptorImpl("org.jbpm.domain"); List<String> remotableClasses = java.util.Arrays.asList("example.CaseDetail", "org.drools.persistence.jpa.marshaller.MappedVariable"); customDescriptor.setClasses(remotableClasses); List<ObjectModel> marshallingStrategies = new ArrayList<ObjectModel>(); marshallingStrategies.add(new ObjectModel("mvel", "new org.drools.persistence.jpa.marshaller.JPAPlaceholderResolverStrategy(\"org.jbpm.test:test-module:1.0.0-SNAPSHOT\", classLoader)")); customDescriptor.setMarshallingStrategies(marshallingStrategies); Map<String, String> extraResources = new HashMap<>(); extraResources.put(CASEDETAIL_JAVA, getCaseDetailEntitySource()); extraResources.put("src/main/resources/" + DeploymentDescriptor.META_INF_LOCATION, customDescriptor.toXml()); extraResources.put("src/main/resources/META-INF/persistence.xml", getPersistenceXml()); InternalKieModule kJar1 = createKieJar(ks, releaseId, processes, extraResources); File pom = new File("target/kmodule", "pom.xml"); pom.getParentFile().mkdir(); try { FileOutputStream fs = new FileOutputStream(pom); fs.write(getPom(releaseId).getBytes()); fs.close(); } catch (Exception e) { } KieMavenRepository repository = getKieMavenRepository(); repository.deployArtifact(releaseId, kJar1, pom); }