You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Elliotte Rusty Harold (Jira)" <ji...@apache.org> on 2020/07/29 16:07:00 UTC

[jira] [Commented] (MSHARED-926) Maven invoker build stuck at compiling a module

    [ https://issues.apache.org/jira/browse/MSHARED-926?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17167336#comment-17167336 ] 

Elliotte Rusty Harold commented on MSHARED-926:
-----------------------------------------------

Can you explain how we might reproduce this one?

> Maven invoker build stuck at compiling a module
> -----------------------------------------------
>
>                 Key: MSHARED-926
>                 URL: https://issues.apache.org/jira/browse/MSHARED-926
>             Project: Maven Shared Components
>          Issue Type: Bug
>          Components: maven-invoker
>    Affects Versions: maven-invoker-3.0.1
>         Environment: windows 10 64bit, intel i7-4770, 16gb ram,
>            Reporter: gaurav
>            Priority: Blocker
>         Attachments: app_dump.txt, mvn_dump.txt
>
>
> 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.
>  
>  
> {code:java}
> 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);
>  }
> }
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)