Common project files for custom plugins
The example repositories for building custom plugins are Java projects based on the Maven build system. All example repositories include the following common project files. Make sure you understand these project files before building your custom plugin.
重要
All example repositories include a README.md file with important details about the project dependencies, file hierarchy, build process, and more. Review this information carefully before developing your custom plugin.
Project files
The following project files define common settings, dependencies, and actions for developing custom plugins. These files are found in the top-level directory of each example repository.
build.sh
Description
Shell script to build the project by generating the Maven assets and creating the final Zip file for upload into Trust Lifecycle Manager. The script also generates an SHA-256 checksum to ensure the integrity of the Zip file.
Required updates
Before running this script, make sure the settings.xml file includes the required credentials.
configuration.json
Description
Default JSON file for configuring the plugin in Trust Lifecycle Manager. To enable the plugin, you must upload the JSON configuration file along with the final Zip file.
Required updates
Update this file to match the required parameters for your plugin. For details, see Create the plugin configuration.
pom.xml
Description
Contains all the information Maven needs to build the project, including core dependencies, plugins, and build configurations.
The build-plugin-fat-jar execution block defines the main Java class to execute during runtime. Default value is com.example.discovery.MyDiscoveryPluginRunner.
Required updates
If your custom code includes additional dependencies, you must include them here.
If your plugin defines a different main class than the default, update the
mainClassvalue in thebuild-plugin-fat-jarexecution block.
settings.xml
Description
Defines required settings for running the Maven build command, including access to an additional GitHub repository with core plugin SDK files and dependencies.
If you will run the build script as part of GitHub actions, the required credentials get populated automatically. Otherwise, you must supply the credentials as described on the right. The credentials must come from a personal access token (classic) in GitHub.
Required updates
To run the build script locally, use one of the following methods to provide the required GitHub credentials:
Recommended: Define the following environment variables with the credentials to use:
GITHUB_ACTORorGITHUB_USER(username) andGITHUB_TOKEN(password).Alternative: Add the credentials to the
usernameandpasswordfields in the settings.xml file.
zip.xml
Description
Defines the list of files to include in the final Zip file for the plugin.
Required updates
None.
What's next
The way you customize and build your plugin depends on the plugin type: