Uploaded image for project: 'Maven Shared Components'
  1. Maven Shared Components
  2. MSHARED-926

Maven invoker build stuck at compiling a module

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: maven-invoker-3.0.1
    • Fix Version/s: None
    • Component/s: maven-invoker
    • Labels:
      None
    • Environment:
      windows 10 64bit, intel i7-4770, 16gb ram,

      Description

      Hi all,

      I am creating a tool to schedule two maven builds one after another using maven-invoker APIs.

      Both maven projects are multi-module huge projects.

      The first projects build without issues and the next project build stucks after sometime.

      I suspect there is some kind of thread related issue which causes it.

       

       

      private void invokerAPI(Path pomRootPath, Properties props) {
       InvocationRequest request = new DefaultInvocationRequest();
       request.setPomFile(Paths.get(pomRootPath.toAbsolutePath().toString(), "pom.xml").toFile());
       request.setGoals(Arrays.asList("clean", "install"));
       request.setProfiles(Collections.singletonList("qa"));
       request.setProperties(getInvokerProps(props));
       request.setUserSettingsFile(new File("C:\\Users\\gauravd\\.m2\\settings.xml"));
      invoker.setMavenHome(new File("C:\\Program Files\\Apache Software Foundation\\apache-maven-3.6.1"));
       try {
       InvocationResult result = invoker.execute(request);
       if (result.getExitCode() != 0) {
       if (result.getExecutionException() != null) {
       logger.error("Failed to run the maven command. Exited with status {}", result.getExitCode(), result.getExecutionException());
       throw new RuntimeException("Failed to run the maven command. Exited with status " + result.getExitCode(),
       result.getExecutionException());
       } else {
       logger.error("Failed to run the maven command. Exited with status {}", result.getExitCode());
       throw new RuntimeException("Failed to run the maven command. Exited with status " + result.getExitCode());
       }
       }
       } catch (MavenInvocationException e) {
       logger.error("Failed to run the maven command.", e);
       throw new RuntimeException("Failed to run the maven command.", e);
       }
      }
      

       

        Attachments

        1. app_dump.txt
          13 kB
          gaurav
        2. mvn_dump.txt
          18 kB
          gaurav

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              gaurav9822 gaurav
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: