Build a CPK heading-link-icon

This section describes how to create CPKs. It contains the following:

To configure your CPK project:

  1. Add the CPK plugin to your project by adding the following to the start of the build.gradle file of your CorDapp Corda Distributed Application. A Java (or any JVM targeting language) application built using the Corda build toolchain and CorDapp API to solve some problem that is best solved in a decentralized manner. Gradle project:

    plugins {
        id 'net.corda.plugins.cordapp-cpk2'
    }
    
  2. Apply the net.corda.cordapp.cordapp-configuration plugin to your root Gradle project, to configure the cordapp-cpk2 plugin for your version of Corda:

    plugins {
        id 'net.corda.cordapp.cordapp-configuration'
    }
    

    If your Gradle project only contains a single module, apply both plugins together:

    plugins {
        id 'net.corda.cordapp.cordapp-configuration'
        id 'net.corda.plugins.cordapp-cpk2'
     }
    
  3. Declare both plugins’ versions in the settings.gradle file:

    pluginManagement {
        plugins {
            id 'net.corda.cordapp.cordapp-configuration' version cordaReleaseVersion
            id 'net.corda.plugins.cordapp-cpk2' version cpkPluginVersion
        }
    }
    

    cpkPluginVersion and cordaReleaseVersion are both Gradle properties. For example:

    cpkPluginVersion = '6.0.0'
    cordaReleaseVersion = '5.1.0'
    

To sign with a key other than the default key, add a cordapp/signing section to the project settings.gradle file.

  1. Run the jar Gradle task:
    ./gradlew jar
    

Was this page helpful?

Thanks for your feedback!

Chat with us

Chat with us on our #docs channel on slack. You can also join a lot of other slack channels there and have access to 1-on-1 communication with members of the R3 team and the online community.

Propose documentation improvements directly

Help us to improve the docs by contributing directly. It's simple - just fork this repository and raise a PR of your own - R3's Technical Writers will review it and apply the relevant suggestions.

We're sorry this page wasn't helpful. Let us know how we can make it better!

Chat with us

Chat with us on our #docs channel on slack. You can also join a lot of other slack channels there and have access to 1-on-1 communication with members of the R3 team and the online community.

Create an issue

Create a new GitHub issue in this repository - submit technical feedback, draw attention to a potential documentation bug, or share ideas for improvement and general feedback.

Propose documentation improvements directly

Help us to improve the docs by contributing directly. It's simple - just fork this repository and raise a PR of your own - R3's Technical Writers will review it and apply the relevant suggestions.