List of usage examples for org.apache.maven.execution ReactorManager MAKE_DEPENDENTS_MODE
String MAKE_DEPENDENTS_MODE
To view the source code for org.apache.maven.execution ReactorManager MAKE_DEPENDENTS_MODE.
Click Source Link
From source file:org.jetbrains.idea.maven.server.Maven30ServerEmbedderImpl.java
License:Apache License
private MavenExecutionResult doExecute(@Nonnull final File file, @Nonnull final List<String> activeProfiles, @Nonnull final List<String> inactiveProfiles, @Nonnull final List<String> goals, @Nonnull final List<String> selectedProjects, boolean alsoMake, boolean alsoMakeDependents) throws RemoteException { MavenExecutionRequest request = createRequest(file, activeProfiles, inactiveProfiles, goals); if (!selectedProjects.isEmpty()) { request.setRecursive(true);/*from w w w . ja v a 2 s .c o m*/ request.setSelectedProjects(selectedProjects); if (alsoMake && alsoMakeDependents) { request.setMakeBehavior(ReactorManager.MAKE_BOTH_MODE); } else if (alsoMake) { request.setMakeBehavior(ReactorManager.MAKE_MODE); } else if (alsoMakeDependents) { request.setMakeBehavior(ReactorManager.MAKE_DEPENDENTS_MODE); } } org.apache.maven.execution.MavenExecutionResult executionResult = safeExecute(request, getComponent(Maven.class)); return new MavenExecutionResult(executionResult.getProject(), filterExceptions(executionResult.getExceptions())); }
From source file:org.jetbrains.maven.embedder.MavenEmbedder.java
License:Apache License
@Nonnull public MavenExecutionResult execute(@Nonnull final File file, @Nonnull final List<String> activeProfiles, @Nonnull final List<String> inactiveProfiles, @Nonnull final List<String> goals, @Nonnull final List<String> selectedProjects, boolean alsoMake, boolean alsoMakeDependents) { try {/* w w w . ja va 2s. com*/ MavenExecutionRequest request = createRequest(file, activeProfiles, inactiveProfiles, goals); if (!selectedProjects.isEmpty()) { request.setRecursive(true); request.setSelectedProjects(selectedProjects); if (alsoMake && alsoMakeDependents) { request.setMakeBehavior(ReactorManager.MAKE_BOTH_MODE); } else if (alsoMake) { request.setMakeBehavior(ReactorManager.MAKE_MODE); } else if (alsoMakeDependents) { request.setMakeBehavior(ReactorManager.MAKE_DEPENDENTS_MODE); } } Maven maven = getComponent(Maven.class); Method method = maven.getClass().getDeclaredMethod("doExecute", MavenExecutionRequest.class, EventDispatcher.class); method.setAccessible(true); ReactorManager reactor = (ReactorManager) method.invoke(maven, request, request.getEventDispatcher()); return new MavenExecutionResult(reactor.getTopLevelProject(), Collections.<Exception>emptyList()); } catch (InvocationTargetException e) { return handleException(e.getTargetException()); } catch (NoSuchMethodException e) { throw new RuntimeException(e); // should never happen } catch (IllegalAccessException e) { throw new RuntimeException(e); // should never happen } }