All Downloads are FREE. Search and download functionalities are using the official Maven repository.

public.javadoc.org.spincast.plugins.processutils.SpincastProcessUtils.html Maven / Gradle / Ivy

There is a newer version: 2.2.0
Show newest version






SpincastProcessUtils (org.spincast:spincast-framework 1.7.1 API)












org.spincast.plugins.processutils

Interface SpincastProcessUtils

  • All Known Implementing Classes:
    SpincastProcessUtilsDefault


    public interface SpincastProcessUtils
    Utilities related to processes and external projects manipulation.
    • Method Detail

      • executeGoalOnExternalMavenProject

        File executeGoalOnExternalMavenProject(ResourceInfo projectRootInfo,
                                               MavenProjectGoal mavenGoal)
        Execute the specified goal on an external Maven project.

        If the project is located on the classpath, it first copies it to the file system (in a temp folder).

        Returns:
        the root directory of the project. This will be the same as the specified path if on the file system, or will be the created temp directory where the project from the classpath has been copied otherwise.
      • executeGoalOnExternalMavenProject

        File executeGoalOnExternalMavenProject(ResourceInfo projectRootInfo,
                                               MavenProjectGoal mavenGoal,
                                               Map<String,Object> pomParams)
        Execute the specified goal on an external Maven project.

        If the project is located on the classpath, it first copies it to the file system (in a temp folder).

        Parameters:
        pomParams - Before executing the goal, those parameters are used to replace placeholders in the project's pom.xml using Spincast's TemplatingEngine.
        Returns:
        the root directory of the project. This will be the same as the specified path if on the file system, or will be the created temp directory where the project from the classpath has been copied otherwise.
      • executeJar

        void executeJar(String jarFilePath,
                        List<String> args,
                        JarExecutionHandler handler)
        Run an executable .jar by passing the specified arguments.

        If the process is not made to die automatically (for example it starts an HTTP server), you must kill the process by yourself!:

         JarExecutionHandlerDefault handler = new JarExecutionHandlerDefault();
         getSpincastProcessUtils().executeJar(jarFile.getAbsolutePath(),
                                              Lists.newArrayList(),
                                              handler);
         try {
             //...
         } finally {
             handler.killJarProcess();
         }
         
      • executeJar

        void executeJar(String javaBinPath,
                        String jarFilePath,
                        List<String> args,
                        JarExecutionHandler handler)
        Run an executable .jar by passing the specified arguments.

        If the process is not made to die automatically (for example it starts an HTTP server), you must kill the process by yourself!:

         JarExecutionHandlerDefault handler = new JarExecutionHandlerDefault();
         getSpincastProcessUtils().executeJar(jarFile.getAbsolutePath(),
                                              Lists.newArrayList(),
                                              handler);
         try {
             //...
         } finally {
             handler.killJarProcess();
         }
         
        Parameters:
        javaBinPath - The path to the java executable to use.

Copyright © 2019. All rights reserved.





© 2015 - 2025 Weber Informatics LLC | Privacy Policy