cancel
Showing results for 
Search instead for 
Did you mean: 

Java based bar deployment

bluerain
Champ in-the-making
Champ in-the-making
I have written a java based bar deployer
but it doesnt seem to find the .bar file. It says couldnt find the *.bar file as it does not exists. But it exists in the deloyment directory as generated by the eclipse plugin.

public class BarDeployer {
   public static void main(String[] args) throws Exception {
      
      ProcessEngine processEngine =   SpringProcessEngineConfiguration.createProcessEngineConfigurationFromResourceDefault().buildProcessEngine();
         
      RepositoryService repositoryService = processEngine.getRepositoryService();
      String barFileName = "deployment/request_release_PO.bar";
      ZipInputStream inputStream = new ZipInputStream(new FileInputStream(barFileName));
      String deploymentID = repositoryService.createDeployment().name(barFileName).addZipInputStream(inputStream).deploy().getId();
      List<String> deployedResources = repositoryService.getDeploymentResourceNames(deploymentID);
      for (String deployedResource : deployedResources) {
         System.out.println("Deployed : " + deployedResource);
      }
      inputStream.close();
   }
}
1 REPLY 1

jbarrez
Star Contributor
Star Contributor
Are you using maven? If so, then make sure the bar file is under /src/main/resources.