Skip to content
Collection of Maven archetypes to get developers started
Java Groovy HTML Dockerfile
Branch: master
Clone or download
dependabot-preview Bump io.jenkins.tools.bom:bom
Bumps [io.jenkins.tools.bom:bom](https://github.com/jenkinsci/bom) from 2.164.1 to 2.164.2.
- [Release notes](https://github.com/jenkinsci/bom/releases)
- [Commits](jenkinsci/bom@bom-2.164.1...bom-2.164.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Latest commit a966026 Sep 9, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.dependabot Dependabot config. Jun 19, 2019
.github Create Release Drafter configuration for the repository Jun 18, 2019
empty-plugin Switch recommended /project/url from Confluence to GitHub. Sep 4, 2019
global-configuration Switch recommended /project/url from Confluence to GitHub. Sep 4, 2019
global-shared-library Bump groovy-eclipse-batch Aug 13, 2019
hello-world Bump io.jenkins.tools.bom:bom Sep 9, 2019
scripted-pipeline Bump groovy-eclipse-batch Aug 13, 2019
.gitignore Adding pt_BR translations for hello world plugin Oct 27, 2018
Dockerfile Pin the syntax. Jun 19, 2019
Jenkinsfile Stray quote. Aug 12, 2019
README.md Merge pull request #42 from imod/patch-1 Jun 18, 2019
pom.xml
settings-azure.xml mirrorOf=* Sep 2, 2017

README.md

Introduction

Maven archetypes to help you create new components involving Jenkins, such as plugins.

GitHub release

Usage

To see all currently released archetypes and pick one to instantiate:

mvn archetype:generate -Dfilter=io.jenkins.archetypes:

It is also possible to run this noninteractively:

mvn archetype:generate -B -DarchetypeGroupId=io.jenkins.archetypes -DarchetypeArtifactId=empty-plugin -DarchetypeVersion=1.1 -DartifactId=somefeature

In olden times, people used mvn hpi:create or even a web-based tool to create new plugins. This has been deprecated in favor of the new archetypes, which cover more scenarios and require no special tooling.

The NetBeans IDE also offers a plugin for Jenkins development which offers a Jenkins plugin archetype via the File » New Project wizard.

If you have defined a mirror like this in your settings.xml you might not be able to use filter option as described above.

 <mirror>
   <id>repo.jenkins-ci.org-all</id>
   <url>https://repo.jenkins-ci.org/public</url>
   <mirrorOf>*</mirrorOf>
</mirror>

Changes

WARNING: Changelogs have been moved to GitHub Releases

Newer versions

See GitHub Releases

1.4 (2018 Mar 12)

  • Added JenkinsPipelineUnit archetypes.

1.3 (2018 Feb 09)

  • Changed default package name to use io.jenkins. prefix.
  • Sundry POM updates.

1.2 (2017 Oct 12)

  • Added sample of GlobalConfiguration.
  • Empty plugin archetype includes a test root.
  • Sample .gitignore files included for the convenience of people using Git.

Development

To create a new archetype, file a pull request creating a new module, following the examples currently here. Important pieces:

  • pom.xml must have <packaging>maven-archetype</packaging>
  • should also have a <description>
  • src/main/resources/META-INF/maven/archetype-metadata.xml defines files and directories to be copied & processed
  • src/main/resources/archetype-resources/: the template for the new component (remember a sample .gitignore)
  • src/test/resources/projects/testInstall/{goal.txt,archetype.properties}: defines an integration test, proving that the archetype can not just be instantiated, but builds successfully thereafter

Archetypes are expected to use technologies hosted in @jenkinsci (or a few other places pulled in by Jenkins core, such as @stapler). Other archetypes can be developed in a profile but will not be published. Releasing:

mvn -B release:{prepare,perform}

In addition to needing write permission to this repository, you must have been preauthorized to deploy to the io/jenkins/archetypes/ sector of OSSRH.

Artifacts will appear on Maven Central after a few minutes. But as noted in OSSRH-34275, the catalog only gets regenerated weekly; to check it:

curl -s http://repo1.maven.org/maven2/archetype-catalog.xml | xmlstarlet sel -R -I -t -c '//archetype[groupId="io.jenkins.archetypes"]'

If testing their appearance, be sure to use a clean environment:

docker run -ti --rm --name mvn --entrypoint /bin/bash maven:3.5.0-jdk-8

TODO

  • HelloWorldBuilderTest should use BuildWatcher
  • convert ui-samples-plugin to an archetype
  • .gitignore files do not get copied to actual archetype
  • add Step sample as per this example
You can’t perform that action at this time.