Package spoon

Class MavenLauncher

  • All Implemented Interfaces:
    SpoonAPI

    public class MavenLauncher
    extends Launcher
    Create a Spoon launcher from a maven pom file
    • Constructor Detail

      • MavenLauncher

        public MavenLauncher​(java.lang.String mavenProject,
                             MavenLauncher.SOURCE_TYPE sourceType)
        MavenLauncher constructor assuming either an environment variable M2_HOME, or that mvn command exists in PATH.
        Parameters:
        mavenProject - the path to the root of the project
        sourceType - the source type (App, test, or all)
      • MavenLauncher

        public MavenLauncher​(java.lang.String mavenProject,
                             MavenLauncher.SOURCE_TYPE sourceType,
                             java.util.regex.Pattern profileFilter)
        MavenLauncher constructor assuming either an environment variable M2_HOME, or that mvn command exists in PATH.
        Parameters:
        mavenProject - the path to the root of the project
        sourceType - the source type (App, test, or all)
        profileFilter - regular expression of profiles to include in the built model
      • MavenLauncher

        public MavenLauncher​(java.lang.String mavenProject,
                             MavenLauncher.SOURCE_TYPE sourceType,
                             boolean forceRefresh)
        MavenLauncher constructor assuming either an environment variable M2_HOME, or that mvn command exists in PATH.
        Parameters:
        mavenProject - the path to the root of the project
        sourceType - the source type (App, test, or all)
        forceRefresh - force the regeneration of classpath
      • MavenLauncher

        public MavenLauncher​(java.lang.String mavenProject,
                             MavenLauncher.SOURCE_TYPE sourceType,
                             boolean forceRefresh,
                             java.util.regex.Pattern profileFilter)
        MavenLauncher constructor assuming either an environment variable M2_HOME, or that mvn command exists in PATH.
        Parameters:
        mavenProject - the path to the root of the project
        sourceType - the source type (App, test, or all)
        forceRefresh - force the regeneration of classpath
        profileFilter - regular expression of profiles to include in the built model
      • MavenLauncher

        public MavenLauncher​(java.lang.String mavenProject,
                             MavenLauncher.SOURCE_TYPE sourceType,
                             java.lang.String mvnHome)
        Parameters:
        mavenProject - the path to the root of the project
        sourceType - the source type (App, test, or all)
        mvnHome - Path to maven install
      • MavenLauncher

        public MavenLauncher​(java.lang.String mavenProject,
                             MavenLauncher.SOURCE_TYPE sourceType,
                             java.lang.String mvnHome,
                             java.util.regex.Pattern profileFilter)
        Parameters:
        mavenProject - the path to the root of the project
        sourceType - the source type (App, test, or all)
        mvnHome - Path to maven install
        profileFilter - regular expression of profiles to include in the built model
      • MavenLauncher

        public MavenLauncher​(java.lang.String mavenProject,
                             MavenLauncher.SOURCE_TYPE sourceType,
                             java.lang.String mvnHome,
                             boolean forceRefresh)
        Parameters:
        mavenProject - the path to the root of the project
        sourceType - the source type (App, test, or all)
        mvnHome - Path to maven install
        forceRefresh - force the regeneration of classpath
      • MavenLauncher

        public MavenLauncher​(java.lang.String mavenProject,
                             MavenLauncher.SOURCE_TYPE sourceType,
                             java.lang.String mvnHome,
                             boolean forceRefresh,
                             java.util.regex.Pattern profileFilter)
        Parameters:
        mavenProject - the path to the root of the project
        sourceType - the source type (App, test, or all)
        mvnHome - Path to maven install
        forceRefresh - force the regeneration of classpath
        profileFilter - regular expression of profiles to include in the built model
      • MavenLauncher

        public MavenLauncher​(java.lang.String mavenProject,
                             MavenLauncher.SOURCE_TYPE sourceType,
                             java.lang.String[] classpath)
        MavenLauncher constructor that skips maven invocation building classpath.
        Parameters:
        mavenProject - the path to the root of the project
        sourceType - the source type (App, test, or all)
        classpath - String array containing the classpath elements
      • MavenLauncher

        public MavenLauncher​(java.lang.String mavenProject,
                             MavenLauncher.SOURCE_TYPE sourceType,
                             java.lang.String[] classpath,
                             java.util.regex.Pattern profileFilter)
        MavenLauncher constructor that skips maven invocation building classpath.
        Parameters:
        mavenProject - the path to the root of the project
        sourceType - the source type (App, test, or all)
        classpath - String array containing the classpath elements
        profileFilter - regular expression of profiles to include in the built model
    • Method Detail

      • getPomFile

        public SpoonPom getPomFile()
        Returns:
        SpoonPom corresponding to the pom file used by the launcher
      • rebuildClasspath

        public void rebuildClasspath()
        Triggers regeneration of the classpath that is used for building the model, based on pom.xml