Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Fix typos.

...

If you get the error message Unable to find a plugin class. Did you put @plugin in javadoc? this maybe caused by Eclipse and Maven both use using the target folder for build output.
Run mvn clean before building with Maven or change the output path.

...

Maven uses it for building your plugin.

src/main/java

Java source files of the plugin.

src/main/resources

Jelly/Groovy views of the plugin. See this document for more about it.

...

Let's take a look at the source code. A plugin's main entry point is a PluginImpl class that extends from Plugin. Once Jenkins detects your plugin class (via its inheritance relationship from Plugin), it will create an instance, and invokes invoke methods. A Plugin class is optional; a plugin may simply implement extensions:

Most of the time, a plugin class just registers extension points, and your main work involves in implementing those extension points. See the source code for more about how a Builder is implemented and what it does.

...

If you need to launch the Jenkins on a different port than 8080, set the port through the system property jetty.port.

No Format
$ mvn hpi:run -Djetty.port=8090

...

maven-hpi-plugin 1.65 or later (used by parent pom POM 1.401 or later) can set the context path by using a system property.

No Format
$ mvn hpi:run -Dhpi.prefix=/jenkins

...

To create a distribution image of your plugin, run the following Maven phasecommand:

No Format
$ mvn package

This should create target/*.hpi file. Other users can use Jenkins' web UI to upload this plugin to Jenkins (or place it in $JENKINS_HOME/plugins.)

...

  1. Consider running Maven like this mvn -o ... to avoid hitting repositories every time. This will make various operations considerably faster.
  2. Subscribe to the users' alias from here so that we can get in touch with you.
  3. When you bump up the version of Jenkins you depend on, make sure to run mvn clean once, in particular to delete target/work that Jetty uses. Newer versions may just use work, not target/work. Otherwise your Jetty may continue to pick up old left-over JAR files.