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:
-
Switch to a new Eclipse workspace, and make sure JDK8 is installed
-
Then switch to Maven setting to check the Hide folders of physically nested modules option
-
Apply the changes, and create a new Maven project as below
-
Make sure NOT to tick the create simple project option in next page
-
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
-
From OneDev archetype list page, choose desired version and proceed to next page
-
Specify group id, artifact id and version of the new plugin. Note that for standalone plugins, group id should NEVER be io.onedev
-
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
-
From the popup dialog, run class io.onedev.commons.bootstrap.Bootstrap and start OneDev
-
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