Source:
public void onServiceTaskInstalled(RepoData service, String target, List<String> parameters, String branchName) { try { if(branchName == null) { branchName = "master"; } boolean installPomDepds = repositoryStorage.loadConfiguration().getInstallPomDeps(); Path path = PathFactory.newPath("pom.xml", "default://" + branchName + "@" + target); Module module = moduleService.resolveModule(path); POM projectPOM = pomService.load(module.getPomXMLPath()); if (installPomDepds && projectPOM != null && !ServiceTaskUtils.DEFAULT_HANDLERS.contains(service.getModule())) { boolean useVersionRange = repositoryStorage.loadConfiguration().getVersionRange(); Dependencies projectDepends = projectPOM.getDependencies(); Dependencies validDependsFromWorkitem = getValidDependenciesForWorkitem(projectDepends, service, useVersionRange); if (validDependsFromWorkitem != null && validDependsFromWorkitem.size() > 0) { for (Dependency workitemDependency : validDependsFromWorkitem) { projectPOM.getDependencies().add(workitemDependency); } pomService.save(module.getPomXMLPath(), projectPOM, metadataService.getMetadata(module.getPomXMLPath()), "System updated dependencies from service task installation.", false); } } if (service.getGav() == null) { installFromLocal(service, module); } else { installFromJar(service, module); } String handler = service.getDefaultHandler(); if (parameters != null && !parameters.isEmpty()) { String strParams = "(\"" + parameters.stream().collect(Collectors.joining("\", \"")) + "\")"; handler = handler.replaceFirst("\\(.*?\\)", strParams); } serviceTaskResourceEvent.fire(new ServiceTaskResourceEvent(path, "mvel", handler, service.getName(), "", ResourceChangeType.ADD)); logger.info("Service task has been installed", service.getName()); } catch (Exception e) { logger.error("Unexpected error when installing service task {}", service.getName(), e); } }

Target:
public void onServiceTaskInstalled(RepoData service, String target, List<String> parameters, String branchName) { try { boolean installPomDepds = repositoryStorage.loadConfiguration().getInstallPomDeps(); Path path = getTargetPath("pom.xml", branchName, target); Module module = moduleService.resolveModule(path); POM projectPOM = pomService.load(module.getPomXMLPath()); if (installPomDepds && projectPOM != null && !ServiceTaskUtils.DEFAULT_HANDLERS.contains(service.getModule())) { boolean useVersionRange = repositoryStorage.loadConfiguration().getVersionRange(); Dependencies projectDepends = projectPOM.getDependencies(); Dependencies validDependsFromWorkitem = getValidDependenciesForWorkitem(projectDepends, service, useVersionRange); if (validDependsFromWorkitem != null && validDependsFromWorkitem.size() > 0) { for (Dependency workitemDependency : validDependsFromWorkitem) { projectPOM.getDependencies().add(workitemDependency); } pomService.save(module.getPomXMLPath(), projectPOM, metadataService.getMetadata(module.getPomXMLPath()), "System updated dependencies from service task installation.", false); } } if (service.getGav() == null) { installFromLocal(service, module); } else { installFromJar(service, module); } String handler = service.getDefaultHandler(); if (parameters != null && !parameters.isEmpty()) { String strParams = "(\"" + parameters.stream().collect(Collectors.joining("\", \"")) + "\")"; handler = handler.replaceFirst("\\(.*?\\)", strParams); } serviceTaskResourceEvent.fire(new ServiceTaskResourceEvent(path, "mvel", handler, service.getName(), "", ResourceChangeType.ADD)); logger.info("Service task has been installed", service.getName()); } catch (Exception e) { logger.error("Unexpected error when installing service task {}", service.getName(), e); } }