main
ROOT /
pages /
develop-standalone-plugins.md
43 lines | ISO-8859-1 | 2 KB

Develop Standalone Plugins


Standalone plugins do not ship together with OneDev, and can be developed without OneDev source code. Follow below steps to set up standalone plugin development environment:

  1. Switch to a new Eclipse workspace, and make sure JDK8 is installed

    use-jdk8

  2. Then switch to Maven setting to check the Hide folders of physically nested modules option

    hide-nested-maven-modules

  3. Apply the changes, and create a new Maven project as below

    create-new-maven-project

  4. Make sure NOT to tick the create simple project option in next page

    do-not-tick-simple-project-option

  5. Click the next button to go to next page. If this is the first time you are adding a OneDev plugin, you will need to click the configure button to add OneDev remote archetype catalog. The catalog url is: https://artifact.onedev.io/artifactory/onedev/archetype-catalog.xml. Apply and close the catalog adding dialog, Eclipse should list all OneDev archetypes. If you've already added the catalog before, just input io.onedev to filter the archetypes

    add-archetype-catalog

  6. From OneDev archetype list page, choose desired version and proceed to next page

    select-archetype

  7. Specify group id, artifact id and version of the new plugin. Note that for standalone plugins, group id should NEVER be io.onedev

    specify-groupid-artifactid

  8. Finish adding the plugin, and Eclipse will take a while to download dependencies and build the plugin. To run the plugin from Eclipse, right click the project, and select run as Java application

    run-as-application

  9. From the popup dialog, run class io.onedev.commons.bootstrap.Bootstrap and start OneDev

    bootstrap

  10. To package the plugin after development, run mvn clean package under the plugin folder. A plugin zip will be created under the target directory, for instance com.example.myplugin-0.0.1-SNAPSHOT.zip. This zip contains plugin code and necessary dependencies. To deploy the plugin, copy the zip into site/lib folder of a OneDev installation and restart OneDev

Please wait...
Page is in error, reload to recover