Class EclipseRunMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

    @Mojo(name="eclipse-run")
    public class EclipseRunMojo
    extends org.apache.maven.plugin.AbstractMojo
    Launch an eclipse process with arbitrary commandline arguments. The eclipse installation is defined by the dependencies to bundles specified.
    • Field Detail

      • work

        @Parameter(defaultValue="${project.build.directory}/eclipserun-work")
        private java.io.File work
      • project

        @Parameter(property="project")
        private org.apache.maven.project.MavenProject project
      • dependencies

        @Parameter
        private java.util.List<org.apache.maven.model.Dependency> dependencies
        Dependencies which will be resolved transitively to make up the eclipse runtime. Example:
         <dependencies>
          <dependency>
           <artifactId>org.eclipse.ant.core</artifactId>
           <type>eclipse-plugin</type>
          </dependency>
         </dependencies>
         
      • addDefaultDependencies

        @Parameter(defaultValue="true")
        private boolean addDefaultDependencies
        Whether to add default dependencies to bundles org.eclipse.equinox.launcher, org.eclipse.osgi and org.eclipse.core.runtime.
      • executionEnvironment

        @Parameter(defaultValue="JavaSE-1.7")
        private java.lang.String executionEnvironment
        Execution environment profile name used to resolve dependencies.
      • repositories

        @Parameter(required=true)
        private java.util.List<Repository> repositories
        p2 repositories which will be used to resolve dependencies. Example:
         <repositories>
          <repository>
           <id>juno</id>
           <layout>p2</layout>
           <url>http://download.eclipse.org/releases/juno</url>
          </repository>
         </repositories>
         
      • session

        @Parameter(property="session",
                   readonly=true,
                   required=true)
        private org.apache.maven.execution.MavenSession session
      • argLine

        @Parameter
        private java.lang.String argLine
        Deprecated.
        use jvmArgs instead.
        Arbitrary JVM options to set on the command line.
      • jvmArgs

        @Parameter
        private java.util.List<java.lang.String> jvmArgs
        List of JVM arguments set on the command line. Example:
         <jvmArgs>
           <args>-Xdebug</args>
           <args>-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=1044</args>
         </jvmArgs>
         
        Since:
        0.25.0
      • skip

        @Parameter(property="eclipserun.skip",
                   defaultValue="false")
        private boolean skip
        Whether to skip mojo execution.
      • appArgLine

        @Parameter
        private java.lang.String appArgLine
        Deprecated.
        use applicationsArgs instead.
        Arbitrary applications arguments to set on the command line.
      • applicationsArgs

        @Parameter
        private java.util.List<java.lang.String> applicationsArgs
        List of applications arguments set on the command line. Example:
         <applicationsArgs>
           <args>-buildfile</args>
           <args>build-test.xml</args>
         </applicationsArgs>
         
        Since:
        0.24.0
      • forkedProcessTimeoutInSeconds

        @Parameter(property="eclipserun.timeout")
        private int forkedProcessTimeoutInSeconds
        Kill the forked process after a certain number of seconds. If set to 0, wait forever for the process, never timing out.
      • environmentVariables

        @Parameter
        private java.util.Map<java.lang.String,​java.lang.String> environmentVariables
        Additional environments to set for the forked JVM.
      • logger

        @Component
        private org.codehaus.plexus.logging.Logger logger
    • Constructor Detail

      • EclipseRunMojo

        public EclipseRunMojo()
    • Method Detail

      • execute

        public void execute()
                     throws org.apache.maven.plugin.MojoExecutionException,
                            org.apache.maven.plugin.MojoFailureException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
        org.apache.maven.plugin.MojoFailureException
      • addDefaultDependency

        private void addDefaultDependency​(P2Resolver resolver,
                                          java.lang.String bundleId)
      • addDefaultDependencies

        private void addDefaultDependencies​(P2Resolver resolver)
      • createEclipseInstallation

        private EquinoxInstallation createEclipseInstallation()
                                                       throws org.apache.maven.plugin.MojoFailureException
        Throws:
        org.apache.maven.plugin.MojoFailureException
      • runEclipse

        private void runEclipse​(EquinoxInstallation runtime)
                         throws org.apache.maven.plugin.MojoExecutionException,
                                org.apache.maven.plugin.MojoFailureException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
        org.apache.maven.plugin.MojoFailureException
      • createCommandLine

        LaunchConfiguration createCommandLine​(EquinoxInstallation runtime)
                                       throws java.net.MalformedURLException,
                                              org.apache.maven.plugin.MojoExecutionException
        Throws:
        java.net.MalformedURLException
        org.apache.maven.plugin.MojoExecutionException
      • splitArgLine

        private java.lang.String[] splitArgLine​(java.lang.String argumentLine)
                                         throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException
      • getToolchain

        private org.apache.maven.toolchain.Toolchain getToolchain()
                                                           throws org.apache.maven.plugin.MojoExecutionException
        Throws:
        org.apache.maven.plugin.MojoExecutionException