org.jenkinsci.maven.plugins.hpi
Class RunMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.jenkinsci.maven.plugins.hpi.AbstractJettyMojo
          extended by org.jenkinsci.maven.plugins.hpi.AbstractJetty6Mojo
              extended by org.jenkinsci.maven.plugins.hpi.RunMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

public class RunMojo
extends AbstractJetty6Mojo

Runs Jenkins with the current plugin project.

This only needs the source files to be compiled, so run in the compile phase.

To specify the HTTP port, use -Djetty.port=PORT

Author:
Kohsuke Kawaguchi

Field Summary
protected  org.apache.maven.artifact.factory.ArtifactFactory artifactFactory
           
protected  org.apache.maven.artifact.metadata.ArtifactMetadataSource artifactMetadataSource
           
protected  org.apache.maven.artifact.resolver.ArtifactResolver artifactResolver
           
protected  boolean consoleForceReload
          If true, the context will be restarted after a line feed on the input console.
protected  java.lang.String defaultPort
          Specifies the HTTP port number.
protected  java.lang.String jenkinsCoreId
          Optional string that represents "groupId:artifactId" of Jenkins core jar.
protected  java.lang.String jenkinsWarId
          Optional string that represents "groupId:artifactId" of Jenkins war.
protected  org.apache.maven.artifact.repository.ArtifactRepository localRepository
           
protected  java.lang.String maskClasses
          [ws|tab|CR|LF]+ separated list of package prefixes that your plugin doesn't want to see from the core.
protected  org.apache.maven.project.MavenProjectBuilder projectBuilder
           
protected  java.io.File warSourceDirectory
          Single directory for extra files to include in the WAR.
 
Fields inherited from class org.jenkinsci.maven.plugins.hpi.AbstractJettyMojo
PORT_SYSPROPERTY
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
RunMojo()
           
 
Method Summary
 void checkPomConfiguration()
           
 void configureScanner()
           
 void configureWebApplication()
          Subclasses should invoke this to setup basic info on the webapp
 JettyPluginServer createServer()
          create a proxy that wraps a particular jetty version Server object
 void execute()
           
 void finishConfigurationBeforeStart()
           
protected  java.lang.String getDefaultHttpPort()
           
protected  org.apache.maven.artifact.Artifact getJenkinsWarArtifact()
           
 java.util.Set<MavenArtifact> getProjectArtfacts()
           
protected  void startScanner()
          Run a scanner thread on the given list of files and directories, calling stop/start on the given list of LifeCycle objects if any of the watched files change.
protected  MavenArtifact wrap(org.apache.maven.artifact.Artifact a)
           
 
Methods inherited from class org.jenkinsci.maven.plugins.hpi.AbstractJetty6Mojo
applyJettyXml, getConfiguredConnectors, getConfiguredRequestLog, getConfiguredUserRealms
 
Methods inherited from class org.jenkinsci.maven.plugins.hpi.AbstractJettyMojo
findJettyWebXmlFile, getContextPath, getJettyXmlFileName, getProject, getScanIntervalSeconds, getScanList, getScannerListeners, getServer, getSystemProperties, getTmpDirectory, getWebApplication, getWebDefaultXml, setScanList, setScannerListeners, setServer, setWebApplication, startJetty
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

warSourceDirectory

protected java.io.File warSourceDirectory
Single directory for extra files to include in the WAR.


artifactResolver

protected org.apache.maven.artifact.resolver.ArtifactResolver artifactResolver

artifactFactory

protected org.apache.maven.artifact.factory.ArtifactFactory artifactFactory

localRepository

protected org.apache.maven.artifact.repository.ArtifactRepository localRepository

artifactMetadataSource

protected org.apache.maven.artifact.metadata.ArtifactMetadataSource artifactMetadataSource

defaultPort

protected java.lang.String defaultPort
Specifies the HTTP port number. If connectors are configured in the Mojo, that'll take precedence.


consoleForceReload

protected boolean consoleForceReload
If true, the context will be restarted after a line feed on the input console. Disabled by default.


projectBuilder

protected org.apache.maven.project.MavenProjectBuilder projectBuilder

jenkinsCoreId

protected java.lang.String jenkinsCoreId
Optional string that represents "groupId:artifactId" of Jenkins core jar. If left unspecified, the default groupId/artifactId pair for Jenkins is looked for.

Since:
1.65

jenkinsWarId

protected java.lang.String jenkinsWarId
Optional string that represents "groupId:artifactId" of Jenkins war. If left unspecified, the default groupId/artifactId pair for Jenkins is looked for.

Since:
1.68

maskClasses

protected java.lang.String maskClasses
[ws|tab|CR|LF]+ separated list of package prefixes that your plugin doesn't want to see from the core.

Tokens in this list is prefix-matched against the fully-qualified class name, so add "." to the end of each package name, like "com.foo. com.bar."

Constructor Detail

RunMojo

public RunMojo()
Method Detail

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException,
                    org.apache.maven.plugin.MojoFailureException
Specified by:
execute in interface org.apache.maven.plugin.Mojo
Overrides:
execute in class AbstractJettyMojo
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException

configureWebApplication

public void configureWebApplication()
                             throws java.lang.Exception
Description copied from class: AbstractJettyMojo
Subclasses should invoke this to setup basic info on the webapp

Overrides:
configureWebApplication in class AbstractJettyMojo
Throws:
org.apache.maven.plugin.MojoExecutionException
java.lang.Exception

configureScanner

public void configureScanner()
                      throws org.apache.maven.plugin.MojoExecutionException
Specified by:
configureScanner in class AbstractJettyMojo
Throws:
org.apache.maven.plugin.MojoExecutionException

startScanner

protected void startScanner()
Description copied from class: AbstractJettyMojo
Run a scanner thread on the given list of files and directories, calling stop/start on the given list of LifeCycle objects if any of the watched files change.

Overrides:
startScanner in class AbstractJettyMojo

checkPomConfiguration

public void checkPomConfiguration()
                           throws org.apache.maven.plugin.MojoExecutionException
Specified by:
checkPomConfiguration in class AbstractJettyMojo
Throws:
org.apache.maven.plugin.MojoExecutionException

finishConfigurationBeforeStart

public void finishConfigurationBeforeStart()
Specified by:
finishConfigurationBeforeStart in class AbstractJettyMojo

getDefaultHttpPort

protected java.lang.String getDefaultHttpPort()
Overrides:
getDefaultHttpPort in class AbstractJettyMojo

createServer

public JettyPluginServer createServer()
                               throws java.lang.Exception
Description copied from class: AbstractJettyMojo
create a proxy that wraps a particular jetty version Server object

Overrides:
createServer in class AbstractJetty6Mojo
Returns:
Throws:
java.lang.Exception
See Also:
org.mortbay.jetty.plugin.AbstractJettyMojo#createServer()

getProjectArtfacts

public java.util.Set<MavenArtifact> getProjectArtfacts()

wrap

protected MavenArtifact wrap(org.apache.maven.artifact.Artifact a)

getJenkinsWarArtifact

protected org.apache.maven.artifact.Artifact getJenkinsWarArtifact()
                                                            throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException


Copyright © 2012. All Rights Reserved.